Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I want to move one object (dot) in circular path.

By using x and y position of that object.

Thanks.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

x and y should satisfy $x^2+y^2=r^2$, where r is radius of the circle.

share|improve this answer
    
How to move the point in circular path by adding value of x and y? i want to create a circular path by looping the formula. –  Ganapathy Mar 11 '11 at 6:03
4  
let x=rcos(t), y=rsin(t), loop over t –  user1708 Mar 11 '11 at 6:06
    
this works exactly dude Thanks a lot... –  Ganapathy Mar 11 '11 at 6:45

Is this part of a piece of software? Clarification on what you need would be very helpful.

If the object each frame has a velocity vector which it follows, just rotate the velocity vector through some fixed angle each frame. The easiest way would be to build a rotation matrix and multiply by the matrix. In a very naive implementation, you would then add the velocity to the position vector each frame. In most applications, this is insufficient, and it is preferable to use Verlet integration, mainly in the presence of acceleration.

Or you can parameterize the points on the circle as a function of time using the relations $x = c_x + r\cos(t), y = c_y + r\sin(t)$ for $(c_x,c_y)$ the circle's center, $r$ its radius, and $t$ the time.

share|improve this answer
    
thanks dude..... –  Ganapathy Mar 11 '11 at 6:47

There are a few ways to choose from, but a nice one that doesn't require per-step trig functions (so can be calculated by a computer very quickly) is the midpoint circle algorithm.

Otherwise, you can use x=cos(theta)*radius, y=sin(theta)*radius for 0 < theta < 360.

share|improve this answer
    
Thanks for UR response –  Ganapathy Mar 11 '11 at 6:45

Your Answer

 
discard

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.