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(double* begin) 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::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::PositionVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::DefaultCoordinateSystemTag> | operator*(const ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::DefaultCoordinateSystemTag>& v) const |
ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::DefaultCoordinateSystemTag> | operator*(const ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::DefaultCoordinateSystemTag>& v) const |
ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > | operator*(const ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >& v) const |
ROOT::Math::Quaternion& | operator=(ROOT::Math::Rotation3D const& r) |
ROOT::Math::Quaternion& | operator=(ROOT::Math::AxisAngle const& r) |
ROOT::Math::Quaternion& | operator=(ROOT::Math::EulerAngles const& r) |
ROOT::Math::Quaternion& | operator=(ROOT::Math::RotationZYX const& r) |
ROOT::Math::Quaternion& | operator=(ROOT::Math::RotationX const& r) |
ROOT::Math::Quaternion& | operator=(ROOT::Math::RotationY const& r) |
ROOT::Math::Quaternion& | operator=(ROOT::Math::RotationZ const& r) |
ROOT::Math::Quaternion& | operator=(const 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::Scalar u, ROOT::Math::Quaternion::Scalar i, ROOT::Math::Quaternion::Scalar j, ROOT::Math::Quaternion::Scalar k) |
void | Rectify() |
void | SetComponents(double* begin, double* end) |
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 ROOT::Math::Quaternion& )
======== 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(double* begin, double* 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).
void GetComponents(double* begin) const
Get the components into data specified by an iterator begin
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.