Processing
Draw
Draw
Note:
If your program doesn’t have a size() function, the dimension is set to 100×100 pixels
Draw a point
size(480, 120);
point(240, 60);
Basic Shapes
Draw a line
size(480, 120);
line(20, 50, 420, 110);
Draw Basic Shapes
size(480, 120);
quad(158, 55, 199, 14, 392, 66, 351, 107);
triangle(347, 54, 392, 9, 392, 66);
triangle(158, 55, 290, 91, 290, 112);
Draw Rectangle
size(480, 120);
rect(180, 60, 220, 40);
Draw an Ellipse
size(480, 120);
ellipse(278, -100, 400, 400);
ellipse(120, 100, 110, 110);
ellipse(412, 60, 18, 18);
Draw Part of an Ellipse
size(480, 120);
arc(90, 60, 80, 80, 0, HALF_PI);
arc(190, 60, 80, 80, 0, PI+HALF_PI);
arc(290, 60, 80, 80, PI, TWO_PI+HALF_PI);
arc(390, 60, 80, 80, QUARTER_PI, PI+QUARTER_PI)
Radian and degrees measurements
Draw with Degrees
size(480, 120);
arc(90, 60, 80, 80, 0, radians(90));
arc(190, 60, 80, 80, 0, radians(270));
arc(290, 60, 80, 80, radians(180), radians(450));
arc(390, 60, 80, 80, radians(45), radians(225));
Thanks
(Semangat…!)