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::Scalar | Distance(const ROOT::Math::Quaternion& q) const |
void | GetComponents(ROOT::Math::Quaternion::Scalar& u, ROOT::Math::Quaternion::Scalar& i, ROOT::Math::Quaternion::Scalar& j, ROOT::Math::Quaternion::Scalar& k) const |
ROOT::Math::Quaternion::Scalar | I() const |
ROOT::Math::Quaternion | Inverse() const |
void | Invert() |
ROOT::Math::Quaternion::Scalar | J() const |
ROOT::Math::Quaternion::Scalar | K() const |
bool | operator!=(const ROOT::Math::Quaternion& rhs) const |
ROOT::Math::Quaternion::XYZVector | operator()(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::Quaternion | operator*(const ROOT::Math::Quaternion& q) const |
ROOT::Math::Quaternion | operator*(const ROOT::Math::Rotation3D& r) const |
ROOT::Math::Quaternion | operator*(const ROOT::Math::AxisAngle& a) const |
ROOT::Math::Quaternion | operator*(const ROOT::Math::EulerAngles& e) const |
ROOT::Math::Quaternion | operator*(const ROOT::Math::RotationZYX& r) const |
ROOT::Math::Quaternion | operator*(const ROOT::Math::RotationX& rx) const |
ROOT::Math::Quaternion | operator*(const ROOT::Math::RotationY& ry) const |
ROOT::Math::Quaternion | operator*(const ROOT::Math::RotationZ& rz) const |
ROOT::Math::Quaternion& | operator=(const ROOT::Math::Quaternion&) |
ROOT::Math::Quaternion& | operator=(ROOT::Math::Quaternion&&) |
bool | operator==(const ROOT::Math::Quaternion& rhs) const |
ROOT::Math::Quaternion | Quaternion() |
ROOT::Math::Quaternion | Quaternion(const ROOT::Math::Quaternion&) |
ROOT::Math::Quaternion | Quaternion(ROOT::Math::Quaternion&&) |
ROOT::Math::Quaternion | Quaternion(ROOT::Math::Quaternion::Scalar u, ROOT::Math::Quaternion::Scalar i, ROOT::Math::Quaternion::Scalar j, ROOT::Math::Quaternion::Scalar k) |
void | Rectify() |
void | SetComponents(ROOT::Math::Quaternion::Scalar u, ROOT::Math::Quaternion::Scalar i, ROOT::Math::Quaternion::Scalar j, ROOT::Math::Quaternion::Scalar k) |
ROOT::Math::Quaternion::Scalar | U() const |
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
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);}
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
AVector operator*(const AVector & v)
Overload operator * for rotation on a vector
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.