106 fRealPart(q.fRealPart), fVectorPart(q.fVectorPart) {}
109 : fRealPart(real), fVectorPart(vect) {}
112 : fRealPart(x0[3]), fVectorPart(x0) {}
115 : fRealPart(x0[3]), fVectorPart(x0) {}
118 : fRealPart(real), fVectorPart(X,Y,Z) {}
134 Error(
"operator()(i)",
"bad index (%d) returning 0",i);
151 Error(
"operator()(i)",
"bad index (%d) returning &fRealPart",i);
224 Error(
"operator/(Double_t)",
"bad value (%f) ignored",real);
297 (*this) *= -(1./norm2);
299 Error(
"DivideLeft(const TVector3)",
"bad norm2 (%f) ignored",norm2);
312 (*this) *= - (1./norm2);
314 Error(
"operator/=(const TVector3 &)",
"bad norm2 (%f) ignored",norm2);
326 double invNorm2 = 1./norm2;
330 Error(
"LeftQuotient(const TVector3 &)",
"bad norm2 (%f) ignored",norm2);
342 double invNorm2 = 1./norm2;
346 Error(
"operator/(const TVector3 &)",
"bad norm2 (%f) ignored",norm2);
421 (*this) *= (1./norm2);
423 Error(
"DivideLeft(const TQuaternion &)",
"bad norm2 (%f) ignored",norm2);
437 (*this) *= (1./norm2);
439 Error(
"operator/=(const TQuaternion&)",
"bad norm2 (%f) ignored",norm2);
451 double invNorm2 = 1./norm2;
457 Error(
"LeftQuotient(const TQuaternion&)",
"bad norm2 (%f) ignored",norm2);
469 double invNorm2 = 1./norm2;
475 Error(
"operator/(const TQuaternion &)",
"bad norm2 (%f) ignored",norm2);
484 double norm2 =
Norm2();
486 double invNorm2 = 1./norm2;
489 Error(
"Invert()",
"bad norm2 (%f) ignored",norm2);
506 double norm2 =
Norm2();
523 Error(
"Rotation()",
"bad norm2 (%f) ignored",norm2);
533 Printf(
"%s %s (r,x,y,z)=(%f,%f,%f,%f) \n (alpha,rho,theta,phi)=(%f,%f,%f,%f)",
GetName(),
GetTitle(),
Double_t Phi() const
return the azimuth angle. returns phi from -pi to pi
TQuaternion LeftQuotient(const TVector3 &vector) const
left quotient
TVector3 cross(const TVector3 &v1, const TVector3 &v2)
Double_t Theta() const
return the polar angle
TQuaternion operator-() const
TQuaternion operator*(Double_t real) const
product of quaternion with a real
TQuaternion operator+(Double_t real) const
sum of quaternion with a real
void Rotate(TVector3 &vect) const
rotate vect by current quaternion
TQuaternion & SetQAngle(Double_t angle)
Set angle of quaternion (rad) - keep quaternion norm N.B : this angle is half of the corresponding ro...
Double_t Mag() const
return the magnitude (rho in spherical coordinate system)
TQuaternion operator/(Double_t r, const TQuaternion &q)
TQuaternion & operator/=(Double_t real)
TQuaternion operator/(Double_t real) const
division by a real
TQuaternion LeftProduct(const TVector3 &vector) const
left product
TQuaternion & DivideLeft(const TVector3 &vector)
left division
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void Print(Option_t *option="") const
Print Quaternion parameters.
TQuaternion operator+(Double_t r, const TQuaternion &q)
TQuaternion & operator*=(Double_t real)
TQuaternion Conjugate() const
TQuaternion(Double_t real=0, Double_t X=0, Double_t Y=0, Double_t Z=0)
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...
Double_t operator()(int) const
dereferencing operator const
TQuaternion operator-(Double_t r, const TQuaternion &q)
TQuaternion & MultiplyLeft(const TVector3 &vector)
left multitplication
TVector3 Rotation(const TVector3 &vect) const
rotation of vect by current quaternion
virtual const char * GetName() const
Returns name of object.
Double_t GetQAngle() const
Get angle of quaternion (rad) N.B : this angle is half of the corresponding rotation angle...
ClassImp(TQuaternion) TQuaternion
Mother of all ROOT objects.
TQuaternion Invert() const
invert
TVector3 Cross(const TVector3 &) const
std::complex< float_v > Z
virtual const char * GetTitle() const
Returns title of object.
double norm(double *x, double *p)
TQuaternion operator*(Double_t r, const TQuaternion &q)