Coordinate system transformations

Started by
2 comments, last by Smorg123 20 years, 9 months ago
Hmm, I''m having trouble transforming points from the regular coordinate system to an arbitary one. It''s the rotations that are the problem, I''ll try and explain by an 2D example. Regular coordinate system: Vectors: x(1 0) y(0 1) Diagram: y | |___ x New coordinate system (90 degree rotation): x(0 -1) y(1 0) ___ y | | x Let''s say a point in the original system is (2, 1), the point transformed to the new system should be at (1, -2) Looking at my maths books I figure you would just do the matrix multiplication: (0 -1)(2) (1 0)(1) = (-2, 1) ...obviously the wrong answer Where am I going wrong??
Advertisement
You are doing the matrix multiplication wrong.
|0 -1||2| = |-1||1  0||1|   | 2| 

The point at (1, 0) becomes ( 0, 1)
The point at (0, 1) becomes ( -1, 0 )
so (2, 1) = 2 (1, 0) + (0, 1) becomes 2(0, 1) + (-1, 0) = (-1, 2) not (1, -2)

Besides, this is perfectly equivalent to the matrix multiplication...

ToohrVyk

Making it more clear :

|1|         |0|     |0|         |-1||0| becomes |1] and |1| becomes | 0|To get the matrix, one simply sticks toegether the images of the base :|0 -1||1  0|To multiply a vector by this matrix is to decompose the vector into its coordinates in the base, then calculate it's image along each axis, and finally sum it up toegether... so|0 -1|   |2|       |0|       |-1|   |-1||1  0| * |1| = 2 * |1| + 1 * | 0| = | 2|  


ToohrVyk

Always be wary of typos. Even one is enough to turn your pubic hair public.



[edited by - ToohrVyk on July 3, 2003 8:19:18 AM]

[edited by - ToohrVyk on July 3, 2003 8:19:48 AM]

This topic is closed to new replies.

Advertisement