# rotating 1 point about another

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

## Recommended Posts

okay.. I have 2 points A and B I know A's coords and length from A to B is constant I also know the angle that B will be from A so how do i find out B's coords at that angle.. edit:: I should say that the angle is in radians thanks..

##### Share on other sites
Assuming 2D...

B.x = A.x + length * cos( angle );
B.y = A.y + length * sin( angle );

This assumes that if angle == 0, the the line AB is parallel to the X axis.

##### Share on other sites
Quote:
 Original post by JohnBoltonAssuming 2D...B.x = A.x + length * cos( angle );B.y = A.y + length * sin( angle );This assumes that if angle == 0, the the line AB is parallel to the X axis.

Or, if you prefer,

B.x = A.x + length * cos( angle + theta );
B.y = A.y + length * sin( angle + theta );

Where you adjust theta so that when angle == 0 the following is true:

cos( theta ) = (B.x - A.x)/length
sin( theta ) = (B.y - A.y)/length

• ### What is your GameDev Story?

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

• 11
• 11
• 15
• 11
• 11
• ### Forum Statistics

• Total Topics
634149
• Total Posts
3015834
×