The arclength (distance around a circle) is given by s = rϑ
. Since you want to do this based on a speed, you can take the derivative (basically, divide by t on both sides): v = rϑ/t
, or ϑ = vt/r
. Internally, you'll store the values of r
,v
, and t
and use the concept of the unit circle to get the actual x
and y
values:
x = r * cos(ϑ) = r * cos(vt/r)
y = r * sin(ϑ) = r * sin(vt/r)
while you increment t
on every draw cycle. You'll of course have to translate (x,y)
based on the center of the circle.