ROOT » MATH » GENVECTOR » ROOT::Math::Quaternion

class ROOT::Math::Quaternion


      Rotation class with the (3D) rotation represented by
      a unit quaternion (u, i, j, k).
      This is the optimal representation for multiplication of multiple
      rotations, and for computation of group-manifold-invariant distance
      between two rotations.
      See also ROOT::Math::AxisAngle, ROOT::Math::EulerAngles, and ROOT::Math::Rotation3D.

      @ingroup GenVector

Function Members (Methods)

public:
~Quaternion()
ROOT::Math::Quaternion::ScalarDistance(const ROOT::Math::Quaternion& q) const
voidGetComponents(ROOT::Math::Quaternion::Scalar& u, ROOT::Math::Quaternion::Scalar& i, ROOT::Math::Quaternion::Scalar& j, ROOT::Math::Quaternion::Scalar& k) const
ROOT::Math::Quaternion::ScalarI() const
ROOT::Math::QuaternionInverse() const
voidInvert()
ROOT::Math::Quaternion::ScalarJ() const
ROOT::Math::Quaternion::ScalarK() const
booloperator!=(const ROOT::Math::Quaternion& rhs) const
ROOT::Math::Quaternion::XYZVectoroperator()(const ROOT::Math::Quaternion::XYZVector& v) const
ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::DefaultCoordinateSystemTag>operator()<ROOT::Math::Cartesian3D<double>, ROOT::Math::DefaultCoordinateSystemTag>(const ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::DefaultCoordinateSystemTag>& v) const
ROOT::Math::DisplacementVector3D<Cartesian3D<double>,DefaultCoordinateSystemTag>operator()<ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>, ROOT::Math::DefaultCoordinateSystemTag> >(const ROOT::Math::DisplacementVector3D<Cartesian3D<double>,DefaultCoordinateSystemTag>& v) const
ROOT::Math::Quaternionoperator*(const ROOT::Math::Quaternion& q) const
ROOT::Math::Quaternionoperator*(const ROOT::Math::Rotation3D& r) const
ROOT::Math::Quaternionoperator*(const ROOT::Math::AxisAngle& a) const
ROOT::Math::Quaternionoperator*(const ROOT::Math::EulerAngles& e) const
ROOT::Math::Quaternionoperator*(const ROOT::Math::RotationZYX& r) const
ROOT::Math::Quaternionoperator*(const ROOT::Math::RotationX& rx) const
ROOT::Math::Quaternionoperator*(const ROOT::Math::RotationY& ry) const
ROOT::Math::Quaternionoperator*(const ROOT::Math::RotationZ& rz) const
ROOT::Math::Quaternion&operator=(const ROOT::Math::Quaternion&)
ROOT::Math::Quaternion&operator=(ROOT::Math::Quaternion&&)
booloperator==(const ROOT::Math::Quaternion& rhs) const
ROOT::Math::QuaternionQuaternion()
ROOT::Math::QuaternionQuaternion(const ROOT::Math::Quaternion&)
ROOT::Math::QuaternionQuaternion(ROOT::Math::Quaternion&&)
ROOT::Math::QuaternionQuaternion(ROOT::Math::Quaternion::Scalar u, ROOT::Math::Quaternion::Scalar i, ROOT::Math::Quaternion::Scalar j, ROOT::Math::Quaternion::Scalar k)
voidRectify()
voidSetComponents(ROOT::Math::Quaternion::Scalar u, ROOT::Math::Quaternion::Scalar i, ROOT::Math::Quaternion::Scalar j, ROOT::Math::Quaternion::Scalar k)
ROOT::Math::Quaternion::ScalarU() const

Data Members

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

Quaternion()
 ========== Constructors and Assignment =====================

      Default constructor (identity rotation)

{ }
Quaternion(IT begin, IT end)
      Construct given a pair of pointers or iterators defining the
      beginning and end of an array of four Scalars

{ SetComponents(begin,end); }
explicit Quaternion(const OtherRotation & r)
 ======== Construction From other Rotation Forms ==================

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

{gv_detail::convert(r,*this);}
Quaternion(ROOT::Math::Quaternion::Scalar u, ROOT::Math::Quaternion::Scalar i, ROOT::Math::Quaternion::Scalar j, ROOT::Math::Quaternion::Scalar k)
      Construct from four Scalars representing the coefficients of u, i, j, k

{ }
void Rectify()
 The compiler-generated copy ctor, copy assignment, and dtor are OK.

      Re-adjust components to eliminate small deviations from |Q| = 1
      orthonormality.

Quaternion & operator=( OtherRotation const & r )
      Assign from another supported rotation type (see gv_detail::convert )

void SetComponents(IT begin, IT end)
 ======== Components ==============

      Set the four components given an iterator to the start of
      the desired data, and another to the end (4 past start).

void GetComponents(IT begin, IT end)
      Get the components into data specified by an iterator begin
      and another to the end of the desired data (4 past start).

Scalar U() const
      Access to the four quaternion components:
      U() is the coefficient of the identity Pauli matrix,
      I(), J() and K() are the coefficients of sigma_x, sigma_y, sigma_z

{ return fU; }
Scalar I() const
{ return fI; }
Scalar J() const
{ return fJ; }
Scalar K() const
{ return fK; }
XYZVector operator()(const ROOT::Math::Quaternion::XYZVector& v) const
AVector operator*(const AVector & v)
      Overload operator * for rotation on a vector

void Invert()
      Invert a rotation in place

{ fI = -fI; fJ = -fJ; fK = -fK; }
Quaternion Inverse() const
      Return inverse of a rotation

{ return Quaternion(fU, -fI, -fJ, -fK); }
Scalar Distance(const ROOT::Math::Quaternion& q) const
      Distance between two rotations in Quaternion form
      Note:  The rotation group is isomorphic to a 3-sphere
      with diametrically opposite points identified.
      The (rotation group-invariant) is the smaller
      of the two possible angles between the images of
      the two totations on that sphere.  Thus the distance
      is never greater than pi/2.

return ! operator==(rhs)
Quaternion operator*(RotationX const & r1, Quaternion const & r2)
   Multiplication of an axial rotation by an AxisAngle

Quaternion operator*(RotationY const & r1, Quaternion const & r2)
Quaternion operator*(RotationZ const & r1, Quaternion const & r2)