Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::RotationZYX Class Reference

Rotation class with the (3D) rotation represented by angles describing first a rotation of an angle phi (yaw) about the Z axis, followed by a rotation of an angle theta (pitch) about the Y axis, followed by a third rotation of an angle psi (roll) about the X axis.

Note that the rotations are extrinsic rotations happening around a fixed coordinate system. This is different than the convention of the ROOT::Math::EulerAngles class, where the rotation are intrinsic. Also it has not to be confused with the typical Goldstein definition of the Euler Angles (Z-X-Z or 313 sequence) which is used by the ROOT::Math::EulerAngles class, while the sequence here is Z-Y-X or 321. Applying a RotationZYX(phi, theta, psi) to a vector is then equal to applying RotationX(psi) * RotationY(theta) * RotationZ(phi) to the same vector.

See also
Overview of the physics vector library

Definition at line 63 of file RotationZYX.h.

Public Types

typedef double Scalar
 

Public Member Functions

 RotationZYX ()
 Default constructor.
 
template<class OtherRotation >
 RotationZYX (const OtherRotation &r)
 Construct from another supported rotation type (see gv_detail::convert )
 
template<class IT >
 RotationZYX (IT begin, IT end)
 Construct given a pair of pointers or iterators defining the beginning and end of an array of three Scalars, to be treated as the angles phi, theta and psi.
 
 RotationZYX (Scalar phi, Scalar theta, Scalar psi)
 Constructor from phi, theta and psi.
 
template<class R >
Scalar Distance (const R &r) const
 Distance between two rotations.
 
template<class IT >
void GetComponents (IT begin) const
 Get the axis and then the angle into data specified by an iterator begin.
 
template<class IT >
void GetComponents (IT begin, IT end) const
 Get the axis and then the angle into data specified by an iterator begin and another to the end of the desired data (4 past start).
 
void GetComponents (Scalar &phi, Scalar &theta, Scalar &psi) const
 Get the components phi, theta, psi into three Scalars.
 
RotationZYX Inverse () const
 Return inverse of a rotation.
 
void Invert ()
 Invert a rotation in place.
 
bool operator!= (const RotationZYX &rhs) const
 
template<class CoordSystem , class U >
DisplacementVector3D< CoordSystem, U > operator() (const DisplacementVector3D< CoordSystem, U > &v) const
 Rotation operation on a displacement vector in any coordinate system and tag.
 
template<class ForeignVector >
ForeignVector operator() (const ForeignVector &v) const
 Rotation operation on an arbitrary vector v.
 
template<class CoordSystem >
LorentzVector< CoordSystem > operator() (const LorentzVector< CoordSystem > &v) const
 Rotation operation on a Lorentz vector in any 4D coordinate system.
 
template<class CoordSystem , class U >
PositionVector3D< CoordSystem, U > operator() (const PositionVector3D< CoordSystem, U > &v) const
 Rotation operation on a position vector in any coordinate system.
 
template<class AVector >
AVector operator* (const AVector &v) const
 Overload operator * for rotation on a vector.
 
RotationZYX operator* (const AxisAngle &a) const
 
RotationZYX operator* (const EulerAngles &q) const
 
RotationZYX operator* (const Quaternion &q) const
 
RotationZYX operator* (const Rotation3D &r) const
 
RotationZYX operator* (const RotationX &rx) const
 
RotationZYX operator* (const RotationY &ry) const
 
RotationZYX operator* (const RotationZ &rz) const
 
RotationZYX operator* (const RotationZYX &e) const
 Multiply (combine) two rotations.
 
template<class R >
RotationZYXoperator*= (const R &r)
 Post-Multiply (on right) by another rotation : T = T*R.
 
template<class OtherRotation >
RotationZYXoperator= (OtherRotation const &r)
 Assign from another supported rotation type (see gv_detail::convert )
 
bool operator== (const RotationZYX &rhs) const
 Equality/inequality operators.
 
Scalar Phi () const
 Return Phi angle (Z rotation angle)
 
Scalar Psi () const
 Return Psi angle (X'' rotation angle)
 
void Rectify ()
 Re-adjust components place angles in canonical ranges.
 
template<class IT >
void SetComponents (IT begin, IT end)
 Set the three Euler angles given a pair of pointers or iterators defining the beginning and end of an array of three Scalars.
 
void SetComponents (Scalar phi, Scalar theta, Scalar psi)
 Set the components phi, theta, psi based on three Scalars.
 
void SetPhi (Scalar phi)
 Set Phi angle (Z rotation angle)
 
void SetPsi (Scalar psi)
 Set Psi angle (X'' rotation angle)
 
