Complete all of the following exercises in just one sketch. The circles can be drawn where the mouse is clicked and the arrows should be drawn when the sketch starts (that is, in setup()
).
Adapt the Square example to draw a circle instead of a square. Make sure to rename the square
function to circle
, and recall that drawing a centered circle is much easier than drawing a centered square!
Write a function void arrow(float size)
that makes an arrow (just use three calls to line()
) point from the origin to (size, 0)
. That is, the arrow points to the right has has length size
. Without translate()
, you would not be able to see the top half of the arrow.
Use translate()
and arrow()
to draw an arrow from (100, 100)
to (150, 100)
.
Use translate()
, rotate()
and arrow()
to draw an arrow from (200, 150)
to (200, 250)
. Note that this arrow points down!