# 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.

## 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 on other sites
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)

##### Share on other sites

thanks haegarr for ur reply but what do u mean by " ^T " ?????

##### Share on other sites
Quote:
 Original post by jad_salloumthanks 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 on other sites
Quote:
Original post by jyk
Quote:
 Original post by jad_salloumthanks 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 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.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 14
• 11
• 29
• 15
• 41
• ### Forum Statistics

• Total Topics
634838
• Total Posts
3019568
×