void SetTheta (Scalar theta)
 Set Theta angle (Y' rotation angle)
 
Scalar Theta () const
 Return Theta angle (Y' rotation angle)
 

Static Private Member Functions

static double Pi ()
 

Private Attributes

double fPhi
 
double fPsi
 
double fTheta
 

#include <Math/GenVector/RotationZYX.h>

Member Typedef Documentation

◆ Scalar

Definition at line 67 of file RotationZYX.h.

Constructor & Destructor Documentation

◆ RotationZYX() [1/4]

ROOT::Math::RotationZYX::RotationZYX ( )
inline

Default constructor.

Definition at line 75 of file RotationZYX.h.

◆ RotationZYX() [2/4]

ROOT::Math::RotationZYX::RotationZYX ( Scalar  phi,
Scalar  theta,
Scalar  psi 
)
inline

Constructor from phi, theta and psi.

Definition at line 80 of file RotationZYX.h.

◆ RotationZYX() [3/4]

template<class IT >
ROOT::Math::RotationZYX::RotationZYX ( IT  begin,
IT  end 
)
inline

Construct given a pair of pointers or iterators defining the beginning and end of an array of three Scalars, to be treated as the angles phi, theta and psi.

Definition at line 90 of file RotationZYX.h.

◆ RotationZYX() [4/4]

template<class OtherRotation >
ROOT::Math::RotationZYX::RotationZYX ( const OtherRotation &  r)
inlineexplicit

Construct from another supported rotation type (see gv_detail::convert )

Definition at line 106 of file RotationZYX.h.

Member Function Documentation

◆ Distance()

template<class R >
Scalar ROOT::Math::RotationZYX::Distance ( const R r) const
inline

Distance between two rotations.

Definition at line 300 of file RotationZYX.h.

◆ GetComponents() [1/3]

template<class IT >
void ROOT::Math::RotationZYX::GetComponents ( IT  begin) const
inline

Get the axis and then the angle into data specified by an iterator begin.

Definition at line 152 of file RotationZYX.h.

◆ GetComponents() [2/3]

template<class IT >
void ROOT::Math::RotationZYX::GetComponents ( IT  begin,
IT  end 
) const
inline

Get the axis and then the angle into data specified by an iterator begin and another to the end of the desired data (4 past start).

Definition at line 140 of file RotationZYX.h.

◆ GetComponents() [3/3]

void ROOT::Math::RotationZYX::GetComponents ( Scalar phi,
Scalar theta,
Scalar psi 
) const
inline

Get the components phi, theta, psi into three Scalars.

Definition at line 169 of file RotationZYX.h.

◆ Inverse()

RotationZYX ROOT::Math::RotationZYX::Inverse ( ) const
inline

Return inverse of a rotation.

Definition at line 269 of file RotationZYX.h.

◆ Invert()

void ROOT::Math::RotationZYX::Invert ( )

Invert a rotation in place.

Definition at line 138 of file RotationZYX.cxx.

◆ operator!=()

bool ROOT::Math::RotationZYX::operator!= ( const RotationZYX rhs) const
inline

Definition at line 311 of file RotationZYX.h.

◆ operator()() [1/4]

template<class CoordSystem , class U >
DisplacementVector3D< CoordSystem, U > ROOT::Math::RotationZYX::operator() ( const DisplacementVector3D< CoordSystem, U > &  v) const
inline

Rotation operation on a displacement vector in any coordinate system and tag.

Definition at line 211 of file RotationZYX.h.

◆ operator()() [2/4]

template<class ForeignVector >
ForeignVector ROOT::Math::RotationZYX::operator() ( const ForeignVector &  v) const
inline

Rotation operation on an arbitrary vector v.

Preconditions: v must implement methods x(), y(), and z() and the arbitrary vector type must have a constructor taking (x,y,z)

Definition at line 245 of file RotationZYX.h.

◆ operator()() [3/4]

template<class CoordSystem >
LorentzVector< CoordSystem > ROOT::Math::RotationZYX::operator() ( const LorentzVector< CoordSystem > &  v) const
inline

Rotation operation on a Lorentz vector in any 4D coordinate system.

Definition at line 231 of file RotationZYX.h.

◆ operator()() [4/4]

template<class CoordSystem , class U >
PositionVector3D< CoordSystem, U > ROOT::Math::RotationZYX::operator() ( const PositionVector3D< CoordSystem, U > &  v) const
inline

Rotation operation on a position vector in any coordinate system.

Definition at line 220 of file RotationZYX.h.

◆ operator*() [1/9]

template<class AVector >
AVector ROOT::Math::RotationZYX::operator* ( const AVector &  v) const
inline

Overload operator * for rotation on a vector.

Definition at line 256 of file RotationZYX.h.

◆ operator*() [2/9]

RotationZYX ROOT::Math::RotationZYX::operator* ( const AxisAngle a) const

Definition at line 54 of file RotationZYX.cxx.

◆ operator*() [3/9]

RotationZYX ROOT::Math::RotationZYX::operator* ( const EulerAngles q) const

Definition at line 59 of file RotationZYX.cxx.

◆ operator*() [4/9]

RotationZYX ROOT::Math::RotationZYX::operator* ( const Quaternion q) const

Definition at line 69 of file RotationZYX.cxx.

◆ operator*() [5/9]

RotationZYX ROOT::Math::RotationZYX::operator* ( const Rotation3D r) const

Definition at line 49 of file RotationZYX.cxx.

◆ operator*() [6/9]

RotationZYX ROOT::Math::RotationZYX::operator* ( const RotationX rx) const

Definition at line 74 of file RotationZYX.cxx.

◆ operator*() [7/9]

RotationZYX ROOT::Math::RotationZYX::operator* ( const RotationY ry) const

Definition at line 79 of file RotationZYX.cxx.

◆ operator*() [8/9]

RotationZYX ROOT::Math::RotationZYX::operator* ( const RotationZ rz) const

Definition at line 84 of file RotationZYX.cxx.

◆ operator*() [9/9]

RotationZYX ROOT::Math::RotationZYX::operator* ( const RotationZYX e) const

Multiply (combine) two rotations.

Definition at line 64 of file RotationZYX.cxx.

◆ operator*=()

template<class R >
RotationZYX & ROOT::Math::RotationZYX::operator*= ( const R r)
inline

Post-Multiply (on right) by another rotation : T = T*R.

Definition at line 294 of file RotationZYX.h.

◆ operator=()

template<class OtherRotation >
RotationZYX & ROOT::Math::RotationZYX::operator= ( OtherRotation const &  r)
inline

Assign from another supported rotation type (see gv_detail::convert )

Definition at line 113 of file RotationZYX.h.

◆ operator==()

bool ROOT::Math::RotationZYX::operator== ( const RotationZYX rhs) const
inline

Equality/inequality operators.

Definition at line 305 of file RotationZYX.h.

◆ Phi()

Scalar ROOT::Math::RotationZYX::Phi ( ) const
inline

Return Phi angle (Z rotation angle)

Definition at line 181 of file RotationZYX.h.

◆ Pi()

static double ROOT::Math::RotationZYX::Pi ( )
inlinestaticprivate

Definition at line 321 of file RotationZYX.h.

◆ Psi()

Scalar ROOT::Math::RotationZYX::Psi ( ) const
inline

Return Psi angle (X'' rotation angle)

Definition at line 201 of file RotationZYX.h.

◆ Rectify()

void ROOT::Math::RotationZYX::Rectify ( )

Re-adjust components place angles in canonical ranges.

Definition at line 108 of file RotationZYX.cxx.

◆ SetComponents() [1/2]

template<class IT >
void ROOT::Math::RotationZYX::SetComponents ( IT  begin,
IT  end 
)
inline

Set the three Euler angles given a pair of pointers or iterators defining the beginning and end of an array of three Scalars.

Definition at line 126 of file RotationZYX.h.

◆ SetComponents() [2/2]

void ROOT::Math::RotationZYX::SetComponents ( Scalar  phi,
Scalar  theta,
Scalar  psi 
)
inline

Set the components phi, theta, psi based on three Scalars.

Definition at line 161 of file RotationZYX.h.

◆ SetPhi()

void ROOT::Math::RotationZYX::SetPhi ( Scalar  phi)
inline

Set Phi angle (Z rotation angle)

Definition at line 176 of file RotationZYX.h.

◆ SetPsi()

void ROOT::Math::RotationZYX::SetPsi ( Scalar  psi)
inline

Set Psi angle (X'' rotation angle)

Definition at line 196 of file RotationZYX.h.

◆ SetTheta()

void ROOT::Math::RotationZYX::SetTheta ( Scalar  theta)
inline

Set Theta angle (Y' rotation angle)

Definition at line 186 of file RotationZYX.h.

◆ Theta()

Scalar ROOT::Math::RotationZYX::Theta ( ) const
inline

Return Theta angle (Y' rotation angle)

Definition at line 191 of file RotationZYX.h.

Member Data Documentation

◆ fPhi

double ROOT::Math::RotationZYX::fPhi
private

Definition at line 317 of file RotationZYX.h.

◆ fPsi

double ROOT::Math::RotationZYX::fPsi
private

Definition at line 319 of file RotationZYX.h.

◆ fTheta

double ROOT::Math::RotationZYX::fTheta
private

Definition at line 318 of file RotationZYX.h.

Libraries for ROOT::Math::RotationZYX:

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