5.3.2.21. Struct tmat3x3_t

5.3.2.21.1. Struct Documentation

struct tmat3x3_t

Store the transformation in a matrix. In FMDT we only consider “rigid body” transformations (= translation \(\vec{t}\) + rotation of \(\theta\) angle). Here is the corresponding \(3 \times 3\) transformation matrix:

\[\begin{split} T_{3 \times3 } = \begin{bmatrix} \cos(\theta) & -\sin(\theta) & t_x \\ \sin(\theta) & \cos(\theta) & t_y \\ 0 & 0 & 1 \\ \end{bmatrix}. \end{split}\]

Some comprehensive explanations about 2D transformation matrices & homogeneous coordinates are given here:

The order of the fields in the structure is important because the structure can easily be “cast” in a 2-dimensional \(3 \times 3\) matrix for transformation combinations (= \(3 \times 3\) matrix multiplication) & positions update (= \(3 \times 3\) transformation matrix multiplied by \(3 \times 1\) position vector).

Public Members

float cos_theta

\( \cos(\theta) \) ( \([0][0]\) element in the \(T\) matrix).

float neg_sin_theta

\( -\sin(\theta) \) ( \([0][1]\) element in the \(T\) matrix).

float tx

Abscissa component \( t_x \) of the translation vector \(\vec{t}\) ( \([0][2]\) element in the \(T\) matrix).

float sin_theta

\( \sin(\theta) \) ( \([1][0]\) element in the \(T\) matrix).

float cos_theta2

\( \cos(\theta) \), same value as previous cos_theta field ( \([1][1]\) element in the \(T\) matrix).

float ty

Ordinate component \( t_y \) of the translation vector \(\vec{t}\) ( \([1][2]\) element in the \(T\) matrix).

float zero1

As only rigid transformations are considered in FMDT, this field should always be null ( \([2][0]\) element in the \(T\) matrix).

float zero2

As only rigid transformations are considered in FMDT, this field should always be null ( \([2][1]\) element in the \(T\) matrix).

float one

Always set to one in transformation matrices ( \([2][0]\) element in the \(T\) matrix).