Data Structures | |
class | matrix3d |
3-Dimensional Matrix Class More... | |
class | matrix4d |
4-Dimensional Matrix Class More... | |
class | plane |
3-dimensional plane class declaration More... | |
class | quaternion |
4-dimensional normed division algebra over the Real Numbers More... | |
class | vector2d |
Ordered 2-tuple implementing Euclidean vector operations. More... | |
class | vector3d |
Ordered 3-tuple implementing Euclidean vector operations. More... | |
class | vector4d |
Ordered 4-tuple implementing Euclidean vector operations. More... | |
class | vector4h |
Augmented 3-dimensional vector / homogeneous vector / projected point. More... | |
Functions | |
scalar | det (scalar a, scalar b, scalar c, scalar d) |
Calculate the determinant of a 2x2 matrix. More... | |
scalar | det (scalar a1, scalar b1, scalar c1, scalar a2, scalar b2, scalar c2, scalar a3, scalar b3, scalar c3) |
Calculate the determinant of a 3x3 matrix. More... | |
const quaternion | operator* (const quaternion &q, const vector3d &v) |
Multiply a vector by a quaternion. More... | |
const quaternion | operator* (const vector3d &v, const quaternion &q) |
Multiply a quaternion by a vector. More... | |
const matrix3d | quaternion2DCM (const quaternion &q) |
Quaternion to direction cosine matrix (DCM) conversion. More... | |
const vector3d | quaternion2euler (const quaternion &q) |
Quaternion to Euler angle conversion. More... | |
const vector3d | rotate (const quaternion &q, const vector3d &v) |
Rotate a vector by a unit quaternion. More... | |
Calculate the determinant of a 2x2 matrix.
This routine calculates the determinant of a 2x2 matrix consisting of entries a
, b
, c
, and d
arranged in the matrix as follows:
\[ \left| \begin{array}{cc} a & b \\ c & d \end{array} \right| \]
scalar | The real-valued determinant of the input matrix. |
Referenced by math::matrix3d::adjoint(), math::matrix4d::adjoint(), math::vector3d::cross(), math::vector4h::cross(), det(), and math::matrix4d::determinant().
|
inline |
Calculate the determinant of a 3x3 matrix.
This routine calculates the determinant of a 3x3 matrix consisting of entries arranged in the matrix as follows:
\[ \left| \begin{array}{ccc} a_1 & b_1 & c_1\\ a_2 & b_2 & c_2\\ a_3 & b_3 & c_3 \end{array} \right| \]
scalar | The real-valued determinant of the input matrix. |
References det().
|
inline |
Multiply a vector by a quaternion.
This operator multiplies a math::vector3d object on the right-side of the operator by math::quaternion object on the left-side of the operator.
q | A math::quaternion operand. |
v | A math::vector3d operand. |
math::quaternion | The product of the input operands. |
|
inline |
Multiply a quaternion by a vector.
This operator multiplies a math::quaternion object on the right-side of the operator by math::vector3d object on the left-side of the operator.
v | A math::vector3d operand. |
q | A math::quaternion operand. |
math::quaternion | The product of the input operands. |
|
inline |
Quaternion to direction cosine matrix (DCM) conversion.
This routine converts a specified quaternion \( \mathbf{q} \) to a 3x3 direction cosine matrix (DCM
).
If point \( \mathbf{P} \) is transformed to \( \mathbf{P^{\prime}} \) as a result of a rotation described by quaternion \( \mathbf{q} \) according to the following quaternion algebra:
\( P^{\prime} = qPq^{*} \)
where
\( q = q_0 + \hat{i}q_1 + \hat{j}q_2 + \hat{k}q_3 \)
\( q^{*} = q_0 - \hat{i}q_1 - \hat{j}q_2 - \hat{k}q_3 \)
\( P = 0 + \hat{i}x + \hat{j}y + \hat{k}z \)
q | A rotation math::quaternion argument. |
math::matrix3d | A 3x3 direction cosine matrix. |
|
inline |
Quaternion to Euler angle conversion.
This routine converts a specified quaternion \( \mathbf{q} \) to a 3x1 vector storing bank (rotation about x-axis), attitude (rotation about y-axis), and heading (rotation about z-axis) values in the x, y, and z vector elements, respectively.
q | A rotation math::quaternion argument. |
math::vector3d | A 3x1 vector storing roll, pitch, and yaw. |
|
inline |
Rotate a vector by a unit quaternion.
Given unit quaternion \( q = (s, \vec{v}) \) and its conjugate \( q^{*} = (s, -\vec{v}), \) to rotate arbitrary vector \( \vec{r} \) by an angle \( \alpha \) about a vector \( \hat{N} \):
\[ q = (\cos{(\frac{\alpha}{2})}, \sin{(\frac{\alpha}{2})}\hat{N}) \]
\[ qpq^{*} = (0, (s^{2} - \vec{v} \cdot \vec{v})\vec{r} + 2\vec{v}(\vec{v} \cdot \vec{r}) + 2s\vec{v} \times \vec{r}) = (0, \vec{r}^{\prime}) \]
q | A math::quaternion operand. |
v | A math::vector3d operand. |
math::vector3d | The resulting rotated vector object. |