Helios++
Helios software for LiDAR simulations
|
Class providing building methods for rigid motions in \(\mathbb{R}^{3}\). More...
#include <RigidMotionR3Factory.h>
Public Member Functions | |
RigidMotionR3Factory ()=default | |
RigidMotionR3Factory default constructor. | |
RigidMotion | makeIdentity () const override |
Implementation of identity rigid motion in \(\mathbb{R}^{3}\). More... | |
RigidMotion | makeTranslation (colvec const shift) const override |
Implementation of translation rigid motion in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeReflection (colvec const ortho) const |
Implementation of reflection rigid motion in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeReflectionFast (colvec const orthonormal) const |
Fast implementation of a reflection rigid motion in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeReflectionFast (colvec const u, colvec const alpha, colvec const beta) const |
Fast implementation of a reflection rigid motion in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeReflectionX () const |
Implementation of a reflection rigid motion over a plane with \(x\)-axis as orthonormal. More... | |
virtual RigidMotion | makeReflectionY () const |
Implementation of a reflection rigid motion over a plane with \(y\)-axis as orthonormal. More... | |
virtual RigidMotion | makeReflectionZ () const |
Implementation of a reflection rigid motion over a plane with \(z\)-axis as orthonormal. More... | |
virtual RigidMotion | makeGlideReflection (colvec const ortho, colvec const shift) const |
Implementation of a glide reflection or glide plane rigid motion in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeGlideReflectionFast (colvec const orthonormal, colvec const shift) const |
Fast implementation of a reflection rigid motion in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeRotation (colvec const axis, double const theta) const |
Implementation of rotation rigid motion over an arbitrary axis in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeRotationFast (colvec const axis, double const theta) const |
Fast implementation of a rotation rigid motion in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeRotationX (double const theta) const |
Implementation of a rotation rigid motion over the \(x\)-axis. More... | |
virtual RigidMotion | makeRotationY (double const theta) const |
Implementation of a rotation rigid motion over the \(y\)-axis. More... | |
virtual RigidMotion | makeRotationZ (double const theta) const |
Implementation of a rotation rigid motion over the \(z\)-axis. More... | |
virtual RigidMotion | makeHelical (colvec const axis, double const theta, double const glide) const |
Implementation of an helical rigid motion over an arbitrary axis in \(\mathbb{R}^3\). More... | |
virtual RigidMotion | makeHelicalFast (colvec const axis, double const theta, double const glide) const |
Fast implementation of a helical rigid motion in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeHelicalX (double const theta, double const glide) const |
Implementation of a helical rigid motion over the \(x\)-axis. More... | |
virtual RigidMotion | makeHelicalY (double const theta, double const glide) const |
Implementation of a helical rigid motion over the \(y\)-axis. More... | |
virtual RigidMotion | makeHelicalZ (double const theta, double const glide) const |
Implementation of a helical rigid motion over the \(z\)-axis. More... | |
virtual RigidMotion | makeRotationalSymmetry (colvec const axis, double const theta) const |
Implementation of rotational symmetry rigid motion over an arbitrary rotation axis in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeRotationalSymmetryFast (colvec const axis, double const theta) const |
Fast implementation of a rotational symmetry rigid motion in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeRotationalSymmetry (colvec const axis, double const theta, colvec const center) const |
Implementation of rotational symmetry rigid motion over an arbitrary rotation axis in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeRotationalSymmetryFast (colvec const axis, double const theta, colvec const center) const |
Fast implementation of a rotational symmetry rigid motion in \(\mathbb{R}^{3}\). More... | |
virtual RigidMotion | makeRotationalSymmetryX (double const theta) const |
Implementation of a rotational symmetry over the \(x\)-axis. More... | |
virtual RigidMotion | makeRotationalSymmetryY (double const theta) const |
Implementation of a rotational symmetry over the \(y\)-axis. More... | |
virtual RigidMotion | makeRotationalSymmetryZ (double const theta) const |
Implementation of a rotational symmetry over the \(z\)-axis. More... | |
![]() | |
RigidMotionFactory ()=default | |
RigidMotionFactory default constructor. | |
virtual RigidMotion | makeTranslation (arma::colvec const shift) const =0 |
Build the translation rigid motion. More... | |
Static Protected Attributes | |
static double const | eps = 0.000000001 |
Decimal precision tolerance. | |
static arma::mat const | canonicalReflection |
The Jordan normal form of a reflection in \(\mathbb{R}^{3}\). More... | |
Private Member Functions | |
template<typename Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a \(\mathbb{R}^{3}\) rigid motion factory to a stream of bytes. More... | |
Friends | |
class | boost::serialization::access |
Class providing building methods for rigid motions in \(\mathbb{R}^{3}\).
|
virtual |
Implementation of a glide reflection or glide plane rigid motion in \(\mathbb{R}^{3}\).
Let \(\vec{u}\) be the orthogonal vector defining the reflection plane so a reflection can be performed as documented in the makeReflection(colvec const) method. If \(\vec{v}\) is a vector contained in the reflection plane, which means \(\left\langle\vec{u},\vec{v}\right\rangle = 0\) must be satisfied. Then the affine application for the glide reflection can be expressed as \(Y = \vec{v} + BJB^{-1}X\) where \(B\) is the basis matrix as explained in makeReflection(colvec const).
ortho | Orthogonal vector defining the reflection plane |
shift | The translation vector. It must be orthogonal with respect to the plane orthogonal vector, otherwise exception will be thrown. |
|
virtual |
Fast implementation of a reflection rigid motion in \(\mathbb{R}^{3}\).
For this function to work properly it is recommended that input orthonormal vector is truly normalized. Otherwise, output might lead to unexpected behaviors.
Also, restrictions with respect to shift vector must be satisfied as for the makeGlideReflection(colvec const, colvec const) method.
orthonormal | Orthonormal vector defining the reflection plane |
shift | Translation/glide vector. Must be orthogonal with respect to plane orthonormal vector |
|
virtual |
Implementation of an helical rigid motion over an arbitrary axis in \(\mathbb{R}^3\).
First a rotation is performed as in the makeRotation(colvec const, double const) method. Then a transposition parallel to the rotation axis is applied. Thus, the affine application can be defines as \(Y = C + AX\) where \(C\) is the transposition column-vector and \(A\) is the rotation matrix described in makeRotation(colvec const, double const).
axis | Rotation axis |
theta | Rotation angle |
glide | How many glide apply in the direction of rotation axis afther the rotation |
|
virtual |
Fast implementation of a helical rigid motion in \(\mathbb{R}^{3}\).
For this function to work properly, it is recommended that input rotation axis is normalized. Otherwise, output might lead to unexpected behaviors.
axis | Normalized rotation axis |
theta | Rotation angle |
glide | How many glide apply in the direction of rotation axis after the rotation |
|
virtual |
Implementation of a helical rigid motion over the \(x\)-axis.
theta | The rotation angle |
glide | Glide amount to be applied in rotation axis direction |
|
virtual |
Implementation of a helical rigid motion over the \(y\)-axis.
theta | The rotation angle |
glide | Glide amount to be applied in rotation axis direction |
|
virtual |
Implementation of a helical rigid motion over the \(z\)-axis.
theta | The rotation angle |
glide | Glide amount to be applied in rotation axis direction |
|
overridevirtual |
Implementation of identity rigid motion in \(\mathbb{R}^{3}\).
Implements rigidmotion::RigidMotionFactory.
|
virtual |
Implementation of reflection rigid motion in \(\mathbb{R}^{3}\).
Let \(\vec{u}\) be the orthogonal vector defining the reflection plane. Now let \(\vec{\alpha}\) be an orthogonal vector with respect to \(\vec{u}\) so \(\left\langle\vec{u}, \vec{\alpha}\right\rangle=0\). Then, another vector \(\vec{\beta}\) orthogonal to both \(\vec{u}\) and \(\vec{\alpha}\) can be obtained through cross product as \(\vec{\beta} = \vec{u} \times \vec{\alpha}\).
Once vectors satisfying \( \left\langle\vec{u}, \vec{\alpha}\right\rangle = \left\langle\vec{u}, \vec{\beta}\right\rangle = \left\langle\vec{\alpha}, \vec{\beta}\right\rangle = 0 \) are known, the basis matrix \(B\) can be defined as:
\[ B = \left[\begin{array}{lll} u_x & \alpha_x & \beta_x \\ u_y & \alpha_y & \beta_y \\ u_z & \alpha_z & \beta_z \end{array}\right] \]
Notice the Jordan normal form \(J\) of a reflection in \(\mathbb{R}^{3}\) corresponds to a plane having \(e_1=(1, 0, 0)\) as orthonormal vector. It is as shown below:
\[ J = \left[\begin{array}{lll} -1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right] \]
In consequence, the affine application for a reflection over an arbitrary plane can be expressed as \(Y = C + AX = \vec{0} + BJB^{-1}X\)
ortho | Orthogonal vector defining the reflection plane |
|
virtual |
Fast implementation of a reflection rigid motion in \(\mathbb{R}^{3}\).
For this function to work properly it is recommended that input vector is normalized. Otherwise, output might lead to unexpected behaviors.
This function is slower than makeReflectionFast(colvec const, colvec const, colvec const) but its input does not have as many constraints.
orthonormal | Orthonormal vector defining the reflection plane |
|
virtual |
Fast implementation of a reflection rigid motion in \(\mathbb{R}^{3}\).
For this function to work properly it is recommended that all input vectors are given as a set of orthonormal vectors. Otherwise, output might lead to unexpected behaviors.
This function is faster that makeReflectionFast(colvec const) but its input must satisfy more requirements.
u | Orthonormal vector defining the reflection plane |
alpha | First normal vector contained in the reflection plane |
beta | Second normal vector contained in the reflection plane |
|
virtual |
Implementation of a reflection rigid motion over a plane with \(x\)-axis as orthonormal.
|
virtual |
Implementation of a reflection rigid motion over a plane with \(y\)-axis as orthonormal.
|
virtual |
Implementation of a reflection rigid motion over a plane with \(z\)-axis as orthonormal.
|
virtual |
Implementation of rotation rigid motion over an arbitrary axis in \(\mathbb{R}^{3}\).
Let \(\vec{u}\) be an arbitrary director vector defining the rotation axis. Now let \(\hat{u} = \frac{\vec{u}}{\left\Vert\vec{u}\right\Vert}\) be its normalized form. Thus, the affine application for the rotation can be defined as \(Y = \vec{0} + AX\) where \(A\) is as follows:
\[ A = \left[\begin{array}{lll} \cos(\theta) + \hat{u}_x^2(1-\cos(\theta)) & \hat{u}_x\hat{u}_y (1-\cos(\theta)) - \hat{u}_z\sin(\theta) & \hat{u}_x\hat{u}_z (1-\cos(\theta)) + \hat{u}_y\sin(\theta) \\ \hat{u}_y\hat{u}_x(1-\cos(\theta)) + \hat{u}_z\sin(\theta) & \cos(\theta) + \hat{u}_y^2(1-\cos(\theta)) & \hat{u}_y\hat{u_z}(1-\cos(\theta)) - \hat{u}_x\sin(\theta) \\ \hat{u}_z\hat{u}_x(1-\cos(\theta)) - \hat{u}_y\sin(\theta) & \hat{u}_z\hat{u}_y(1-\cos(\theta)) + \hat{u}_x\sin(\theta) & \cos(\theta) + \hat{u}_z^2(1-\cos(\theta)) \end{array}\right] \]
axis | The rotation axis itself |
theta | The rotation angle |
|
virtual |
Implementation of rotational symmetry rigid motion over an arbitrary rotation axis in \(\mathbb{R}^{3}\).
Let \(\vec{u}\) be an arbitrary director vector defining the rotation axis so the symmetry/reflection plane is \(\pi = \left\{(x, y, z) : \lambda\vec{\alpha} + \mu\vec{\beta}\right\}\) where \(\left\langle{\vec{u}, \vec{\alpha}}\right\rangle = \left\langle{\vec{u}, \vec{\beta}}\right\rangle = \left\langle{\vec{\alpha}, \vec{\beta}}\right\rangle = 0\). It is \(\pi \perp \vec{u}\). Thus, the rotational symmetry can be understood as a rotation around \(\vec{u}\) followed by a reflection over \(\pi\) as the symmetry plane which is orthogonal to the rotation axis.
In consequence, the affine application can be defined as \(Y = \vec{0} + AX\) where \(A = BJB^{-1}R\). In this case, \(R\) would be the arbitrary rotation matrix in \(\mathbb{R}^{3}\) as defined for the makeRotation(colvec const, double const) method while \(BJB^{-1}\) is the arbitrary reflection matrix in \(\mathbb{R}^{3}\) as defined for the makeReflection(colvec const) method.
axis | Rotation axis which is also the orthogonal vector for the symmetry/reflection plane |
theta | Rotation angle |
|
virtual |
Implementation of rotational symmetry rigid motion over an arbitrary rotation axis in \(\mathbb{R}^{3}\).
The rotation center implies redefining \(C\) for the affine application as follows, where \(Q\) is the rotation center:
\[ Y = C + AX = (I-A)Q + AX \]
axis | Rotation axis which is also the orthogonal vector for the symmetry/reflection plane |
theta | Rotation angle |
center | The center of rotational symmetry where the rotation axis and the reflection plane intersect |
|
virtual |
Fast implementation of a rotational symmetry rigid motion in \(\mathbb{R}^{3}\).
For this function to work properly, it is recommended that input rotation axis is normalized. Otherwise, output might lead to unexpected behaviors.
axis | Normalized rotation axis which is also the orthonormal vector for the symmetry/reflection plane |
theta | Rotation angle |
|
virtual |
Fast implementation of a rotational symmetry rigid motion in \(\mathbb{R}^{3}\).
For this function to work properly, it is recommended that input rotation axis is normalized. Otherwise, output might lead to unexpected behaviors.
axis | Rotation axis which is also the orthogonal vector for the symmetry/reflection plane |
theta | Rotation angle |
center | The center of rotational symmetry where the rotation axis and the reflection plane intersect |
|
virtual |
Implementation of a rotational symmetry over the \(x\)-axis.
theta | Rotation angle |
|
virtual |
Implementation of a rotational symmetry over the \(y\)-axis.
theta | Rotation angle |
|
virtual |
Implementation of a rotational symmetry over the \(z\)-axis.
theta | Rotation angle |
|
virtual |
Fast implementation of a rotation rigid motion in \(\mathbb{R}^{3}\).
For this function to work properly, it is recommended that input rotation axis is normalized. Otherwise, output might lead to unexpected behaviors.
axis | Normalized rotation axis |
theta | Rotation angle |
|
virtual |
Implementation of a rotation rigid motion over the \(x\)-axis.
theta | The rotation angle |
|
virtual |
Implementation of a rotation rigid motion over the \(y\)-axis.
theta | The rotation angle |
|
virtual |
Implementation of a rotation rigid motion over the \(z\)-axis.
theta | The rotation angle |
|
override |
Implementation of translation rigid motion in \(\mathbb{R}^{3}\).
|
inlineprivate |
Serialize a \(\mathbb{R}^{3}\) rigid motion factory to a stream of bytes.
Archive | Type of rendering |
ar | Specific rendering for the stream of bytes |
version | Version number for the \(\mathbb{R}^{3}\) rigid motion factory |
|
staticprotected |
The Jordan normal form of a reflection in \(\mathbb{R}^{3}\).
\[ J = \left[\begin{array}{lll} -1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right] \]