0
\$\begingroup\$

I have two coordinate systems, like so

Picture of coordinate systems

How can I transform a point on the one of the coordinate system to other ?

Pxyz = M . Px'y'z' what is M ?

\$\endgroup\$
3
  • \$\begingroup\$ @kshahar hi, do you know the answer ? \$\endgroup\$
    – gveaf
    Commented Nov 13, 2012 at 10:53
  • \$\begingroup\$ M is the transformation matrix.. kwon3d.com/theory/transform/transform.html \$\endgroup\$
    – teodron
    Commented Nov 13, 2012 at 11:04
  • \$\begingroup\$ @teodron can you write the answer \$\endgroup\$
    – gveaf
    Commented Nov 13, 2012 at 11:07

1 Answer 1

6
\$\begingroup\$

From the image it looks like both your coordinate systems are cartesian coordinates, where the only difference between the two is that one has a different origin from the other.

If this is the case then to translate from xyz coordinates to x'y'z' coordinates all you need is a translation, i.e.

x' = x + dx
y' = y + dy
z' = z + dz

Where [dx, dy, dz] is the difference between the origins of the two coordinate systems.

Matrix multiplications always have the origin as a fixed point and so you can't perform translations using a 3x3 matrix, however as a sort of workaround you can express your 3-dimensional coordinates as the 4-dimensional vector [x, y, z, 1] and use a 4x4 transformation matrix that includes a translation, e.g.

|1 0 0 dx | |x|   |x + dx|
|0 1 0 dy | |y|   |y + dy|
|0 0 1 dz | |z| = |z + dz|
|0 0 0 1  | |1|   |   1  |

You can then ignore the 4th component to get the translated 3D coordinates. See more on Wikipedia here

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .