Processing Help -Draw line at given angle
May 29, 2010
If someone could point me in the right direction here -or- maybe a link to some code examples.
I would like to draw a line from a fixed point, a given length and at a given angle. I have found some examples that show a line that will follow your mouse and will rotate around a fixed point, but not one including length.
Here is what I am looking at doing:
I want to draw a map (just a line showing a path) on my screen as walter travels around. Each time walter changes direction, a little data packet is sent describing his last move. I.e.
fwd (16) counts (send that to processing and a line is drawn from starting point and is (16) units long)
rotated (4) counts or 1/4 turn (send to processing and the angle of the next line is determined)
fwd (27) counts (a line, 27 units long is drawn at the angle determined above)
Each new line segment will start from the end of the last one drawn.