16 #ifndef ROOT_Math_GenVector_Quaternion
17 #define ROOT_Math_GenVector_Quaternion 1
77 template <
class OtherRotation>
98 template <
class OtherRotation>
187 return XYZVector ( alpha * v.
X() + twoU * (
fJ*v.
Z() - fK*v.
Y()) + twoQv *
fI ,
188 alpha * v.
Y() + twoU * (fK*v.
X() - fI*v.
Z()) + twoQv *
fJ ,
189 alpha * v.
Z() + twoU * (fI*v.
Y() - fJ*v.
X()) + twoQv * fK );
195 template <
class CoordSystem,
class Tag>
201 vNew.
SetXYZ( rxyz.
X(), rxyz.
Y(), rxyz.
Z() );
208 template <
class CoordSystem,
class Tag>
219 template <
class CoordSystem>
233 template <
class ForeignVector>
238 return ForeignVector ( rxyz.
X(), rxyz.
Y(), rxyz.
Z() );
244 template <
class AVector>
307 if(
fU != rhs.
fU )
return false;
308 if(
fI != rhs.
fI )
return false;
309 if(
fJ != rhs.
fJ )
return false;
310 if(
fK != rhs.
fK )
return false;
354 #endif // ROOT_Math_GenVector_Quaternion
void GetComponents(IT begin) const
Get the components into data specified by an iterator begin.
Quaternion Inverse() const
Return inverse of a rotation.
Scalar E() const
return 4-th component (time, or energy for a 4-momentum vector)
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
double dist(Rotation3D const &r1, Rotation3D const &r2)
DisplacementVector3D< CoordSystem, Tag > & SetXYZ(Scalar a, Scalar b, Scalar c)
set the values of the vector from the cartesian components (x,y,z) (if the vector is held in polar or...
::ROOT::Math::DisplacementVector3D< Cartesian3D< Scalar > > Vect() const
get the spatial components of the Vector in a DisplacementVector based on Cartesian Coordinates ...
Rotation class representing a 3D rotation about the Z axis by the angle of rotation.
XYZVector operator()(const XYZVector &v) const
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
AVector operator*(const AVector &v) const
Overload operator * for rotation on a vector.
Class describing a generic position vector (point) in 3 dimensions.
Rotation class with the (3D) rotation represented by angles describing first a rotation of an angle p...
Quaternion & operator=(OtherRotation const &r)
Assign from another supported rotation type (see gv_detail::convert )
bool operator==(const Quaternion &rhs) const
Equality/inequality operators.
Rotation class with the (3D) rotation represented by a unit quaternion (u, i, j, k).
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
AxisAngle class describing rotation represented with direction axis (3D Vector) and an angle of rotat...
Rotation class representing a 3D rotation about the Y axis by the angle of rotation.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
void GetComponents(Scalar &u, Scalar &i, Scalar &j, Scalar &k) const
Get the components into four Scalars.
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 dat...
Quaternion(const OtherRotation &r)
Construct from another supported rotation type (see gv_detail::convert )
void SetComponents(Scalar u, Scalar i, Scalar j, Scalar k)
Set the components based on four Scalars.
Class describing a generic displacement vector in 3 dimensions.
Quaternion(Scalar u, Scalar i, Scalar j, Scalar k)
Construct from four Scalars representing the coefficients of u, i, j, k.
unsigned int r1[N_CITIES]
Rotation class representing a 3D rotation about the X axis by the angle of rotation.
Rotation class with the (3D) rotation represented by a 3x3 orthogonal matrix.
Scalar U() const
Access to the four quaternion components: U() is the coefficient of the identity Pauli matrix...
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
Rotation operation on a cartesian vector.
void convert(R1 const &, R2 const)
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
EulerAngles class describing rotation as three angles (Euler Angles).
Scalar Distance(const Quaternion &q) const
Distance between two rotations in Quaternion form Note: The rotation group is isomorphic to a 3-spher...
bool operator!=(const Quaternion &rhs) const
void Rectify()
Re-adjust components to eliminate small deviations from |Q| = 1 orthonormality.
Quaternion & operator*=(const R &r)
Post-Multiply (on right) by another rotation : T = T*R.
void Invert()
Invert a rotation in place.
DefaultCoordinateSystemTag Default tag for identifying any coordinate system.
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...
Quaternion()
Default constructor (identity rotation)
unsigned int r2[N_CITIES]
Quaternion(IT begin, IT end)
Construct given a pair of pointers or iterators defining the beginning and end of an array of four Sc...