102 fRealPart(
q.fRealPart), fVectorPart(
q.fVectorPart) {}
105 : fRealPart(real), fVectorPart(vect) {}
108 : fRealPart(x0[3]), fVectorPart(x0) {}
111 : fRealPart(x0[3]), fVectorPart(x0) {}
114 : fRealPart(real), fVectorPart(X,Y,Z) {}
130 Error(
"operator()(i)",
"bad index (%d) returning 0",i);
147 Error(
"operator()(i)",
"bad index (%d) returning &fRealPart",i);
181 double norm =
v.
Mag();
220 Error(
"operator/(Double_t)",
"bad value (%f) ignored",real);
293 (*this) *= -(1./norm2);
295 Error(
"DivideLeft(const TVector3)",
"bad norm2 (%f) ignored",norm2);
308 (*this) *= - (1./norm2);
310 Error(
"operator/=(const TVector3 &)",
"bad norm2 (%f) ignored",norm2);
322 double invNorm2 = 1./norm2;
326 Error(
"LeftQuotient(const TVector3 &)",
"bad norm2 (%f) ignored",norm2);
338 double invNorm2 = 1./norm2;
342 Error(
"operator/(const TVector3 &)",
"bad norm2 (%f) ignored",norm2);
417 (*this) *= (1./norm2);
419 Error(
"DivideLeft(const TQuaternion &)",
"bad norm2 (%f) ignored",norm2);
433 (*this) *= (1./norm2);
435 Error(
"operator/=(const TQuaternion&)",
"bad norm2 (%f) ignored",norm2);
447 double invNorm2 = 1./norm2;
453 Error(
"LeftQuotient(const TQuaternion&)",
"bad norm2 (%f) ignored",norm2);
465 double invNorm2 = 1./norm2;
471 Error(
"operator/(const TQuaternion &)",
"bad norm2 (%f) ignored",norm2);
480 double norm2 =
Norm2();
482 double invNorm2 = 1./norm2;
485 Error(
"Invert()",
"bad norm2 (%f) ignored",norm2);
502 double norm2 =
Norm2();
519 Error(
"Rotation()",
"bad norm2 (%f) ignored",norm2);
529 Printf(
"%s %s (r,x,y,z)=(%f,%f,%f,%f) \n (alpha,rho,theta,phi)=(%f,%f,%f,%f)",
GetName(),
GetTitle(),
TQuaternion operator*(Double_t r, const TQuaternion &q)
TQuaternion operator+(Double_t r, const TQuaternion &q)
TQuaternion operator-(Double_t r, const TQuaternion &q)
TQuaternion operator/(Double_t r, const TQuaternion &q)
void Printf(const char *fmt,...)
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
Quaternion is a 4-component mathematic object quite convenient when dealing with space rotation (or r...
TQuaternion & MultiplyLeft(const TVector3 &vector)
left multiplication
TQuaternion LeftQuotient(const TVector3 &vector) const
left quotient
TQuaternion operator*(Double_t real) const
product of quaternion with a real
TQuaternion(Double_t real=0, Double_t X=0, Double_t Y=0, Double_t Z=0)
void Rotate(TVector3 &vect) const
rotate vect by current quaternion
Double_t operator()(int) const
dereferencing operator const
TQuaternion & DivideLeft(const TVector3 &vector)
left division
void Print(Option_t *option="") const
Print Quaternion parameters.
TQuaternion operator+(Double_t real) const
sum of quaternion with a real
TQuaternion LeftProduct(const TVector3 &vector) const
left product
TQuaternion & operator/=(Double_t real)
TQuaternion & operator*=(Double_t real)
TQuaternion & SetQAngle(Double_t angle)
Set angle of quaternion (rad) - keep quaternion norm N.B : this angle is half of the corresponding ro...
TQuaternion operator/(Double_t real) const
division by a real
TQuaternion Invert() const
invert
TVector3 Rotation(const TVector3 &vect) const
rotation of vect by current quaternion
TQuaternion operator-() const
TQuaternion & SetAxisQAngle(TVector3 &v, Double_t QAngle)
set quaternion from vector and angle (rad) quaternion is set as unitary N.B : this angle is half of t...
TQuaternion Conjugate() const
Double_t GetQAngle() const
Get angle of quaternion (rad) N.B : this angle is half of the corresponding rotation angle.
TVector3 is a general three vector class, which can be used for the description of different vectors ...
Double_t Phi() const
Return the azimuth angle. Returns phi from -pi to pi.
Double_t Theta() const
Return the polar angle.
TVector3 Cross(const TVector3 &) const
constexpr Double_t PiOver2()
constexpr Double_t RadToDeg()
Conversion from radian to degree: