How to transform a list of coordinates, making the first coordinate the origin?

161 Views Asked by At

I'm not very knowledgeable of transformations, and kind of need to transform some coordinates for a project I decided to work on this summer from uni, so here it goes: Let's say I have a list of 3D Cartesian Coordinates (5, 6, 1), (4, 5, 2), (4, 5, 7)...... and so on. Is there a transformation technique that will take the first point mentioned, and center it at the origin, and then adjust all other points in the set accordingly?

1

There are 1 best solutions below

0
On

Sure. For each item $(x, y, z)$ in your list (e.g., $(4, 5, 2), so $x = 5, y = 5, z = 2), take $(x, y, z) $ to $(x-5, y-6, z-1)$. (In the example, $(4, 5, 2)$ gets converted to $(-1, -1, 1)$.)

If you want a matrix transform, using homogeneous coordinates, so that $(4, 5, 2)$ is represented by $$ \pmatrix{4\\5\\2\\1} $$ then the matrix form is $$ M = \pmatrix{1 & 0 & 0 & -5 \\ 0 & 1 & 0 & -6 \\ 0 & 0 & 1 & -1 \\ 0 & 0 & 0 & 1}. $$