Extended Matrix in Three-Dimensional Space MbMatrix3D

The MbMatrix3D class is declared in the mb_matrix3d.h file.

In three-dimensional space, the MbMatrix3D matrix describes a transformation from one coordinate system to another. The matrix has the size four by four. Let a local affine coordinate system be constructed in the chosen coordinate system with the origin at the point r with coordinates r1, r2, r3 and with basis vectors a = [a1 a2 a3], b = [b1 b2 b3], c = [c1 c2 c3]. The vectors a, b, c must be linearly independent, but they may be non-orthogonal to each other and may have arbitrary length. The MbMatrix3D matrix of transformation of coordinates from the local system to the chosen coordinate system has the form:

\[ \mathbf{M} = \begin{bmatrix} a_{1} & a_{2} & a_{3} & 0 \\ b_{1} & b_{2} & b_{3} & 0 \\ c_{1} & c_{2} & c_{3} & 0 \\ r_{1} & r_{2} & r_{3} & 1 \\ \end{bmatrix}. \]

To denote extended matrices in three-dimensional space, we will use uppercase Latin letters in boldface, for example M. Note that each basis vector a, b, c and the origin point r of the local coordinate system corresponds to its own row in the matrix of transformation from the local system to the chosen coordinate system.

The MbMatrix3D matrix is an extended matrix and works with homogeneous radius vectors and homogeneous vectors MbHomogeneous3D in three-dimensional space.

When transforming a MbCartPoint3D radius vector by the MbMatrix3D matrix, a fourth coordinate equal to one must be added to the point. Let a point with coordinates x1, x2, x3 in the local coordinate system have coordinates p1, p2, p3 in the chosen coordinate system. Then, by means of the extended MbMatrix3D matrix, the coordinates are related by

\[ \begin{bmatrix} p_{1} & p_{2} & p_{3} & 1 \end{bmatrix} = \begin{bmatrix} x_{1} & x_{2} & x_{3} & 1 \end{bmatrix} \cdot \begin{bmatrix} a_{1} & a_{2} & a_{3} & 0 \\ b_{1} & b_{2} & b_{3} & 0 \\ c_{1} & c_{2} & c_{3} & 0 \\ r_{1} & r_{2} & r_{3} & 1 \\ \end{bmatrix}. \]

Note that a three-dimensional radius vector is multiplied by the extended MbMatrix3D matrix on the right.

When transforming an MbVector3D vector by the MbMatrix3D matrix, a fourth component equal to zero must be added to the vector. Let a vector with components y1, y2, y3 in the local coordinate system have components v1, v2, v3 in the chosen coordinate system. Then, by means of the extended MbMatrix3D matrix, the components are related by

\[ \begin{bmatrix} v_{1} & v_{2} & v_{3} & 0 \end{bmatrix} = \begin{bmatrix} y_{1} & y_{2} & y_{3} & 0 \end{bmatrix} \cdot \begin{bmatrix} a_{1} & a_{2} & a_{3} & 0 \\ b_{1} & b_{2} & b_{3} & 0 \\ c_{1} & c_{2} & c_{3} & 0 \\ r_{1} & r_{2} & r_{3} & 1 \\ \end{bmatrix}. \]

Note that a three-dimensional vector is multiplied by the extended MbMatrix3D matrix on the right.