Jump to content
  • Advertisement
Sign in to follow this  
Woody FX

Rotating a rectangle

This topic is 3626 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. Is there a simple way to rotate a rectangle and keep track of the coordinates of each of the corners? Say for example we had a rectangle whoes corners were (0,0) (0,10) (5,10) (5,0). And if we were to rotate the rectangle by 45degrees clockwise. Is there a simple way to use that data to generate the new coordinates of the corners? I'm working on a device with no fixed point or floating point support, but I can work around that if I got some general idea of how to approach the problem. Thannks -Woody

Share this post


Link to post
Share on other sites
Advertisement
Thank you Schildpad :)

So if i read it correctly to get the new coordinate of the rotated x coordinate
is :
x(cos of the angle to rotate) + y(sin of the angle to rotate)

Thanks again,
-Woody

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!