Plotting a circle
Monkey Forums/Monkey Programming/Plotting a circle
| ||
Hi, sorry, really easy problem I imagine - trying to plot points on a circle. Found some C++ code, and thought I'd converted it ok, but I simply can't get it to work.Local x:Int Local y:Int Local length:Int = 50 Local angle:float = 0.0 Local angle_stepsize:float = 0.1 SetColor 255, 255, 255 While (angle < 2 * PI) x = length * Cos(angle) y = length * Sin(angle) DrawPoint(x + 100, y + 100) angle = angle + angle_stepsize Wend Any help? :) |
| ||
try this:x = length * Cosr(angle) y = length * Sinr(angle) |
| ||
Ugh damnit radians not degrees... I didn't even consider there was a different command. Math is not my top subject in the world :P You sir have earned a virtual beer - enjoy :P |