SatAndLight  2.2.2-hubble
Simulation toolkit for space telescopes
Rotation Class Reference

Three-dimensional rotations. More...

#include <Rotation.h>

Inheritance diagram for Rotation:

Public Member Functions

double GetAlpha (void)
 Returns the current value of \(\alpha\) [rad]. More...
 
double GetBeta (void)
 Returns the current value of \(\beta\) [rad]. More...
 
double GetCosAlpha (void)
 Returns the current value of \(\cos(\alpha)\). More...
 
double GetCosBeta (void)
 Returns the current value of \(\cos(\beta)\). More...
 
double GetCosGamma (void)
 Returns the current value of \(\cos(\gamma)\). More...
 
double GetGamma (void)
 Returns the current value of \(\gamma\) [rad]. More...
 
double GetOmega (void)
 Returns the current value of \(\omega\). More...
 
double GetPsi (void)
 Returns the current value of \(\Psi\). More...
 
double GetRotationAngle (void)
 Returns the rotation angle from \(\cal{R}^{\prime}\) to \(\cal{R}\) [rad]. More...
 
double GetRotationAxisXp (void)
 Returns the \(x^{\prime}\) component in \(\cal{R}^{\prime}\) of a vector defining the rotation axis from \(\cal{R}^{\prime}\) to \(\cal{R}\). More...
 
double GetRotationAxisYp (void)
 Returns the \(y^{\prime}\) component in \(\cal{R}^{\prime}\) of a vector defining the rotation axis from \(\cal{R}^{\prime}\) to \(\cal{R}\). More...
 
double GetRotationAxisZp (void)
 Returns the \(z^{\prime}\) component in \(\cal{R}^{\prime}\) of a vector defining the rotation axis from \(\cal{R}^{\prime}\) to \(\cal{R}\). More...
 
double GetRxx ()
 Returns the rotation matrix element \(R_{xx}\). More...
 
double GetRxy ()
 Returns the rotation matrix element \(R_{xy}\). More...
 
double GetRxz ()
 Returns the rotation matrix element \(R_{xz}\). More...
 
double GetRyx ()
 Returns the rotation matrix element \(R_{yx}\). More...
 
double GetRyy ()
 Returns the rotation matrix element \(R_{yy}\). More...
 
double GetRyz ()
 Returns the rotation matrix element \(R_{yz}\). More...
 
double GetRzx ()
 Returns the rotation matrix element \(R_{zx}\). More...
 
double GetRzy ()
 Returns the rotation matrix element \(R_{zy}\). More...
 
double GetRzz ()
 Returns the rotation matrix element \(R_{zz}\). More...
 
double GetSinAlpha (void)
 Returns the current value of \(\sin(\alpha)\). More...
 
double GetSinBeta (void)
 Returns the current value of \(\sin(\beta)\). More...
 
double GetSinGamma (void)
 Returns the current value of \(\sin(\gamma)\). More...
 
double GetUpx (const double aThetaPrime, const double aPhiPrime)
 Returns the \(u^{\prime}_x\) coordinate in the \(\cal{R}^{\prime}\) reference frame. More...
 
double GetUpy (const double aThetaPrime, const double aPhiPrime)
 Returns the \(u^{\prime}_y\) coordinate in the \(\cal{R}^{\prime}\) reference frame. More...
 
double GetUpz (const double aThetaPrime)
 Returns the \(u^{\prime}_z\) coordinate in the \(\cal{R}^{\prime}\) reference frame. More...
 
double GetUx (const double aTheta)
 Returns the \(u_x\) coordinate in the \(\cal{R}\) reference frame. More...
 
double GetUy (const double aTheta, const double aPhi)
 Returns the \(u_y\) coordinate in the \(\cal{R}\) reference frame. More...
 
double GetUz (const double aTheta, const double aPhi)
 Returns the \(u_z\) coordinate in the \(\cal{R}\) reference frame. More...
 
void SetAlpha (const double aAlpha=0.0)
 Sets a new \(\alpha\) value. More...
 
void SetAlphaBetaGamma (const double aAlpha, const double aBeta, const double aGamma)
 Sets Euler angles, \(\alpha, \beta, \gamma\), for the rotation. More...
 
void SetBeta (const double aBeta=0.0)
 Sets a new \(\beta\) value. More...
 
void SetGamma (const double aGamma=0.0)
 Sets a new \(\gamma\) value. More...
 
void SetUnitQuaternion (const double aQ0, const double aQ1, const double aQ2, const double aQ3, const bool aRtoRprime=true)
 Sets Euler angles from a unit quaternion. More...
 
double TransformGetCosPhi (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\cos\varphi\) in the reference frame \(\cal{R}\). More...
 
