Helios++
Helios software for LiDAR simulations
rigidmotion::RigidMotionR3Factory Class Reference

Class providing building methods for rigid motions in \(\mathbb{R}^{3}\). More...

#include <RigidMotionR3Factory.h>

Inheritance diagram for rigidmotion::RigidMotionR3Factory:
Collaboration diagram for rigidmotion::RigidMotionR3Factory:

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...
 
- Public Member Functions inherited from rigidmotion::RigidMotionFactory
 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
 

Detailed Description

Class providing building methods for rigid motions in \(\mathbb{R}^{3}\).

Author
Alberto M. Esmoris Pena
Version
1.0
See also
rigidmotion::RigidMotionFactory

Member Function Documentation

◆ makeGlideReflection()

RigidMotion RigidMotionR3Factory::makeGlideReflection ( colvec const  ortho,
colvec const  shift 
) const
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).

Parameters
orthoOrthogonal vector defining the reflection plane
shiftThe translation vector. It must be orthogonal with respect to the plane orthogonal vector, otherwise exception will be thrown.
Returns
Glide reflection (glide plane) rigid motion in \(\mathbb{R}^{3}\)
See also
rigidmotion::RigidMotionR3Factory::makeReflection(colvec const)

◆ makeGlideReflectionFast()

RigidMotion RigidMotionR3Factory::makeGlideReflectionFast ( colvec const  orthonormal,
colvec const  shift 
) const
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.

Parameters
orthonormalOrthonormal vector defining the reflection plane
shiftTranslation/glide vector. Must be orthogonal with respect to plane orthonormal vector
See also
makeGlideReflection(colvec const, colvec const)

◆ makeHelical()

RigidMotion RigidMotionR3Factory::makeHelical ( colvec const  axis,
double const  theta,
double const  glide 
) const
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).

Parameters
axisRotation axis
thetaRotation angle
glideHow many glide apply in the direction of rotation axis afther the rotation
Returns
Helical rigid motion in \(\mathbb{R}^{3}\)
See also
RigidMotionR3Factory::makeRotation(colvec const, double const)

◆ makeHelicalFast()

RigidMotion RigidMotionR3Factory::makeHelicalFast ( colvec const  axis,
double const  theta,
double const  glide 
) const
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.

Parameters
axisNormalized rotation axis
thetaRotation angle
glideHow many glide apply in the direction of rotation axis after the rotation
See also
makeHelical(colvec const, double const, double const)

◆ makeHelicalX()

RigidMotion RigidMotionR3Factory::makeHelicalX ( double const  theta,
double const  glide 
) const
virtual

Implementation of a helical rigid motion over the \(x\)-axis.

Parameters
thetaThe rotation angle
glideGlide amount to be applied in rotation axis direction
Returns
Helical rigid motion over \(e_1\) vector ( \(x\)-axis) in \(\mathbb{R}^{3}\)

◆ makeHelicalY()

RigidMotion RigidMotionR3Factory::makeHelicalY ( double const  theta,
double const  glide 
) const
virtual

Implementation of a helical rigid motion over the \(y\)-axis.

Parameters
thetaThe rotation angle
glideGlide amount to be applied in rotation axis direction
Returns
Helical rigid motion over \(e_2\) vector ( \(y\)-axis) in \(\mathbb{R}^{3}\)

◆ makeHelicalZ()

RigidMotion RigidMotionR3Factory::makeHelicalZ ( double const  theta,
double const  glide 
) const
virtual

Implementation of a helical rigid motion over the \(z\)-axis.

Parameters
thetaThe rotation angle
glideGlide amount to be applied in rotation axis direction
Returns
Helical rigid motion over \(e_3\) vector ( \(z\)-axis) in \(\mathbb{R}^{3}\)

◆ makeIdentity()

RigidMotion RigidMotionR3Factory::makeIdentity ( ) const
overridevirtual

Implementation of identity rigid motion in \(\mathbb{R}^{3}\).

See also
rigidmotion::RigidMotionFactory::makeIdentity

Implements rigidmotion::RigidMotionFactory.

◆ makeReflection()

