Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I want to move one object (dot) in a circular path. How should I change the X and Y coordinates to accomplish this?

share|improve this question
I'm betting you could find the answer to that question anywhere. This may help, for instance gamedev.stackexchange.com/questions/7365/… –  Kensai Mar 11 '11 at 7:20
ya thank you dude.. i got it.. +1 –  Ganapathy Mar 11 '11 at 7:29
Page Not Found @Kensai –  Real_steel4819 Aug 7 at 6:39
Would you post the answer if you have find out the solution @Ganapathy –  Real_steel4819 Aug 11 at 6:21
@Real_steel4819 please follow @ KromStern answer. –  Ganapathy Aug 11 at 6:36

2 Answers 2

up vote 13 down vote accepted

You can make it by using simple math.

X := originX + sin(angle)*Size;
Y := originY + cos(angle)*Size;

Origin is the center of your circle. Size is the radius of that circle. Thats it.

share|improve this answer
thanks dude this is the exact thing i want... +1 –  Ganapathy Mar 11 '11 at 7:37

There's another trick, where you use the sin(x+a) and cos(x+a) formulas, and that allows you to compute sin(a) and cos(a) -- a being the angle by which you want to move from your current position -- only once and do simply multiplication and additions at each step.

sin(x+a) = sin(x)*cos(a) + cos(x)*sin(a), iirc.

Of course, that assumes constant angular velocity.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.