Jump to content
  • Advertisement
Sign in to follow this  
Deeza

Rotating 2D Vectors

This topic is 3820 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

Hello, I've been trying to understand the math behind rotating 2D vectors for some time now and I can't seem to figure it out. I've been reading up on Sine and Cosine, and I feel like I've learned more about them, but it still doesn't help me with this specific issue. I don't like using things without understanding them, so hopefully someone can post an explanation. If you also know of any good books/sources that explain this, I'd appreciate if you posted them. The formula: x' = cos(theta)*x - sin(theta)*y y' = sin(theta)*x + cos(theta)*y Thanks

Share this post


Link to post
Share on other sites
Advertisement
I am not sure how much you understand about sin and cos but I am a pretty dumb guy myself and it took me a while before I got this concept.

Think about a Cartesian coordinate system where you can plot a point at (x,y).

Now imagine a unit circle whose radius is 1. Cos is similar to "x" and Sin is similar to "y". The Cos and Sin functions give you the x,y coordinate on the edge of the unit circle.

So as you can imagine, if you continue to increase the angle input for Cos and Sin, the new points x1 and x2 will draw a circle as expected which leads into rotation. Sorry, I hope that makes sense.

Share this post


Link to post
Share on other sites
The pdf smitty presented you with is a good explanation. However I would highly recommend you purchase the following book.

"3D Math Primer for Graphics and Game Development"
By: Fletcher Dunn and Ian Parberry
# ISBN-10: 1556229119
# ISBN-13: 978-1556229114

You can purchase the book at amazon if you follow the link below.
http://www.amazon.com/Primer-Graphics-Development-Wordware-Library/dp/1556229119/ref=sr_1_1?ie=UTF8&s=books&qid=1201635348&sr=8-1

Chapter 7 and 8 would be of especial interest to you I believe.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!