RigidMotion RigidMotionR3Factory::makeReflection ( colvec const  ortho) const
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\)

Parameters
orthoOrthogonal vector defining the reflection plane
Returns
Reflection rigid motion in \(\mathbb{R}^{3}\)
See also
rigidmotion::RigidMotionR3Factory::canonicalReflection

◆ makeReflectionFast() [1/2]

RigidMotion RigidMotionR3Factory::makeReflectionFast ( colvec const  orthonormal) const
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.

Parameters
orthonormalOrthonormal vector defining the reflection plane
See also
rigidmotion::RigidMotionR3Factory::makeReflection(colvec const)
makeReflectionFast(colvec const, colvec const, colvec const)

◆ makeReflectionFast() [2/2]

RigidMotion RigidMotionR3Factory::makeReflectionFast ( colvec const  u,
colvec const  alpha,
colvec const  beta 
) const
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.

Parameters
uOrthonormal vector defining the reflection plane
alphaFirst normal vector contained in the reflection plane
betaSecond normal vector contained in the reflection plane
See also
rigidmotion::RigidMotionR3Factory::makeReflection(colvec const)
makeReflectionFast(colvec const)

◆ makeReflectionX()

RigidMotion RigidMotionR3Factory::makeReflectionX ( ) const
virtual

Implementation of a reflection rigid motion over a plane with \(x\)-axis as orthonormal.

Returns
Reflection rigid motion over \(x=0\) plane in \(\mathbb{R}^{3}\)
See also
rigidmotion::RigidMotionR3Factory::makeReflection(colvec const)

◆ makeReflectionY()

RigidMotion RigidMotionR3Factory::makeReflectionY ( ) const
virtual

Implementation of a reflection rigid motion over a plane with \(y\)-axis as orthonormal.

Returns
Reflection rigid motion over \(y=0\) plane in \(\mathbb{R}^{3}\)
See also
rigidmotion::RigidMotionR3Factory::makeReflection(colvec const)

◆ makeReflectionZ()

RigidMotion RigidMotionR3Factory::makeReflectionZ ( ) const
virtual

Implementation of a reflection rigid motion over a plane with \(z\)-axis as orthonormal.

Returns
Reflection rigid motion over \(z=0\) plane in \(\mathbb{R}^{3}\)
See also
rigidmotion::RigidMotionR3Factory::makeReflection(colvec const)

◆ makeRotation()

RigidMotion RigidMotionR3Factory::makeRotation ( colvec const  axis,
double const  theta 
) const
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] \]

Parameters
axisThe rotation axis itself
thetaThe rotation angle
Returns
Rotation rigid motion in \(\mathbb{R}^{3}\)

◆ makeRotationalSymmetry() [1/2]

RigidMotion RigidMotionR3Factory::makeRotationalSymmetry ( colvec const  axis,
double const  theta 
) const
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.

Parameters
axisRotation axis which is also the orthogonal vector for the symmetry/reflection plane
thetaRotation angle
Returns
Rotational symmetry rigid motion in \(\mathbb{R}^{3}\)
See also
RigidMotionR3Factory::makeRotation(colvec const, double const)
RigidMotionR3Factory::makeReflection(colvec const)
makeRotationalSymmetry(colvec const, double const, colvec const)

◆ makeRotationalSymmetry() [2/2]

RigidMotion RigidMotionR3Factory::makeRotationalSymmetry ( colvec const  axis,
double const  theta,
colvec const  center 
) const
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 \]

Parameters
axisRotation axis which is also the orthogonal vector for the symmetry/reflection plane
thetaRotation angle
centerThe center of rotational symmetry where the rotation axis and the reflection plane intersect
See also
makeRotationalSymmetry(colvec const, double const)

◆ makeRotationalSymmetryFast() [1/2]

RigidMotion RigidMotionR3Factory::makeRotationalSymmetryFast ( colvec const  axis,
double const  theta 
) const
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.

Parameters
axisNormalized rotation axis which is also the orthonormal vector for the symmetry/reflection plane
thetaRotation angle
See also
makeRotationalSymmetry(colvec const, double const)

