URGENT - Rotation questions..

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

Recommended Posts

How do I rotate a point around the origin by lets say 30 degrees for example? If I have a point at (4,7) how do I rotate it about the origin in the 2D plane (rotation about the Z-axis)..?

Share on other sites
Hi ArchangelMorph, this is how you do it:

x' = x * cos(theta) - y * sin(theta)y' = x * sin(theta) + y * cos(theta)

Share on other sites
I'll assume you have a little knowledge of Matrix multiplication. I use a column vector convention... so, if I wanted to rotate the point x,y about the origin by angle Z. I would multiply:
|cosZ -sinZ||x|
|sinZ cosZ||y|
Using homogeneous coordinates this becomes:
|cosZ -sinZ 0||x|
|sinZ cosZ 0||y|
| 0 0 1||1|

In case you didn't know matrix multiplication this is how it works:
You can only multiply matrices whose inner dimension are the same. For example this is a 3x3 * 3x1. You could NOT do 3x3 * 1x3. The result is the outer dimensions. In this case a 3x1. To find a specific elements [j] answer you take the dot product(i'll elaborate later) of the ith row of the first matrix and the jth column of the second matrix.

The dot product is computed as follows. For 2 elements. List1 = {a,b}, List2 = {c,d}... dot product = a*c + b*d... For 3 elements. List 1 = {a,b,c}, List2 = {d,e,f}... dot product = a*d + b*e + c*f... and so on for more elements you just sum the products of elements in the same position. Hope that helped

Share on other sites
Thnx sooo much guys!!

1. 1
2. 2
3. 3
4. 4
Rutin
17
5. 5

• 14
• 9
• 10
• 12
• 17
• Forum Statistics

• Total Topics
632907
• Total Posts
3009164
• Who's Online (See full list)

There are no registered users currently online

×