What are "clockwise" and "counter-clockwise" in matrix rotation?
MOVED: Moving this question to math.stackexchange.com and closing it.
I'm learning about the math invovled in PCA. For my purposes here, I'm just trying to understand a 90° rotation matrix. I get the concept of a rotation matrix, but when I look on wikipedia, the Wolfram Mathworld site, etc. I keep seeing the following defined as a 90° counter-clockwise rotation matrix:
|0 -1|
|1 0|
开发者_如何学编程but when I actually do the math, I seem to get the point(s) rotated clockwise around the origin:
|1 2| |0 -1| |2 -1|
|3 4| x |1 0| = |4 -3|
Graphing the points (1,2) and (3,4), they're both in quadrant 1 (+,+). Graphing the resulting points, (2,-1) and (4,-3), they're both in quadrang 4 (+,-). The rotation works, but it seems clockwise, not counter-clockwise. What am I missing?
Note A friend suggested that it's the coordinate system that's being rotated, but the wolfram site (linked above) seems to explicitly exclude that from being the cause of my misunderstanding (see (1) and (3) on the wolfram site).
Any help greatly appreciated.
x' = | 0 -1 | * | x |
y' | 1 0 | | y |
So what you want is
x' = | 0 -1 | * | 1 |
y' | 1 0 | | 2 | = (-2, 1)
x' = | 0 -1 | * | 3 |
y' | 1 0 | | 4 | = (-4, 3)
If you plot that on a graph and draw a line between the two original points, and the two new points, and then draw a dotted line from the origin to the first point of each line, and then draw a 90 degree angle marker between the two dotted lines you will see that the 90 degree angle has rotated counter clockwise from the origin.
Ultra simple answer. Stand up. Turn 90 degrees. You turned one way. But to you it looked like the world turned the other. This is how it always works. If you do X to the coordinate system, it looks like you did the inverse of X to the representation of things in that coordinate system.
(I know you didn't actually stand up and turn, so I have to tell you that actually standing up and turning is a great way to make sure that this sticks in your memory. You combine the intellectual, kinesthetic and visual systems together. Do it. And any time you get confused again by it, do it again to help yourself get it straight.)
精彩评论