◆ makeRotationalSymmetryFast() [2/2]

RigidMotion RigidMotionR3Factory::makeRotationalSymmetryFast ( colvec const  axis,
double const  theta,
colvec const  center 
) const
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.

Parameters
axisRotation axis which is also the orthogonal vector for the symmetry/reflection plane
thetaRotation angle
centerThe center of rotational symmetry where the rotation axis and the reflection plane intersect
See also
makeRotationalSymmetry(colvec const, double const, colvec const)

◆ makeRotationalSymmetryX()

RigidMotion RigidMotionR3Factory::makeRotationalSymmetryX ( double const  theta) const
virtual

Implementation of a rotational symmetry over the \(x\)-axis.

Parameters
thetaRotation angle
Returns
Rotational symmetry rigid motion over \(e_1\) vector ( \(x\)-axis) in \(\mathbb{R}^{3}\)

◆ makeRotationalSymmetryY()

RigidMotion RigidMotionR3Factory::makeRotationalSymmetryY ( double const  theta) const
virtual

Implementation of a rotational symmetry over the \(y\)-axis.

Parameters
thetaRotation angle
Returns
Rotational symmetry rigid motion over \(e_2\) vector ( \(y\)-axis) in \(\mathbb{R}^{3}\)

◆ makeRotationalSymmetryZ()

RigidMotion RigidMotionR3Factory::makeRotationalSymmetryZ ( double const  theta) const
virtual

Implementation of a rotational symmetry over the \(z\)-axis.

Parameters
thetaRotation angle
Returns
Rotational symmetry rigid motion over \(e_3\) vector ( \(z\)-axis) in \(\mathbb{R}^{3}\)

◆ makeRotationFast()

RigidMotion RigidMotionR3Factory::makeRotationFast ( colvec const  axis,
double const  theta 
) const
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.

Parameters
axisNormalized rotation axis
thetaRotation angle
See also
RigidMotionR3Factory::makeRotation(colvec const, double const)

◆ makeRotationX()

RigidMotion RigidMotionR3Factory::makeRotationX ( double const  theta) const
virtual

Implementation of a rotation rigid motion over the \(x\)-axis.

Parameters
thetaThe rotation angle
Returns
Rotation rigid motion over \(e_1\) vector ( \(x\)-axis) in \(\mathbb{R}^{3}\)

◆ makeRotationY()

RigidMotion RigidMotionR3Factory::makeRotationY ( double const  theta) const
virtual

Implementation of a rotation rigid motion over the \(y\)-axis.

Parameters
thetaThe rotation angle
Returns
Rotation rigid motion over \(e_2\) vector ( \(y\)-axis) in \(\mathbb{R}^{3}\)

◆ makeRotationZ()

RigidMotion RigidMotionR3Factory::makeRotationZ ( double const  theta) const
virtual

Implementation of a rotation rigid motion over the \(z\)-axis.

Parameters
thetaThe rotation angle
Returns
Rotation rigid motion over \(e_3\) vector ( \(z\)-axis) in \(\mathbb{R}^{3}\)

◆ makeTranslation()

RigidMotion RigidMotionR3Factory::makeTranslation ( colvec const  shift) const
override

Implementation of translation rigid motion in \(\mathbb{R}^{3}\).

See also
rigidmotion::RigidMotionFactory::makeTranslation

◆ serialize()

template<typename Archive >
void rigidmotion::RigidMotionR3Factory::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

Serialize a \(\mathbb{R}^{3}\) rigid motion factory to a stream of bytes.

Template Parameters
ArchiveType of rendering
Parameters
arSpecific rendering for the stream of bytes
versionVersion number for the \(\mathbb{R}^{3}\) rigid motion factory

Member Data Documentation

◆ canonicalReflection

mat const RigidMotionR3Factory::canonicalReflection
staticprotected
Initial value:
= mat(
"-1 0 0; 0 1 0; 0 0 1"
)

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] \]

See also
rigidmotion::RigidMotionR3Factory::makeReflection(colvec const)

The documentation for this class was generated from the following files: