Jump to content
  • Advertisement
Sign in to follow this  
jad_salloum

simple translation Question

This topic is 4862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi guys i have a simple question coz i 4got math concepts ;) . i have a point A on a circle in 2d and i want to translate it to a point B on the circle and the angle between them is 75 degree how i can do this ?? how to calculate the coordinates of the point B ??? thanks for any help please see an image explaining this on the following website http://tinypic.com/i1yzj9.jpg [Edited by - jad_salloum on November 30, 2005 3:32:47 AM]

Share this post


Link to post
Share on other sites
Advertisement
Well, if point A lies on the circle, than its position pA could be determined by the center cC of the circle, the radius rC of the circle, and the angle aA under which is appears, like in:
pA := cC + [ rC * cos(aA) , rC * sin(aA) ]^T
(where zero radians mean the +x direction, and pi/2 radians the +y direction).

You could also determine the angle aA from this formula if the position pA and the circle are given.

Similarly the pB is defined, but with an angle aB that is 75 degrees away:
pB := cC + [ rC * cos(aB) , rC * sin(aB) ]^T
where
aB := aA +/- radians(75 degrees)
(from your linked picture I would use the minus sign).

Share this post


Link to post
Share on other sites
Quote:
Original post by jad_salloum
thanks haegarr for ur reply but what do u mean by " ^T " ?????
haegarr can correct me if I'm wrong, but I think the ^T is just to indicate a column vector, and in this particular case can be ignored, more or less.

Also, it seems what you're wanting to do is actually a rotation rather than a translation. That is, you want to rotate the vector from the circle center to A by 75 degrees. Pseudocode:
B = A-C;
angle = degToRad(angle);
B.Set(cos(angle)*B.x-sin(angle)*B.y,sin(angle)*B.x+cos(angle)*B.y);
B += C;

Share this post


Link to post
Share on other sites
Quote:
Original post by jyk
Quote:
Original post by jad_salloum
thanks haegarr for ur reply but what do u mean by " ^T " ?????
haegarr can correct me if I'm wrong, but I think the ^T is just to indicate a column vector, and in this particular case can be ignored, more or less.

No need to correct, jyk is right. The T stands for "transpose". Especially here I've written them to make clear that the [] terms denote vectors. From the programmer's point of view they can be ignored here.

Share this post


Link to post
Share on other sites
Only to show (jad_salloum) the interrelation:

In fact the solution I've posted is also a rotation. Jyk's solution rotates an arbitrary point by "angle". My solution rotates a special point, namely
pR := [1,0]^T
by "angle" plus the angle of pA. If you put in pR and the sum of angles into jyk's formula, you'll see the identity.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!