// Example 8 - Arc
function setup() {
createCanvas(640, 480);
// gray background
background(192);
// magenta stroke of 5, green fill
stroke(255, 0, 255);
strokeWeight(5);
fill(0, 255, 0);
// top-left - default mode
arc(0.25*width, 0.25*height, 200, 100, 0, 1.5*PI);
// top-right - OPEN mode
arc(0.75*width, 0.25*height, 200, 100, 0, 1.5*PI, OPEN);
// bottom-left - CHORD mode
arc(0.25*width, 0.75*height, 200, 100, 0, 1.5*PI, CHORD);
// bottom-right - PIE mode
arc(0.75*width, 0.75*height, 200, 100, 0, 1.5*PI, PIE);
}
Output:
No comments:
Post a Comment