0
$\begingroup$

I know the coordinates of 4 points, P1, P2, P3 and P4, in two Cartesian 3D coordinate systems, C1 and C2. For the sake of an example, let's say we have:

Point, C1 coords, C2 coords:

P1, (x1, y1, z1), (u1, v1, w1)
P2, (x2, y2, z2), (u2, v2, w2)
P3, (x3, y3, z3), (u3, v3, w3)
P4, (x4, y4, z4), (u4, v4, w4)

Given these points, how can I devise a way to convert any point from C2 into C1? I am guessing that I only need 3 points (assuming they can define a plane in each coordinate system), and that I will need a translation/rotation/scale matrix? I read several answers to coordinate system conversion questions, but none of them start out with simple points, and I still don't know where to begin.

  • 0
    You can figure out if your points(vectors) correspond to a basis in the respective frames. If that is the case the transformation matrix presents itself quite naturally. Does that help?2017-02-09
  • 0
    I am not sure what you mean by "a basis in the respective frames"? Do you mean if I can get the 3 basis vectors for C1 and C2 from the points? If so, let's assume that I can.2017-02-09

2 Answers 2

0

We’re looking for some affine transformation that connects the two Cartesian coordinate systems. That is, we want each coordinate in one of them to be an affine function of the coordinates in the other. Using homogeneous coordinates, this condition can be represented in matrix form as $$\mathbf M\mathbf x=\begin{bmatrix}m_{11}&m_{12}&m_{13}&m_{14}\\m_{21}&m_{22}&m_{23}&m_{24}\\m_{31}&m_{32}&m_{33}&m_{34}\\0&0&0&1\end{bmatrix}\begin{bmatrix}x\\y\\z\\1\end{bmatrix}=\begin{bmatrix}u\\v\\w\\1\end{bmatrix}.$$ We have four pairs of corresponding coordinates of points, so finding the coefficients $m_{ij}$ of the transformation matrix amounts to solving a system of linear equations. We can do this in bulk by packaging these coordinate vectors up into matrices so that we have $$\mathbf M\begin{bmatrix}x_1&x_2&x_3&x_4\\y_1&y_2&y_3&y_4\\z_1&z_2&z_3&z_4\\1&1&1&1\end{bmatrix}=\begin{bmatrix}u_1&u_2&u_3&u_4\\v_1&v_2&v_3&v_4\\w_1&w_2&w_3&w_4\\1&1&1&1\end{bmatrix}$$ or $\mathbf M\mathbf X=\mathbf U$ for short. If the points aren’t coplanar (i.e., the homogeneous vectors are linearly independent), then $\mathbf X$ is nonsingular and we can solve this forthwith: $\mathbf M=\mathbf U\mathbf X^{-1}$. If not, then you will have one or two axes unaccounted for. You can still find a transformation from one coordinate plane (or line) to the other, and can then choose an arbitrary mapping for the remaining degrees of freedom. Since you want Cartesian coordinate systems, choosing axes that are perpendicular to the planes seems like the way to go.

  • 0
    Thank you so much, this is I believe exactly what I was looking for, but much simpler than what I thought I needed to do!2017-02-10
0

To add to the comment:

As a simple example, say in $C2$ you have the vectors $[1,0]^{\top}$ and $[0,1]^{\top}$(a basis for $\mathbb{R}^2$) while in $C1$ they are represented as $[\cos(\theta), \sin(\theta)]$ and $[-\sin(\theta), \cos(\theta)]$. Then there exists a matrix $R$ such that: \begin{equation} \begin{bmatrix} \cos(\theta) & -\sin(\theta)\\ \sin(\theta) & \cos(\theta) \end{bmatrix} = R \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \end{equation} In that case $R$ is not so hard. I hope this clarifies it a bit.

  • 0
    Thank you for the suggestion, but I still don't understand how to apply this to solve my question. If I understand you correctly, I need to do the following: 1. Take 3 out of the 4 points in C1, and derive the basis vectors for C1. 2. Do the same for C2. Then from there, I can get the angle theta somehow, and I will probably need another angle because C1 and C2 are 3D. And I am guessing at the end I need to solve for R. Is this about right? Also, how does the solution change for 3D space?2017-02-09