ROOT 6.12/07 Reference Guide |
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.
Definition at line 47 of file Quaternion.h.
Public Types | |
typedef double | Scalar |
typedef DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > | XYZVector |
Rotation operation on a cartesian vector. More... | |
Public Member Functions | |
Quaternion () | |
Default constructor (identity rotation) More... | |
template<class IT > | |
Quaternion (IT begin, IT end) | |
Construct given a pair of pointers or iterators defining the beginning and end of an array of four Scalars. More... | |
template<class OtherRotation > | |
Quaternion (const OtherRotation &r) | |
Construct from another supported rotation type (see gv_detail::convert ) More... | |
Quaternion (Scalar u, Scalar i, Scalar j, Scalar k) | |
Construct from four Scalars representing the coefficients of u, i, j, k. More... | |
Scalar | Distance (const 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. More... | |
template<class IT > | |
void | GetComponents (IT begin, IT end) const |
Get the components into data specified by an iterator begin and another to the end of the desired data (4 past start). More... | |
template<class IT > | |
void | GetComponents (IT begin) const |
Get the components into data specified by an iterator begin. More... | |
void | GetComponents (Scalar &u, Scalar &i, Scalar &j, Scalar &k) const |
Get the components into four Scalars. More... | |
Scalar | I () const |
Quaternion | Inverse () const |
Return inverse of a rotation. More... | |
void | Invert () |
Invert a rotation in place. More... | |
Scalar | J () const |
Scalar | K () const |
bool | operator!= (const Quaternion &rhs) const |
XYZVector | operator() (const XYZVector &v) const |
template<class CoordSystem , class Tag > | |
DisplacementVector3D< CoordSystem, Tag > | operator() (const DisplacementVector3D< CoordSystem, Tag > &v) const |
Rotation operation on a displacement vector in any coordinate system. More... | |
template<class CoordSystem , class Tag > | |
PositionVector3D< CoordSystem, Tag > | operator() (const PositionVector3D< CoordSystem, Tag > &p) const |
Rotation operation on a position vector in any coordinate system. More... | |
template<class CoordSystem > | |
LorentzVector< CoordSystem > | operator() (const LorentzVector< CoordSystem > &v) const |
Rotation operation on a Lorentz vector in any 4D coordinate system. More... | |
template<class ForeignVector > | |
ForeignVector | operator() (const ForeignVector &v) const |
Rotation operation on an arbitrary vector v. More... | |
template<class AVector > | |
AVector | operator* (const AVector &v) const |
Overload operator * for rotation on a vector. More... | |
Quaternion | operator* (const Quaternion &q) const |
Multiply (combine) two rotations. More... | |
Quaternion | operator* (const Rotation3D &r) const |
Quaternion | operator* (const AxisAngle &a) const |
Quaternion | operator* (const EulerAngles &e) const |
Quaternion | operator* (const RotationZYX &r) const |
Quaternion | operator* (const RotationX &rx) const |
Quaternion | operator* (const RotationY &ry) const |
Quaternion | operator* (const RotationZ &rz) const |
template<class R > | |
Quaternion & | operator*= (const R &r) |
Post-Multiply (on right) by another rotation : T = T*R. More... | |
template<class OtherRotation > | |
Quaternion & | operator= (OtherRotation const &r) |
Assign from another supported rotation type (see gv_detail::convert ) More... | |
bool | operator== (const Quaternion &rhs) const |
Equality/inequality operators. More... | |
void | Rectify () |
Re-adjust components to eliminate small deviations from |Q| = 1 orthonormality. More... | |
template<class IT > | |
void | SetComponents (IT begin, IT end) |
Set the four components given an iterator to the start of the desired data, and another to the end (4 past start). More... | |
void | SetComponents (Scalar u, Scalar i, Scalar j, Scalar k) |
Set the components based on four Scalars. More... | |
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. More... | |
Private Attributes | |
Scalar | fI |
Scalar | fJ |
Scalar | fK |
Scalar | fU |
#include <Math/GenVector/Quaternion.h>
typedef double ROOT::Math::Quaternion::Scalar |
Definition at line 51 of file Quaternion.h.
typedef DisplacementVector3D<Cartesian3D<double>, DefaultCoordinateSystemTag > ROOT::Math::Quaternion::XYZVector |
Rotation operation on a cartesian vector.
Definition at line 181 of file Quaternion.h.
|
inline |
Default constructor (identity rotation)
Definition at line 58 of file Quaternion.h.
|
inline |
Construct given a pair of pointers or iterators defining the beginning and end of an array of four Scalars.
Definition at line 70 of file Quaternion.h.
|
inlineexplicit |
Construct from another supported rotation type (see gv_detail::convert )
Definition at line 78 of file Quaternion.h.
Construct from four Scalars representing the coefficients of u, i, j, k.
Definition at line 84 of file Quaternion.h.
Quaternion::Scalar ROOT::Math::Quaternion::Distance | ( | const 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.
Definition at line 92 of file Quaternion.cxx.
|
inline |
Get the components into data specified by an iterator begin and another to the end of the desired data (4 past start).
Definition at line 129 of file Quaternion.h.
|
inline |
Get the components into data specified by an iterator begin.
Definition at line 144 of file Quaternion.h.
|
inline |
Get the components into four Scalars.
Definition at line 162 of file Quaternion.h.
|
inline |
Definition at line 172 of file Quaternion.h.
|
inline |
Return inverse of a rotation.
Definition at line 259 of file Quaternion.h.
|
inline |
Invert a rotation in place.
Definition at line 254 of file Quaternion.h.
|
inline |
Definition at line 173 of file Quaternion.h.
|
inline |
Definition at line 174 of file Quaternion.h.
|
inline |
Definition at line 313 of file Quaternion.h.
Definition at line 182 of file Quaternion.h.
|
inline |
Rotation operation on a displacement vector in any coordinate system.
Definition at line 197 of file Quaternion.h.
|
inline |
Rotation operation on a position vector in any coordinate system.
Definition at line 210 of file Quaternion.h.
|
inline |
Rotation operation on a Lorentz vector in any 4D coordinate system.
Definition at line 221 of file Quaternion.h.
|
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 235 of file Quaternion.h.
|
inline |
Overload operator * for rotation on a vector.
Definition at line 246 of file Quaternion.h.
|
inline |
Multiply (combine) two rotations.
Multiply (combine) two rotations
Definition at line 269 of file Quaternion.h.
Quaternion ROOT::Math::Quaternion::operator* | ( | const Rotation3D & | r | ) | const |
Definition at line 72 of file Quaternion.cxx.
Quaternion ROOT::Math::Quaternion::operator* | ( | const AxisAngle & | a | ) | const |
Definition at line 77 of file Quaternion.cxx.
Quaternion ROOT::Math::Quaternion::operator* | ( | const EulerAngles & | e | ) | const |
Definition at line 82 of file Quaternion.cxx.
Quaternion ROOT::Math::Quaternion::operator* | ( | const RotationZYX & | r | ) | const |
Definition at line 87 of file Quaternion.cxx.
Quaternion ROOT::Math::Quaternion::operator* | ( | const RotationX & | rx | ) | const |
Definition at line 29 of file QuaternionXaxial.cxx.
Quaternion ROOT::Math::Quaternion::operator* | ( | const RotationY & | ry | ) | const |
Definition at line 40 of file QuaternionXaxial.cxx.
Quaternion ROOT::Math::Quaternion::operator* | ( | const RotationZ & | rz | ) | const |
Definition at line 51 of file QuaternionXaxial.cxx.
|
inline |
Post-Multiply (on right) by another rotation : T = T*R.
Definition at line 288 of file Quaternion.h.
|
inline |
Assign from another supported rotation type (see gv_detail::convert )
Definition at line 99 of file Quaternion.h.
|
inline |
Equality/inequality operators.
Definition at line 306 of file Quaternion.h.
void ROOT::Math::Quaternion::Rectify | ( | ) |
Re-adjust components to eliminate small deviations from |Q| = 1 orthonormality.
Definition at line 35 of file Quaternion.cxx.
|
inline |
Set the four components given an iterator to the start of the desired data, and another to the end (4 past start).
Definition at line 112 of file Quaternion.h.
Set the components based on four Scalars.
The sum of the squares of these Scalars should be 1; no checking is done.
Definition at line 155 of file Quaternion.h.
|
inline |
|
private |
Definition at line 320 of file Quaternion.h.
|
private |
Definition at line 321 of file Quaternion.h.
|
private |
Definition at line 322 of file Quaternion.h.
|
private |
Definition at line 319 of file Quaternion.h.