#### Archived

This topic is now archived and is closed to further replies.

# Point Rotation Help

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

## Recommended Posts

Quick Brief: I am making an overhead car game (how original) and i am using a point on each corner of the car to test for collision. The idea was to rotate the point with the rotation of the car. The problem: When I rotate the points using Xnew=(X*(cos theta))-(Y*(sin theta)) Ynew=(X*(sin theta))+(Y*(cos theta)) The point spirals into the center! the rotation i am after is 22.5 degrees an i am converting to radians using rad=deg*(pi/180) Any help will be much appriciated,Thankyou

##### Share on other sites
Your formulas are good. I think it''s due to rounding error : by applying multiple rotation each followed by a rounding, the dimensions of your car are modified (shrinking). You should keep somewhere the actual angle of rotation of your car and apply the rotation to the "angle 0" or original car at each time.

hope so...

##### Share on other sites
hi

well your formulae are correct. make sure you are not performing rotations on already rotated points. ie. keep an array of ORIGINAL points which never alter. when it comes to rotation, base your calculations on the original array and store the result in the new array.

##### Share on other sites
Thanks i''ll try that, I did try after 360 rotation had happend to reset the starting points, but it didnt change the spiral, but yes i was rotating rotated points

##### Share on other sites
I am now in/de-creasing the angle and the applying it the initial Point coords and is working fine, Thank again.

1. 1
Rutin
27
2. 2
3. 3
4. 4
5. 5

• 11
• 11
• 10
• 13
• 20
• ### Forum Statistics

• Total Topics
632948
• Total Posts
3009398
• ### Who's Online (See full list)

There are no registered users currently online

×