double TransformGetCosPhiPrime (const double aTheta, const double aPhi)
 Returns the \(\cos\varphi^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetCosTheta (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\cos\theta\) in the reference frame \(\cal{R}\). More...
 
double TransformGetCosThetaPrime (const double aTheta, const double aPhi)
 Returns the \(\cos\theta^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetSinPhi (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\sin\varphi\) in the reference frame \(\cal{R}\). More...
 
double TransformGetSinPhiPrime (const double aTheta, const double aPhi)
 Returns the \(\sin\varphi^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetSinTheta (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\sin\theta\) in the reference frame \(\cal{R}\). More...
 
double TransformGetSinThetaPrime (const double aTheta, const double aPhi)
 Returns the \(\sin\theta^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetTanPhi (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\tan\varphi\) in the reference frame \(\cal{R}\). More...
 
double TransformGetTanPhiPrime (const double aTheta, const double aPhi)
 Returns the \(\tan\varphi^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetTanTheta (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\tan\theta\) in the reference frame \(\cal{R}\). More...
 
double TransformGetTanThetaCosPhi (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\tan\theta\cos\varphi\) in the reference frame \(\cal{R}\). More...
 
double TransformGetTanThetaPrime (const double aTheta, const double aPhi)
 Returns the \(\tan\theta^{\prime}\) in the reference frame \(\cal{R}^{\prime}\). More...
 
double TransformGetTanThetaSinPhi (const double aThetaPrime, const double aPhiPrime)
 Returns the \(\tan\theta\sin\varphi\) in the reference frame \(\cal{R}\). More...
 
Constructors and destructors
 Rotation (const double aAlpha, const double aBeta, const double aGamma)
 Rotation class constuctor. More...
 
virtual ~Rotation (void)
 Rotation class destructor. More...
 

Protected Attributes

double rot_alpha
 Euler angle \(\alpha\). More...
 
double rot_beta
 Euler angle \(\beta\). More...
 
double rot_gamma
 Euler angle \(\gamma\). More...
 

Private Attributes

double c_alpha
 \(\cos(\alpha)\). More...
 
double c_beta
 \(\cos(\beta)\). More...
 
double c_gamma
 \(\cos(\gamma)\). More...
 
double s_alpha
 \(\sin(\alpha)\). More...
 
double s_beta
 \(\sin(\beta)\). More...
 
double s_gamma
 \(\sin(\gamma)\). More...
 

Detailed Description

Three-dimensional rotations.

Defintions

This class is designed to perform three-dimensional rotations between two reference frames. The first reference frame \(\cal{R}^{\prime}\) is defined with a coordinate system \((x^{\prime},y^{\prime},z^{\prime})\). The second reference frame \(\cal{R}\) is defined with a coordinate system \((x,y,z)\). A three-dimensional rotation is needed to change from one coordinate system to the other. This rotation is described using the Euler angles \((\alpha, \beta, \gamma)\). In the following figure, the geometrical definitions are represented. The coordinate system \((x^{\prime},y^{\prime},z^{\prime})\) is represented in black and \((x,y,z)\) is represented in blue. The \(x\)-axis orientation is given by the spherical angles \((\omega,\psi)\).

Geometrical definitions. The rotation to change the system of coordinates is given by the Euler angles and is represented in green.

Change of reference frames

To move from one coordinate system to another, a three-dimensional rotation is performed. To develop the formalism associated to such a transform, we adopt the intrinsic Euler angle rotation system. First we define the line of nodes, \(N\), as the the common perpendicular to the \(z^{\prime}\) and \(z\) axes. The three Euler angles are then represented in green in the figure above:

  • \(\alpha\) is the angle between the \(x^{\prime}\) axis and the \(N\) axis, \([0,2\pi[\).
  • \(\beta\) is the angle between the \(z^{\prime}\) axis and the \(z\) axis, \([0,\pi]\).
  • \(\gamma\) is the angle between the \(N\) axis and the \(x\) axis, \([0,2\pi[\).

The rotation from \(\cal{R}^{\prime}\) to \(\cal{R}\) is decomposed into a sequence of three elementary rotations that occur about the moving \(\cal{R}\) axes. Starting from a position where both reference axis systems are aligned, the first rotation is performed around the \(z^{\prime}=z\) axis with an angle equal to \(\alpha\), so that the \(x\) axis is aligned with the line of nodes. The second rotation is performed around the line of nodes (or \(x\)) by an angle \(\beta\) so that the \(z\) axis reaches its final position. The final rotation occurs about \(z\) by an angle \(\gamma\) and \(\cal{R}\) is in its final position. The rotation matrix for this transformation is ( \(c\) is used for \(\cos\) and \(s\) is used for \(\sin\)):

\[ \left( {\begin{array}{c} x \\ y \\ z \end{array} } \right) = R \left( {\begin{array}{c} x^{\prime} \\ y^{\prime} \\ z^{\prime} \end{array} } \right) = \left[ {\begin{array}{ccc} c_{\alpha}c_{\gamma}-s_{\alpha}c_{\beta}s_{\gamma} & -s_{\alpha}c_{\gamma}-c_{\alpha}c_{\beta}s_{\gamma} & s_{\beta}s_{\gamma} \\ c_{\alpha}s_{\gamma}+s_{\alpha}c_{\beta}c_{\gamma} & -s_{\alpha}s_{\gamma}+c_{\alpha}c_{\beta}c_{\gamma} & -s_{\beta}c_{\gamma} \\ s_{\alpha}s_{\beta} & c_{\alpha}s_{\beta} & c_{\beta} \end{array} } \right] \left( {\begin{array}{c} x^{\prime} \\ y^{\prime} \\ z^{\prime} \end{array} } \right) = \left[ {\begin{array}{ccc} R_{xx} & R_{xy} & R_{xz} \\ R_{yx} & R_{yy} & R_{yz} \\ R_{zx} & R_{zy} & R_{zz} \end{array} } \right] \left( {\begin{array}{c} x^{\prime} \\ y^{\prime} \\ z^{\prime} \end{array} } \right) \]

obtained by applying 3 elementary rotations \(R = R_z(\gamma) \times R_x(\beta) \times R_z(\alpha)\), with:

\[ R_z(\alpha) = \left[ {\begin{array}{ccc} \cos(\alpha) & -\sin(\alpha) & 0 \\ \sin(\alpha) & \cos(\alpha) & 0 \\ 0 & 0 & 1 \end{array} } \right] \]

\[ R_x(\beta) = \left[ {\begin{array}{ccc} 1 & 0 & 0 \\ 0 & \cos(\beta) & -\sin(\beta) \\ 0 & \sin(\beta) & \cos(\beta) \end{array} } \right] \]

\[ R_z(\gamma) = \left[ {\begin{array}{ccc} \cos(\gamma) & -\sin(\gamma) & 0 \\ \sin(\gamma) & \cos(\gamma) & 0 \\ 0 & 0 & 1 \end{array} } \right] \]

This rotation matrix is used to transform the system of coordinates of a given position: \(\vec{u} = R \vec{u}^{\prime}\) where:

\[ \vec{u} = \left( {\begin{array}{c} u_x \\ u_y \\ u_z \end{array} } \right) = \left( {\begin{array}{c} \cos\theta \\ \sin\theta\cos\varphi \\ \sin\theta\sin\varphi \end{array} } \right) \]

and

\[ \vec{u}^{\prime} = \left( {\begin{array}{c} u^{\prime}_x \\ u^{\prime}_y \\ u^{\prime}_z \end{array} } \right) = \left( {\begin{array}{c} \sin\theta^{\prime}\cos\varphi^{\prime} \\ \sin\theta^{\prime}\sin\varphi^{\prime} \\ \cos\theta^{\prime} \end{array} } \right) \]

using the angle definition presented in the following figure.

Rotation transformation and convention.

Note that, in \(\cal{R}\), the spherical angles \((\theta, \varphi)\) are not defined in the conventional way.

The rotation to move from \(\cal{R}\) to \(\cal{R}^{\prime}\) is described by the inverse of \(R\). For a rotation matrix, we simply use the transpose matrix:

\[ R^{-1} = R_z(-\alpha)\times R_x(-\beta) \times R_z(-\gamma) = R^{T} = \left[ {\begin{array}{ccc} R_{xx} & R_{yx} & R_{zx} \\ R_{xy} & R_{yy} & R_{zy} \\ R_{xz} & R_{yz} & R_{zz} \end{array} } \right] \]

Author
Florent Robinet

Constructor & Destructor Documentation

◆ Rotation()

Rotation::Rotation ( const double  aAlpha,
const double  aBeta,
const double  aGamma 
)

Rotation class constuctor.

The Rotation object is initialized. The Euler angles must be provided to initialize the respective orienation of \(\cal{R}\) and \(\cal{R}^{\prime}\).

Parameters
[in]aAlphaEuler angle \(\alpha\) [rad].
[in]aBetaEuler angle \(\beta\) [rad].
[in]aGammaEuler angle \(\gamma\) [rad].

◆ ~Rotation()

Rotation::~Rotation ( void  )
virtual

Rotation class destructor.

Member Function Documentation

◆ GetAlpha()

double Rotation::GetAlpha ( void  )
inline

Returns the current value of \(\alpha\) [rad].

◆ GetBeta()

double Rotation::GetBeta ( void  )
inline

Returns the current value of \(\beta\) [rad].

◆ GetCosAlpha()

double Rotation::GetCosAlpha ( void  )
inline

Returns the current value of \(\cos(\alpha)\).

◆ GetCosBeta()

double Rotation::GetCosBeta ( void  )
inline

Returns the current value of \(\cos(\beta)\).

◆ GetCosGamma()

double Rotation::GetCosGamma ( void  )
inline

Returns the current value of \(\cos(\gamma)\).

◆ GetGamma()

double Rotation::GetGamma ( void  )
inline

Returns the current value of \(\gamma\) [rad].

◆ GetOmega()

double Rotation::GetOmega ( void  )
inline

Returns the current value of \(\omega\).

The angle \(\omega\) is the angle between the \(x^{\prime}\) axis and the projection of the \(x\) axis in the \(y^{\prime}x^{\prime}\) plane. In \(\cal{R}\):

\[ \vec{u}_{x} = R^{-1}\times (1,0,0) = (R_{xx}, R_{xy}, R_{xz}) = (\sin\Psi\cos\omega, \sin\Psi\sin\omega, \cos\Psi) \]

Therefore: \(\omega = \arccos(R_{xx}/\sin\Psi)\), using the sign of \(\sin\omega\) to fix \(\Psi\) in \([0,2\pi[\).

◆ GetPsi()

double Rotation::GetPsi ( void  )
inline

Returns the current value of \(\Psi\).

The angle \(\Psi\) is the angle between the \(z^{\prime}\) axis and the \(x\) axis. In \(\cal{R}\):

\[ \vec{u}_{x} = R^{-1}\times (1,0,0) = (R_{xx}, R_{xy}, R_{xz}) = (\sin\Psi\cos\omega, \sin\Psi\sin\omega, \cos\Psi) \]

Therefore: \(\Psi = \arccos(R_{xz})\).

◆ GetRotationAngle()

double Rotation::GetRotationAngle ( void  )
inline

Returns the rotation angle from \(\cal{R}^{\prime}\) to \(\cal{R}\) [rad].

The rotation angle \(\delta\) is obtained with:

\[ \delta = \mathrm{arccos}\left((\mathrm{trace} - 1)/2\right) \]

where \(\mathrm{trace}\) is the trace of the rotation matrix.

Note
\(0 \le \delta \le \pi\).
See also
GetRotationAxisXp(), GetRotationAxisYp(), GetRotationAxisZp() for the rotation axis.

◆ GetRotationAxisXp()

double Rotation::GetRotationAxisXp ( void  )
inline

Returns the \(x^{\prime}\) component in \(\cal{R}^{\prime}\) of a vector defining the rotation axis from \(\cal{R}^{\prime}\) to \(\cal{R}\).

The vector \(x^{\prime}\) component is given by \(R_{zy}-R_{yz}\).

Warning
The vector is not a unit vector.

◆ GetRotationAxisYp()

double Rotation::GetRotationAxisYp ( void  )
inline

Returns the \(y^{\prime}\) component in \(\cal{R}^{\prime}\) of a vector defining the rotation axis from \(\cal{R}^{\prime}\) to \(\cal{R}\).

The vector \(y^{\prime}\) component is given by \(R_{xz}-R_{zx}\).

Warning
The vector is not a unit vector.

◆ GetRotationAxisZp()

double Rotation::GetRotationAxisZp ( void  )
inline

Returns the \(z^{\prime}\) component in \(\cal{R}^{\prime}\) of a vector defining the rotation axis from \(\cal{R}^{\prime}\) to \(\cal{R}\).

The vector \(z^{\prime}\) component is given by \(R_{yx}-R_{xy}\).

Warning
The vector is not a unit vector.

◆ GetRxx()

double Rotation::GetRxx ( )
inline

Returns the rotation matrix element \(R_{xx}\).

\[ R_{xx}=\cos\alpha\cos\gamma-\sin\alpha\cos\beta\sin\gamma \]

◆ GetRxy()

double Rotation::GetRxy ( )
inline

Returns the rotation matrix element \(R_{xy}\).

\[ R_{xy}=-\sin\alpha\cos\gamma-\cos\alpha\cos\beta\sin\gamma \]

◆ GetRxz()

double Rotation::GetRxz ( )
inline

Returns the rotation matrix element \(R_{xz}\).

\[ R_{xz}=\sin\beta\sin\gamma \]

◆ GetRyx()

double Rotation::GetRyx ( )
inline

Returns the rotation matrix element \(R_{yx}\).

\[ R_{yx}=\cos\alpha\sin\gamma+\sin\alpha\cos\beta\cos\gamma \]

◆ GetRyy()

double Rotation::GetRyy ( )
inline

Returns the rotation matrix element \(R_{yy}\).

\[ R_{yy}=-\sin\alpha\sin\gamma+\cos\alpha\cos\beta\cos\gamma \]

◆ GetRyz()

double Rotation::GetRyz ( )
inline

Returns the rotation matrix element \(R_{yz}\).

\[ R_{yz}=-\sin\beta\cos\gamma \]

◆ GetRzx()

double Rotation::GetRzx ( )
inline

Returns the rotation matrix element \(R_{zx}\).

\[ R_{zx}=\sin\alpha\sin\beta \]

◆ GetRzy()

double Rotation::GetRzy ( )
inline

Returns the rotation matrix element \(R_{zy}\).

\[ R_{zy}=\cos\alpha\sin\beta \]

◆ GetRzz()

double Rotation::GetRzz ( )
inline

Returns the rotation matrix element \(R_{zz}\).

\[ R_{zz}=\cos\beta \]

◆ GetSinAlpha()

double Rotation::GetSinAlpha ( void  )
inline

Returns the current value of \(\sin(\alpha)\).

◆ GetSinBeta()

double Rotation::GetSinBeta ( void  )
inline

Returns the current value of \(\sin(\beta)\).

◆ GetSinGamma()

double Rotation::GetSinGamma ( void  )
inline

Returns the current value of \(\sin(\gamma)\).

◆ GetUpx()

double Rotation::GetUpx ( const double  aThetaPrime,
const double  aPhiPrime 
)
inline

Returns the \(u^{\prime}_x\) coordinate in the \(\cal{R}^{\prime}\) reference frame.

The coordinates in the \(\cal{R}^{\prime}\) reference frame, \((\theta^{\prime},\varphi^{\prime})\) are used to compute the x-coordinate of \(\vec{u}^{\prime}\) in the \(\cal{R}^{\prime}\) reference frame:

\[ u^{\prime}_x=\sin\theta^{\prime}\cos\varphi^{\prime} \]

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, \(\cal{R}^{\prime}\) reference frame.
[in]aPhiPrime\(\varphi^{\prime}\) coordinate, \(\cal{R}^{\prime}\) reference frame.

◆ GetUpy()

double Rotation::GetUpy ( const double  aThetaPrime,
const double  aPhiPrime 
)
inline

Returns the \(u^{\prime}_y\) coordinate in the \(\cal{R}^{\prime}\) reference frame.

The coordinates in the \(\cal{R}^{\prime}\) reference frame, \((\theta^{\prime},\varphi^{\prime})\) are used to compute the y-coordinate of \(\vec{u}^{\prime}\) in the \(\cal{R}^{\prime}\) reference frame:

\[ u^{\prime}_y=\sin\theta^{\prime}\sin\varphi^{\prime} \]

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, \(\cal{R}^{\prime}\) reference frame.
[in]aPhiPrime\(\varphi^{\prime}\) coordinate, \(\cal{R}^{\prime}\) reference frame.

◆ GetUpz()

double Rotation::GetUpz ( const double  aThetaPrime)
inline

Returns the \(u^{\prime}_z\) coordinate in the \(\cal{R}^{\prime}\) reference frame.

The coordinates in the \(\cal{R}^{\prime}\) reference frame, \((\theta^{\prime},\varphi^{\prime})\) are used to compute the z-coordinate of \(\vec{u}^{\prime}\) in the \(\cal{R}^{\prime}\) reference frame:

\[ u^{\prime}_z=\cos\theta^{\prime} \]

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, \(\cal{R}^{\prime}\) reference frame.

◆ GetUx()

double Rotation::GetUx ( const double  aTheta)
inline

Returns the \(u_x\) coordinate in the \(\cal{R}\) reference frame.

The coordinates in the \(\cal{R}\) reference frame, \((\theta,\varphi)\) are used to compute the x-coordinate of \(\vec{u}\) in the \(\cal{R}\) reference frame:

\[ u_x=\cos\theta \]

Parameters
[in]aTheta\(\theta\) coordinate, \(\cal{R}\) reference frame.

◆ GetUy()

double Rotation::GetUy ( const double  aTheta,
const double  aPhi 
)
inline

Returns the \(u_y\) coordinate in the \(\cal{R}\) reference frame.

The coordinates in the \(\cal{R}\) reference frame, \((\theta,\varphi)\) are used to compute the y-coordinate of \(\vec{u}\) in the \(\cal{R}\) reference frame:

\[ u_y=\sin\theta \times \cos\varphi \]

Parameters
[in]aTheta\(\theta\) coordinate, \(\cal{R}\) reference frame.
[in]aPhi\(\varphi\) coordinate, \(\cal{R}\) reference frame.

◆ GetUz()

double Rotation::GetUz ( const double  aTheta,
const double  aPhi 
)
inline

Returns the \(u_z\) coordinate in the \(\cal{R}\) reference frame.

The coordinates in the \(\cal{R}\) reference frame, \((\theta,\varphi)\) are used to compute the z-coordinate of \(\vec{u}\) in the \(\cal{R}\) reference frame:

\[ u_z=\sin\theta \times \sin\varphi \]

Parameters
[in]aTheta\(\theta\) coordinate, \(\cal{R}\) reference frame.
[in]aPhi\(\varphi\) coordinate, \(\cal{R}\) reference frame.

◆ SetAlpha()

void Rotation::SetAlpha ( const double  aAlpha = 0.0)
inline

Sets a new \(\alpha\) value.

Parameters
[in]aAlphaNew \(\alpha\) value [rad].

◆ SetAlphaBetaGamma()

void Rotation::SetAlphaBetaGamma ( const double  aAlpha,
const double  aBeta,
const double  aGamma 
)
inline

Sets Euler angles, \(\alpha, \beta, \gamma\), for the rotation.

Parameters
[in]aAlphaEuler angle \(\alpha\) [rad].
[in]aBetaEuler angle \(\beta\) [rad].
[in]aGammaEuler angle \(\gamma\) [rad].

◆ SetBeta()

void Rotation::SetBeta ( const double  aBeta = 0.0)
inline

Sets a new \(\beta\) value.

Parameters
[in]aBetaNew \(\beta\) value [rad].

◆ SetGamma()

void Rotation::SetGamma ( const double  aGamma = 0.0)
inline

Sets a new \(\gamma\) value.

Parameters
[in]aGammaNew \(\gamma\) value [rad].

◆ SetUnitQuaternion()

void Rotation::SetUnitQuaternion ( const double  aQ0,
const double  aQ1,
const double  aQ2,
const double  aQ3,
const bool  aRtoRprime = true 
)

Sets Euler angles from a unit quaternion.

The rotation Euler angles are derived from a unit quaternion: \(\mathbf{q} = q_0 + q_1\mathbf{i} + q_2\mathbf{j} + q_3\mathbf{k}\), where \(q_0^2+q_1^2+q_2^2+q_3^2 = 1\).

Parameters
[in]aQ0\(q_0\).
[in]aQ1\(q_1\).
[in]aQ2\(q_2\).
[in]aQ3\(q_3\).
[in]aRtoRprimeBy default, the quaternion operates the rotation from \(\cal{R}^{\prime}\) to \(\cal{R}\). Set this flag to false to define the inverse rotation from \(\cal{R}\) to \(\cal{R}^{\prime}\).
Precondition
The quaternion must be normalized. This will not be checked!

◆ TransformGetCosPhi()

double Rotation::TransformGetCosPhi ( const double  aThetaPrime,
const double  aPhiPrime 
)
inline

Returns the \(\cos\varphi\) in the reference frame \(\cal{R}\).

The coordinates in the reference frame \(\cal{R^{\prime}}\), \((\theta^{\prime},\varphi^{\prime})\) are transformed into coordinates in the reference frame \(\cal{R}\). This function returns the cosine of the \(\varphi\) angle measured from the \(y\) axis.

\[ \cos\varphi=\frac{R_{yx}u^{\prime}_x+R_{yy}u^{\prime}_y+R_{yz}u^{\prime}_z}{\sin\theta} \]

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, reference frame \(\cal{R^{\prime}}\).
[in]aPhiPrime\(\varphi^{\prime}\) coordinate, reference frame \(\cal{R^{\prime}}\).

◆ TransformGetCosPhiPrime()

double Rotation::TransformGetCosPhiPrime ( const double  aTheta,
const double  aPhi 
)
inline

Returns the \(\cos\varphi^{\prime}\) in the reference frame \(\cal{R}^{\prime}\).

The coordinates in the reference frame \(\cal{R}\), \((\theta,\varphi)\) are transformed into coordinates in the reference frame \(\cal{R}^{\prime}\). This function returns the cosine of the \(\varphi^{\prime}\) angle measured from the \(x^{\prime}\) axis.

\[ \cos\varphi^{\prime}=\frac{R_{xx}u_x+R_{yx}u_y+R_{zx}u_z}{\sin\theta^{\prime}} \]

Parameters
[in]aTheta\(\theta\) coordinate, reference frame \(\cal{R}\).
[in]aPhi\(\varphi\) coordinate, reference frame \(\cal{R}\).

◆ TransformGetCosTheta()

double Rotation::TransformGetCosTheta ( const double  aThetaPrime,
const double  aPhiPrime 
)
inline

Returns the \(\cos\theta\) in the reference frame \(\cal{R}\).

The coordinates in the reference frame \(\cal{R^{\prime}}\), \((\theta^{\prime},\varphi^{\prime})\) are transformed into coordinates in the reference frame \(\cal{R}\). This function returns the cosine of the \(\theta\) angle measured from the \(x\) axis.

\[ \cos\theta=R_{xx}u^{\prime}_x+R_{xy}u^{\prime}_y+R_{xz}u^{\prime}_z \]

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, \(\cal{R^{\prime}}\) reference frame.
[in]aPhiPrime\(\varphi^{\prime}\) coordinate, \(\cal{R^{\prime}}\) reference frame.

◆ TransformGetCosThetaPrime()

double Rotation::TransformGetCosThetaPrime ( const double  aTheta,
const double  aPhi 
)
inline

Returns the \(\cos\theta^{\prime}\) in the reference frame \(\cal{R}^{\prime}\).

The coordinates in the reference frame \(\cal{R}\), \((\theta,\varphi)\) are transformed into coordinates in the reference frame \(\cal{R}^{\prime}\). This function returns the cosine of the \(\theta^{\prime}\) angle measured from the \(z^{\prime}\) axis.

\[ \cos\theta^{\prime}=R_{xz}u_x+R_{yz}u_y+R_{zz}u_z \]

Parameters
[in]aTheta\(\theta\) coordinate, \(\cal{R}\) reference frame.
[in]aPhi\(\varphi\) coordinate, \(\cal{R}\) reference frame.

◆ TransformGetSinPhi()

double Rotation::TransformGetSinPhi ( const double  aThetaPrime,
const double  aPhiPrime 
)
inline

Returns the \(\sin\varphi\) in the reference frame \(\cal{R}\).

The coordinates in the reference frame \(\cal{R^{\prime}}\), \((\theta^{\prime},\varphi^{\prime})\) are transformed into coordinates in the reference frame \(\cal{R}\). This function returns the sine of the \(\varphi\) angle measured from the \(y\) axis.

\[ \sin\varphi=\frac{R_{zx}u^{\prime}_x+R_{zy}u^{\prime}_y+R_{zz}u^{\prime}_z}{\sin\theta} \]

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, reference frame \(\cal{R^{\prime}}\).
[in]aPhiPrime\(\varphi^{\prime}\) coordinate, reference frame \(\cal{R^{\prime}}\).

◆ TransformGetSinPhiPrime()

double Rotation::TransformGetSinPhiPrime ( const double  aTheta,
const double  aPhi 
)
inline

Returns the \(\sin\varphi^{\prime}\) in the reference frame \(\cal{R}^{\prime}\).

The coordinates in the reference frame \(\cal{R}\), \((\theta,\varphi)\) are transformed into coordinates in the reference frame \(\cal{R}^{\prime}\). This function returns the sine of the \(\varphi^{\prime}\) angle measured from the \(x^{\prime}\) axis.

\[ \sin\varphi^{\prime}=\frac{R_{xy}u_x+R_{yy}u_y+R_{zy}u_z}{\sin\theta^{\prime}} \]

Parameters
[in]aTheta\(\theta\) coordinate, reference frame \(\cal{R}\).
[in]aPhi\(\varphi\) coordinate, reference frame \(\cal{R}\).

◆ TransformGetSinTheta()

double Rotation::TransformGetSinTheta ( const double  aThetaPrime,
const double  aPhiPrime 
)
inline

Returns the \(\sin\theta\) in the reference frame \(\cal{R}\).

The coordinates in the reference frame \(\cal{R^{\prime}}\), \((\theta^{\prime},\varphi^{\prime})\) are transformed into coordinates in the reference frame \(\cal{R}\). This function returns the sine of the \(\theta\) angle measured from the \(x\) axis.

\[ \sin\theta=\sqrt{\left(R_{yx}u^{\prime}_x+R_{yy}u^{\prime}_y+R_{yz}u^{\prime}_z\right)^2 +\left(R_{zx}u^{\prime}_x+R_{zy}u^{\prime}_y+R_{zz}u^{\prime}_z\right)^2} \]

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, \(\cal{R^{\prime}}\) reference frame.
[in]aPhiPrime\(\varphi^{\prime}\) coordinate, \(\cal{R^{\prime}}\) reference frame.

◆ TransformGetSinThetaPrime()

double Rotation::TransformGetSinThetaPrime ( const double  aTheta,
const double  aPhi 
)
inline

Returns the \(\sin\theta^{\prime}\) in the reference frame \(\cal{R}^{\prime}\).

The coordinates in the reference frame \(\cal{R}\), \((\theta,\varphi)\) are transformed into coordinates in the reference frame \(\cal{R}^{\prime}\). This function returns the sine of the \(\theta^{\prime}\) angle measured from the \(z^{\prime}\) axis.

\[ \sin\theta^{\prime}=\sqrt{\left(R_{xx}u_x+R_{yx}u_y+R_{zx}u_z\right)^2 +\left(R_{xy}u_x+R_{yy}u_y+R_{zy}u_z\right)^2} \]

Parameters
[in]aTheta\(\theta\) coordinate, \(\cal{R}\) reference frame.
[in]aPhi\(\varphi\) coordinate, \(\cal{R}\) reference frame.

◆ TransformGetTanPhi()

double Rotation::TransformGetTanPhi ( const double  aThetaPrime,
const double  aPhiPrime 
)
inline

Returns the \(\tan\varphi\) in the reference frame \(\cal{R}\).

The coordinates in the reference frame \(\cal{R^{\prime}}\), \((\theta^{\prime},\varphi^{\prime})\) are transformed into coordinates in the reference frame \(\cal{R}\). This function returns the tangent of the \(\varphi\) angle measured from the \(y\) axis.

\[ \tan\varphi=\frac{R_{zx}u^{\prime}_x+R_{zy}u^{\prime}_y+R_{zz}u^{\prime}_z}{R_{yx}u^{\prime}_x+R_{yy}u^{\prime}_y+R_{yz}u^{\prime}_z} \]

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, reference frame \(\cal{R^{\prime}}\).
[in]aPhiPrime\(\varphi^{\prime}\) coordinate, reference frame \(\cal{R^{\prime}}\).

◆ TransformGetTanPhiPrime()

double Rotation::TransformGetTanPhiPrime ( const double  aTheta,
const double  aPhi 
)
inline

Returns the \(\tan\varphi^{\prime}\) in the reference frame \(\cal{R}^{\prime}\).

The coordinates in the reference frame \(\cal{R}\), \((\theta,\varphi)\) are transformed into coordinates in the reference frame \(\cal{R}^{\prime}\). This function returns the tangent of the \(\varphi^{\prime}\) angle measured from the \(x^{\prime}\) axis.

\[ \tan\varphi^{\prime}=\frac{R_{xy}u_x+R_{yy}u_y+R_{zy}u_z}{R_{xx}u_x+R_{yx}u_y+R_{zx}u_z} \]

Parameters
[in]aTheta\(\theta\) coordinate, reference frame \(\cal{R}\).
[in]aPhi\(\varphi\) coordinate, reference frame \(\cal{R}\).

◆ TransformGetTanTheta()

double Rotation::TransformGetTanTheta ( const double  aThetaPrime,
const double  aPhiPrime 
)
inline

Returns the \(\tan\theta\) in the reference frame \(\cal{R}\).

The coordinates in the reference frame \(\cal{R^{\prime}}\), \((\theta^{\prime},\varphi^{\prime})\) are transformed into coordinates in the reference frame \(\cal{R}\). This function returns the tangent of the \(\theta\) angle measured from the \(x\) axis. It is obtained from TransformGetSinTheta() and TransformGetCosTheta() functions.

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, \(\cal{R^{\prime}}\) reference frame.
[in]aPhiPrime\(\varphi^{\prime}\) coordinate, \(\cal{R^{\prime}}\) reference frame.

◆ TransformGetTanThetaCosPhi()

double Rotation::TransformGetTanThetaCosPhi ( const double  aThetaPrime,
const double  aPhiPrime 
)
inline

Returns the \(\tan\theta\cos\varphi\) in the reference frame \(\cal{R}\).

The coordinates in the reference frame \(\cal{R^{\prime}}\), \((\theta^{\prime},\varphi^{\prime})\) are transformed into coordinates in the reference frame \(\cal{R}\). This function returns \(\tan\theta\cos\varphi\) where the \(\varphi\) angle is measured from the \(y\) axis and the \(\theta\) angle is measured from the \(x\) axis.

\[ \tan\theta\cos\varphi=\frac{R_{yx}u^{\prime}_x+R_{yy}u^{\prime}_y+R_{yz}u^{\prime}_z}{R_{xx}u^{\prime}_x+R_{xy}u^{\prime}_y+R_{xz}u^{\prime}_z} \]

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, reference frame \(\cal{R}\).
[in]aPhiPrime\(\varphi^{\prime}\) coordinate, reference frame \(\cal{R^{\prime}}\).

◆ TransformGetTanThetaPrime()

double Rotation::TransformGetTanThetaPrime ( const double  aTheta,
const double  aPhi 
)
inline

Returns the \(\tan\theta^{\prime}\) in the reference frame \(\cal{R}^{\prime}\).

The coordinates in the reference frame \(\cal{R}\), \((\theta,\varphi)\) are transformed into coordinates in the reference frame \(\cal{R}^{\prime}\). This function returns the tangent of the \(\theta^{\prime}\) angle measured from the \(z^{\prime}\) axis. It is obtained from TransformGetSinThetaPrime() and TransformGetCosThetaPrime() functions.

Parameters
[in]aTheta\(\theta\) coordinate, \(\cal{R}\) reference frame.
[in]aPhi\(\varphi\) coordinate, \(\cal{R}\) reference frame.

◆ TransformGetTanThetaSinPhi()

double Rotation::TransformGetTanThetaSinPhi ( const double  aThetaPrime,
const double  aPhiPrime 
)
inline

Returns the \(\tan\theta\sin\varphi\) in the reference frame \(\cal{R}\).

The coordinates in the reference frame \(\cal{R^{\prime}}\), \((\theta^{\prime},\varphi^{\prime})\) are transformed into coordinates in the reference frame \(\cal{R}\). This function returns \(\tan\theta\sin\varphi\) where the \(\varphi\) angle is measured from the \(y\) axis and the \(\theta\) angle is measured from the \(x\) axis.

\[ \tan\theta\sin\varphi=\frac{R_{zx}u^{\prime}_x+R_{zy}u^{\prime}_y+R_{zz}u^{\prime}_z}{R_{xx}u^{\prime}_x+R_{xy}u^{\prime}_y+R_{xz}u^{\prime}_z} \]

Parameters
[in]aThetaPrime\(\theta^{\prime}\) coordinate, reference frame \(\cal{R^{\prime}}\).
[in]aPhiPrime\(\varphi^{\prime}\) coordinate, reference frame \(\cal{R^{\prime}}\).

Member Data Documentation

◆ c_alpha

double Rotation::c_alpha
private

\(\cos(\alpha)\).

◆ c_beta

double Rotation::c_beta
private

\(\cos(\beta)\).

◆ c_gamma

double Rotation::c_gamma
private

\(\cos(\gamma)\).

◆ rot_alpha

double Rotation::rot_alpha
protected

Euler angle \(\alpha\).

◆ rot_beta

double Rotation::rot_beta
protected

Euler angle \(\beta\).

◆ rot_gamma

double Rotation::rot_gamma
protected

Euler angle \(\gamma\).

◆ s_alpha

double Rotation::s_alpha
private

\(\sin(\alpha)\).

◆ s_beta

double Rotation::s_beta
private

\(\sin(\beta)\).

◆ s_gamma

double Rotation::s_gamma
private

\(\sin(\gamma)\).


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