Rotating 2D Vectors

Started by
3 comments, last by Deeza 16 years, 2 months ago
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
Advertisement
Here is a PDF which seems to explain the derivation of a rotation matrix pretty well. I just googled "derivation rotation matrix" to find it, and there is a lot more.
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.
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.
Wow, thanks for the fast responses. All of the information provided is great!

This topic is closed to new replies.

Advertisement