Coordinate Transformation given one set of points with coordinates in two coordinate systems I am trying to teach myself a bit of linear algebra and am stuck on coordinate transformations.  
I know the 3D Cartesian coordinates of three coplanar points in a standard coordinate system 
x1,y1, z1 
x2,y2, z2
x3,y3, z3 
All with respect to coordinate system 1.  Obviously defining a plane.  
I also know the cartesian coordinates of those same three points relative to another coordinate system.  In this case,  those points form one of the primary planes of that other coordinate system - so the Y value relative to that other coordinate system is 0. 
x'1, 0, z'1
x'2, 0, z'2
x'3, 0, z'3
Again the same three points - but now relative to a second coordinate system.  
What I want to be able to do is translate ANY point in the primary coordinate system to the second coordinate system - and visa versa.  
How do I determine the coordinate transformation from the relationship between the points? And then how do I apply that to any other point?  
to work with actual numbers:  
    in Primary        in secondary

x1=      475.80            x1'= 124.77
y1 =     395.84            y1'= 0.0
z1=      402.55            z1'= -135.79
x2 =     437.18            x2'= 167.75
y2=      417.19            y2'= 0.0
z2=      424.26            z2'= -111.87
x3=      422.19            x3'=198.38
y3=      402.88            y3'=0.0
z3=      452.87            z3'= -129.48
There is presumably translation, rotation and scaling 
(I solved these using a CAD program - just so I'd have numbers to work with.  There are likely rounding errors between these if that creates issues).  
I need to determine a generalized solution I can apply to any set of three points where I know the coordinates in two different coordinate systems. 
Please let me know if this is unclear.  
Thank you very much!  
 A: Let me introduce some notation. $\mathbf{r}_i$ is a vector in 1st coordinate system which gets transformed to $\mathbf{r}^\prime_i$ through a transformation matrix $\mathbf{A}$: $\mathbf{A}\mathbf{r}_i = \mathbf{r}^\prime_i$.
Let $r_{ij}$ be the $j$-th coordinate of $\mathbf{r}_i$. For example, $y_3 = r_{32}$ is the 2nd coordinate of the 3rd vector.
We have
$$
\mathbf{A}\mathbf{r}_i = \mathbf{r}^\prime_i \quad \text{for $i=1,2,3$}
$$
Let $\mathbf{R}=[\mathbf{r}_1\  \mathbf{r}_2\ \mathbf{r}_3]$ and $\mathbf{R}^\prime=[\mathbf{r}^\prime_1\  \mathbf{r}^\prime_2\ \mathbf{r}^\prime_3]$. Then, the above equation is the following matrix product equation
$$
\mathbf{A}\mathbf{R} = \mathbf{R}^\prime
$$
Take transpose on both sides
$$
\mathbf{R}^T\mathbf{A}^T = \mathbf{R}^{\prime T}
$$
or, letting $\mathbf{A}^T \equiv \mathbf{B}=[\mathbf{b}_1\ \mathbf{b}_2\ \mathbf{b}_3]$
$$
\mathbf{R}^T[\mathbf{b}_1\ \mathbf{b}_2\ \mathbf{b}_3] = \mathbf{R}^{\prime T}.
$$
The above equation gives a triad of system of equations, giving $\mathbf{b}_1$, $\mathbf{b}_2$ and $\mathbf{b}_3$ as solutions, thus giving coefficients of $\mathbf{A}$ (assuming non-singularity of $\mathbf{R}$).
