Transformation matrices
Alexander (Sasha) Pastukhov
2022-02-17
Source:vignettes/transformation_matrices.Rmd
transformation_matrices.Rmd
For most transformation, we assume that we can compute only the translation coefficients (\(a_i\)). The only exception are Euclidean transformation around a single axis of rotation that allow to compute a single scaling and a single rotation coefficient. In all other cases, values of computed coefficients would depend on the assumed order of individual transformation, making them no more than a potentially misleading guesses.
Bidimensional regression
Translation
Number of parameters: 2
- translation: \(a_1\), \(a_2\)
\[ \begin{bmatrix} 1 & 0 & a_1 \\ 0 & 1 & a_2 \\ 0 & 0 & 1 \end{bmatrix} \]
Euclidean
Number of parameters: 4
- translation: \(a_1\), \(a_2\)
- scaling: \(\phi\)
- rotation: \(\theta\)
\[ \begin{bmatrix} b_1 & b_2 & a_1 \\ -b_2 & b_1 & a_2 \\ 0 & 0 & 1 \end{bmatrix} \]
The Euclidean transformation is a special case, where we can compute rotation (\(\theta\)) and the single scaling (\(\phi\)) coefficients, as follows: \[ \phi = \sqrt{b_1^2 + b_2^2}\\ \theta = tan^{-1}(\frac{b_2}{b_1}) \]
Tridimensional regression
Translation
Number of parameters: 3
- translation: \(a_1\), \(a_2\), \(a_3\)
\[ \begin{bmatrix} 1 & 0 & 0 & a_1 \\ 0 & 1 & 0 & a_2 \\ 0 & 0 & 1 & a_3 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]
Euclidean
Number of parameters: 5
- translation: \(a_1\), \(a_2\), \(a_3\)
- scaling: \(\phi\)
- rotation: \(\theta\)
For all Euclidean rotations, we opted to use coefficient \(b_3\) to code scaling (\(\phi\)), whereas \(b_2 = sin(\theta)\) and \(b_1=\phi~ cos(\theta)\). The coefficients are computed as follows: \[ \phi = \sqrt{b_1^2 + b_2^2}\\ \theta = tan^{-1}(\frac{b_2}{b_1}) \]
Euclidean, rotation about x axis
Note that during fitting \(\phi\) is computed from \(b_1\) and \(b_2\) on the fly. \[ \begin{bmatrix} \phi & 0 & 0 & a_1 \\ 0 & b_1 &-b_2 & a_2 \\ 0 & b_2 & b_1 & a_3 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]