It does work, and I've ensured that at no point does either X or Y equal NaN. However, when Y approaches 0, it seems to go significantly faster. This surprises me, because the Y values are locked to the X, which is being incremented by a steady amount. What can I do to smooth the speed?

2 Answers
2

The problem here is that sqrt(a*a + b*b) is non behaving in the way you expected it is non-linear as you can clearly see here:

I don't see any immidiate way on how to fix this. (To be honest I'm surprised this worked in the first place). But I can give you the standard algorithm to accomplish this. This will also keep speed constant and you can use the values of the cos and sin operations later to rotate the player towards the center of your circle.

This is about as efficient as calculating the derivate position.X -= speed * (Math.Sin(time*speed) * radius
–
MSaltersSep 21 '12 at 14:51

I derived my original function from (x−h)^2+(y−k)^2=r^2, though I suppose that since that function is to plot a circle and not necessarily navigate a circle, it wasn't the best choice. Yours worked much better.
–
FibericonSep 21 '12 at 15:40

Both ways are valid (first one - logically, like a clock, second - mathematically), they just change starting point (top for first, right side for second) and default direction (when speed is positive, clockwise for first, counter-clockwise for second). Speed and offset are measured in radians.