16 #ifndef ROOT_Math_GenVector_Quaternion 17 #define ROOT_Math_GenVector_Quaternion 1 77 template <
class OtherRotation>
98 template <
class OtherRotation>
171 Scalar
U()
const {
return fU; }
172 Scalar
I()
const {
return fI; }
173 Scalar
J()
const {
return fJ; }
174 Scalar
K()
const {
return fK; }
185 const Scalar twoQv = 2*(
fI*v.
X() +
fJ*v.
Y() + fK*v.
Z());
186 const Scalar twoU = 2 *
fU;
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 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...
Namespace for new ROOT classes and functions.
Rotation class representing a 3D rotation about the Z axis by the angle of rotation.
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 )
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...
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
Quaternion Inverse() const
Return inverse of a rotation.
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...
Rotation class representing a 3D rotation about the Y axis by the angle of rotation.
Scalar U() const
Access to the four quaternion components: U() is the coefficient of the identity Pauli matrix...
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Scalar E() const
return 4-th component (time, or energy for a 4-momentum vector)
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.
void GetComponents(Scalar &u, Scalar &i, Scalar &j, Scalar &k) const
Get the components into four Scalars.
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.
void GetComponents(IT begin) const
Get the components into data specified by an iterator begin.
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
Rotation operation on a cartesian vector.
void convert(R1 const &, R2 const)
EulerAngles class describing rotation as three angles (Euler Angles).
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Namespace for new Math classes and functions.
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.
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
Equality/inequality operators.
DefaultCoordinateSystemTag Default tag for identifying any coordinate system.
constexpr Double_t R()
Universal gas constant ( ) in
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)
::ROOT::Math::DisplacementVector3D< Cartesian3D< Scalar > > Vect() const
get the spatial components of the Vector in a DisplacementVector based on Cartesian Coordinates ...
AVector operator*(const AVector &v) const
Overload operator * for rotation on a vector.
XYZVector operator()(const XYZVector &v) const
Quaternion(IT begin, IT end)
Construct given a pair of pointers or iterators defining the beginning and end of an array of four Sc...