Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TRotation.cxx
Go to the documentation of this file.
1// @(#)root/physics:$Id$
2// Author: Peter Malzacher 19/06/99
3
4/** \class TRotation
5 \legacy{TRotation, Consider using instead ROOT::Math::Rotation3D.}
6 \ingroup Physics
7
8The TRotation class describes a rotation of objects of the TVector3 class.
9It is a 3*3 matrix of Double_t:
10
11~~~
12| xx xy xz |
13| yx yy yz |
14| zx zy zz |
15~~~
16
17It describes a so called active rotation, i.e. rotation of objects inside
18a static system of coordinates. In case you want to rotate the frame and
19want to know the coordinates of objects in the rotated system, you should
20apply the inverse rotation to the objects. If you want to transform coordinates
21from the rotated frame to the original frame you have to apply the direct
22transformation.
23
24A rotation around a specified axis means counterclockwise rotation around
25the positive direction of the axis.
26
27
28### Declaration, Access, Comparisons
29
30~~~
31 TRotation r; // r initialized as identity
32 TRotation m(r); // m = r
33~~~
34
35There is no direct way to set the matrix elements - to ensure that
36a TRotation object always describes a real rotation. But you can get the
37values by the member functions XX()..ZZ() or the (,)
38operator:
39
40~~~
41 Double_t xx = r.XX(); // the same as xx=r(0,0)
42 xx = r(0,0);
43
44 if (r==m) {...} // test for equality
45 if (r!=m) {..} // test for inequality
46 if (r.IsIdentity()) {...} // test for identity
47~~~
48
49### Rotation around axes
50The following matrices describe counterclockwise rotations around coordinate
51axes
52
53~~~
54 | 1 0 0 |
55Rx(a) = | 0 cos(a) -sin(a) |
56 | 0 sin(a) cos(a) |
57
58 | cos(a) 0 sin(a) |
59Ry(a) = | 0 1 0 |
60 | -sin(a) 0 cos(a) |
61
62 | cos(a) -sin(a) 0 |
63Rz(a) = | sin(a) cos(a) 0 |
64 | 0 0 1 |
65~~~
66
67and are implemented as member functions RotateX(), RotateY() and RotateZ():
68
69~~~
70 r.RotateX(TMath::Pi()); // rotation around the x-axis
71~~~
72
73### Rotation around arbitrary axis
74The member function Rotate() allows to rotate around an arbitrary vector
75(not necessary a unit one) and returns the result.
76
77~~~
78 r.Rotate(TMath::Pi()/3,TVector3(3,4,5));
79~~~
80
81It is possible to find a unit vector and an angle, which describe the
82same rotation as the current one:
83
84~~~
85 Double_t angle;
86 TVector3 axis;
87 r.GetAngleAxis(angle,axis);
88~~~
89
90### Rotation of local axes
91Member function RotateAxes() adds a rotation of local axes to
92the current rotation and returns the result:
93
94~~~
95 TVector3 newX(0,1,0);
96 TVector3 newY(0,0,1);
97 TVector3 newZ(1,0,0);
98 a.RotateAxes(newX,newY,newZ);
99~~~
100
101Member functions ThetaX(), ThetaY(), ThetaZ(),
102PhiX(), PhiY(),PhiZ() return azimuth and polar
103angles of the rotated axes:
104
105~~~
106 Double_t tx,ty,tz,px,py,pz;
107 tx= a.ThetaX();
108 ...
109 pz= a.PhiZ();
110~~~
111
112### Setting The Rotations
113The member function SetToIdentity() will set the rotation object
114to the identity (no rotation).
115
116With a minor caveat, the Euler angles of the rotation may be set using
117SetXEulerAngles() or individually set with SetXPhi(),
118SetXTheta(), and SetXPsi(). These routines set the Euler
119angles using the X-convention which is defined by a rotation about the Z-axis,
120about the new X-axis, and about the new Z-axis. This is the convention used
121in Landau and Lifshitz, Goldstein and other common physics texts. The
122Y-convention Euler angles can be set with SetYEulerAngles(),
123SetYPhi(), SetYTheta(), and SetYPsi(). The caveat
124is that Euler angles usually define the rotation of the new coordinate system
125with respect to the original system, however, the TRotation class specifies
126the rotation of the object in the original system (an active rotation). To
127recover the usual Euler rotations (ie. rotate the system not the object), you
128must take the inverse of the rotation.
129
130The member functions SetXAxis(), SetYAxis(), and
131SetZAxis() will create a rotation which rotates the requested axis
132of the object to be parallel to a vector. If used with one argument, the
133rotation about that axis is arbitrary. If used with two arguments, the
134second variable defines the XY, YZ, or ZX
135respectively.
136
137
138### Inverse rotation
139
140~~~
141 TRotation a,b;
142 ...
143 b = a.Inverse(); // b is inverse of a, a is unchanged
144 b = a.Invert(); // invert a and set b = a
145~~~
146
147### Compound Rotations
148The operator * has been implemented in a way that follows the
149mathematical notation of a product of the two matrices which describe the
150two consecutive rotations. Therefore the second rotation should be placed
151first:
152
153~~~
154 r = r2 * r1;
155~~~
156
157### Rotation of TVector3
158The TRotation class provides an operator * which allows to express
159a rotation of a TVector3 analog to the mathematical notation
160
161~~~
162 | x' | | xx xy xz | | x |
163 | y' | = | yx yy yz | | y |
164 | z' | | zx zy zz | | z |
165~~~
166
167e.g.:
168
169~~~
170 TVector3 v(1,1,1);
171 v = r * v;
172~~~
173
174You can also use the Transform() member function or the operator *= of the
175TVector3 class:
176
177~~~
178 TVector3 v;
179 TRotation r;
180 v.Transform(r);
181 v *= r; //Attention v = r * v
182~~~
183*/
184
185#include "TRotation.h"
186#include "TMath.h"
187#include "TQuaternion.h"
188#include <cmath>
189
191
192#define TOLERANCE (1.0E-6)
193
194////////////////////////////////////////////////////////////////////////////////
195/// Constructor.
196
198: fxx(1.0), fxy(0.0), fxz(0.0), fyx(0.0), fyy(1.0), fyz(0.0),
199 fzx(0.0), fzy(0.0), fzz(1.0) {}
200
201////////////////////////////////////////////////////////////////////////////////
202/// Constructor.
203
205 fxx(m.fxx), fxy(m.fxy), fxz(m.fxz), fyx(m.fyx), fyy(m.fyy), fyz(m.fyz),
206 fzx(m.fzx), fzy(m.fzy), fzz(m.fzz) {}
207
208////////////////////////////////////////////////////////////////////////////////
209/// Constructor.
210
214: fxx(mxx), fxy(mxy), fxz(mxz), fyx(myx), fyy(myy), fyz(myz),
215 fzx(mzx), fzy(mzy), fzz(mzz) {}
216
217////////////////////////////////////////////////////////////////////////////////
218/// Dereferencing operator const.
219
221 if (i == 0) {
222 if (j == 0) { return fxx; }
223 if (j == 1) { return fxy; }
224 if (j == 2) { return fxz; }
225 } else if (i == 1) {
226 if (j == 0) { return fyx; }
227 if (j == 1) { return fyy; }
228 if (j == 2) { return fyz; }
229 } else if (i == 2) {
230 if (j == 0) { return fzx; }
231 if (j == 1) { return fzy; }
232 if (j == 2) { return fzz; }
233 }
234
235 Warning("operator()(i,j)", "bad indices (%d , %d)",i,j);
236
237 return 0.0;
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Multiplication operator.
242
244 return TRotation(fxx*b.fxx + fxy*b.fyx + fxz*b.fzx,
245 fxx*b.fxy + fxy*b.fyy + fxz*b.fzy,
246 fxx*b.fxz + fxy*b.fyz + fxz*b.fzz,
247 fyx*b.fxx + fyy*b.fyx + fyz*b.fzx,
248 fyx*b.fxy + fyy*b.fyy + fyz*b.fzy,
249 fyx*b.fxz + fyy*b.fyz + fyz*b.fzz,
250 fzx*b.fxx + fzy*b.fyx + fzz*b.fzx,
251 fzx*b.fxy + fzy*b.fyy + fzz*b.fzy,
252 fzx*b.fxz + fzy*b.fyz + fzz*b.fzz);
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Constructor for a rotation based on a Quaternion
257/// if magnitude of quaternion is null, creates identity rotation
258/// if quaternion is non-unit, creates rotation corresponding to the normalized (unit) quaternion
259
261
262 double two_r2 = 2 * Q.fRealPart * Q.fRealPart;
263 double two_x2 = 2 * Q.fVectorPart.X() * Q.fVectorPart.X();
264 double two_y2 = 2 * Q.fVectorPart.Y() * Q.fVectorPart.Y();
265 double two_z2 = 2 * Q.fVectorPart.Z() * Q.fVectorPart.Z();
266 double two_xy = 2 * Q.fVectorPart.X() * Q.fVectorPart.Y();
267 double two_xz = 2 * Q.fVectorPart.X() * Q.fVectorPart.Z();
268 double two_xr = 2 * Q.fVectorPart.X() * Q.fRealPart;
269 double two_yz = 2 * Q.fVectorPart.Y() * Q.fVectorPart.Z();
270 double two_yr = 2 * Q.fVectorPart.Y() * Q.fRealPart;
271 double two_zr = 2 * Q.fVectorPart.Z() * Q.fRealPart;
272
273 // protect against zero quaternion
274 double mag2 = Q.QMag2();
275 if (mag2 > 0) {
276
277 // diago + identity
278 fxx = two_r2 + two_x2;
279 fyy = two_r2 + two_y2;
280 fzz = two_r2 + two_z2;
281
282 // line 0 column 1 and conjugate
283 fxy = two_xy - two_zr;
284 fyx = two_xy + two_zr;
285
286 // line 0 column 2 and conjugate
287 fxz = two_xz + two_yr;
288 fzx = two_xz - two_yr;
289
290 // line 1 column 2 and conjugate
291 fyz = two_yz - two_xr;
292 fzy = two_yz + two_xr;
293
294 // protect against non-unit quaternion
295 if (TMath::Abs(mag2-1) > 1e-10) {
296 fxx /= mag2;
297 fyy /= mag2;
298 fzz /= mag2;
299 fxy /= mag2;
300 fyx /= mag2;
301 fxz /= mag2;
302 fzx /= mag2;
303 fyz /= mag2;
304 fzy /= mag2;
305 }
306
307 // diago : remove identity
308 fxx -= 1;
309 fyy -= 1;
310 fzz -= 1;
311
312
313 } else {
314 // Identity
315
316 fxx = fyy = fzz = 1;
317 fxy = fyx = fxz = fzx = fyz = fzy = 0;
318
319 }
320
321}
322
323////////////////////////////////////////////////////////////////////////////////
324/// Rotate along an axis.
325
327 if (std::fmod(a, 2 * TMath::Pi()) != 0.) {
328 Double_t ll = axis.Mag();
329 if (ll == 0.0) {
330 Warning("Rotate(angle,axis)"," zero axis");
331 } else {
333 Double_t dx = axis.X()/ll, dy = axis.Y()/ll, dz = axis.Z()/ll;
334 TRotation m(
335 ca+(1-ca)*dx*dx, (1-ca)*dx*dy-sa*dz, (1-ca)*dx*dz+sa*dy,
336 (1-ca)*dy*dx+sa*dz, ca+(1-ca)*dy*dy, (1-ca)*dy*dz-sa*dx,
337 (1-ca)*dz*dx-sa*dy, (1-ca)*dz*dy+sa*dx, ca+(1-ca)*dz*dz );
338 Transform(m);
339 }
340 }
341 return *this;
342}
343
344////////////////////////////////////////////////////////////////////////////////
345/// Rotate around x.
346
349 Double_t s = TMath::Sin(a);
350 Double_t x = fyx, y = fyy, z = fyz;
351 fyx = c*x - s*fzx;
352 fyy = c*y - s*fzy;
353 fyz = c*z - s*fzz;
354 fzx = s*x + c*fzx;
355 fzy = s*y + c*fzy;
356 fzz = s*z + c*fzz;
357 return *this;
358}
359
360////////////////////////////////////////////////////////////////////////////////
361/// Rotate around y.
362
365 Double_t s = TMath::Sin(a);
366 Double_t x = fzx, y = fzy, z = fzz;
367 fzx = c*x - s*fxx;
368 fzy = c*y - s*fxy;
369 fzz = c*z - s*fxz;
370 fxx = s*x + c*fxx;
371 fxy = s*y + c*fxy;
372 fxz = s*z + c*fxz;
373 return *this;
374}
375
376////////////////////////////////////////////////////////////////////////////////
377/// Rotate around z.
378
381 Double_t s = TMath::Sin(a);
382 Double_t x = fxx, y = fxy, z = fxz;
383 fxx = c*x - s*fyx;
384 fxy = c*y - s*fyy;
385 fxz = c*z - s*fyz;
386 fyx = s*x + c*fyx;
387 fyy = s*y + c*fyy;
388 fyz = s*z + c*fyz;
389 return *this;
390}
391
392////////////////////////////////////////////////////////////////////////////////
393/// Rotate axes.
394
396 const TVector3 &newY,
397 const TVector3 &newZ) {
398 Double_t del = 0.001;
399 TVector3 w = newX.Cross(newY);
400
401 if (TMath::Abs(newZ.X()-w.X()) > del ||
402 TMath::Abs(newZ.Y()-w.Y()) > del ||
403 TMath::Abs(newZ.Z()-w.Z()) > del ||
404 TMath::Abs(newX.Mag2()-1.) > del ||
405 TMath::Abs(newY.Mag2()-1.) > del ||
406 TMath::Abs(newZ.Mag2()-1.) > del ||
407 TMath::Abs(newX.Dot(newY)) > del ||
408 TMath::Abs(newY.Dot(newZ)) > del ||
409 TMath::Abs(newZ.Dot(newX)) > del) {
410 Warning("RotateAxes","bad axis vectors");
411 return *this;
412 } else {
413 return Transform(TRotation(newX.X(), newY.X(), newZ.X(),
414 newX.Y(), newY.Y(), newZ.Y(),
415 newX.Z(), newY.Z(), newZ.Z()));
416 }
417}
418
419////////////////////////////////////////////////////////////////////////////////
420/// Return Phi.
421
423 return (fyx == 0.0 && fxx == 0.0) ? 0.0 : TMath::ATan2(fyx,fxx);
424}
425
426////////////////////////////////////////////////////////////////////////////////
427/// Return Phi.
428
430 return (fyy == 0.0 && fxy == 0.0) ? 0.0 : TMath::ATan2(fyy,fxy);
431}
432
433////////////////////////////////////////////////////////////////////////////////
434/// Return Phi.
435
437 return (fyz == 0.0 && fxz == 0.0) ? 0.0 : TMath::ATan2(fyz,fxz);
438}
439
440////////////////////////////////////////////////////////////////////////////////
441/// Return Theta.
442
444 return TMath::ACos(fzx);
445}
446
447////////////////////////////////////////////////////////////////////////////////
448/// Return Theta.
449
451 return TMath::ACos(fzy);
452}
453
454////////////////////////////////////////////////////////////////////////////////
455/// Return Theta.
456
458 return TMath::ACos(fzz);
459}
460
461////////////////////////////////////////////////////////////////////////////////
462/// Rotation defined by an angle and a vector.
463
465 Double_t cosa = 0.5*(fxx+fyy+fzz-1);
466 Double_t cosa1 = 1-cosa;
467 if (cosa1 <= 0) {
468 angle = 0;
469 axis = TVector3(0,0,1);
470 } else {
471 Double_t x=0, y=0, z=0;
472 if (fxx > cosa) x = TMath::Sqrt((fxx-cosa)/cosa1);
473 if (fyy > cosa) y = TMath::Sqrt((fyy-cosa)/cosa1);
474 if (fzz > cosa) z = TMath::Sqrt((fzz-cosa)/cosa1);
475 if (fzy < fyz) x = -x;
476 if (fxz < fzx) y = -y;
477 if (fyx < fxy) z = -z;
479 axis = TVector3(x,y,z);
480 }
481}
482
483////////////////////////////////////////////////////////////////////////////////
484/// Rotate using the x-convention (Landau and Lifshitz, Goldstein, &c) by
485/// doing the explicit rotations. This is slightly less efficient than
486/// directly applying the rotation, but makes the code much clearer. My
487/// presumption is that this code is not going to be a speed bottle neck.
488
490 Double_t theta,
491 Double_t psi) {
493 RotateZ(phi);
494 RotateX(theta);
495 RotateZ(psi);
496
497 return *this;
498}
499
500////////////////////////////////////////////////////////////////////////////////
501/// Rotate using the y-convention.
502
504 Double_t theta,
505 Double_t psi) {
507 RotateZ(phi);
508 RotateY(theta);
509 RotateZ(psi);
510 return *this;
511}
512
513////////////////////////////////////////////////////////////////////////////////
514/// Rotate using the x-convention.
515
517 Double_t theta,
518 Double_t psi) {
520 euler.SetXEulerAngles(phi,theta,psi);
521 return Transform(euler);
522}
523
524////////////////////////////////////////////////////////////////////////////////
525/// Rotate using the y-convention.
526
528 Double_t theta,
529 Double_t psi) {
531 euler.SetYEulerAngles(phi,theta,psi);
532 return Transform(euler);
533}
534
535////////////////////////////////////////////////////////////////////////////////
536/// Set XPhi.
537
541
542////////////////////////////////////////////////////////////////////////////////
543/// Set XTheta.
544
548
549////////////////////////////////////////////////////////////////////////////////
550/// Set XPsi.
551
555
556////////////////////////////////////////////////////////////////////////////////
557/// Set YPhi.
558
562
563////////////////////////////////////////////////////////////////////////////////
564/// Set YTheta.
565
569
570////////////////////////////////////////////////////////////////////////////////
571/// Set YPsi.
572
576
577////////////////////////////////////////////////////////////////////////////////
578/// Return phi angle.
579
582
583 Double_t s2 = 1.0 - fzz*fzz;
584 if (s2 < 0) {
585 Warning("GetPhi()"," |fzz| > 1 ");
586 s2 = 0;
587 }
589
590 if (sinTheta != 0) {
591 const Double_t cscTheta = 1/sinTheta;
593 if ( TMath::Abs(cosAbsPhi) > 1 ) { // NaN-proofing
594 Warning("GetPhi()","finds | cos phi | > 1");
595 cosAbsPhi = 1;
596 }
598 if (fzx > 0) {
600 } else if (fzx < 0) {
601 finalPhi = -absPhi;
602 } else if (fzy > 0) {
603 finalPhi = 0.0;
604 } else {
606 }
607 } else { // sinTheta == 0 so |Fzz| = 1
608 const Double_t absPhi = .5 * TMath::ACos (fxx);
609 if (fxy > 0) {
610 finalPhi = -absPhi;
611 } else if (fxy < 0) {
613 } else if (fxx>0) {
614 finalPhi = 0.0;
615 } else {
617 }
618 }
619 return finalPhi;
620}
621
622////////////////////////////////////////////////////////////////////////////////
623/// Return YPhi.
624
626 return GetXPhi() + TMath::Pi()/2.0;
627}
628
629////////////////////////////////////////////////////////////////////////////////
630/// Return XTheta.
631
633 return ThetaZ();
634}
635
636////////////////////////////////////////////////////////////////////////////////
637/// Return YTheta.
638
640 return ThetaZ();
641}
642
643////////////////////////////////////////////////////////////////////////////////
644/// Get psi angle.
645
647 double finalPsi = 0.0;
648
649 Double_t s2 = 1.0 - fzz*fzz;
650 if (s2 < 0) {
651 Warning("GetPsi()"," |fzz| > 1 ");
652 s2 = 0;
653 }
655
656 if (sinTheta != 0) {
657 const Double_t cscTheta = 1/sinTheta;
659 if ( TMath::Abs(cosAbsPsi) > 1 ) { // NaN-proofing
660 Warning("GetPsi()","| cos psi | > 1 ");
661 cosAbsPsi = 1;
662 }
664 if (fxz > 0) {
666 } else if (fxz < 0) {
667 finalPsi = -absPsi;
668 } else {
669 finalPsi = (fyz < 0) ? 0 : TMath::Pi();
670 }
671 } else { // sinTheta == 0 so |Fzz| = 1
673 if ( TMath::Abs(fxx) > 1 ) { // NaN-proofing
674 Warning("GetPsi()","| fxx | > 1 ");
675 absPsi = 1;
676 }
677 absPsi = .5 * TMath::ACos (absPsi);
678 if (fyx > 0) {
680 } else if (fyx < 0) {
681 finalPsi = -absPsi;
682 } else {
683 finalPsi = (fxx > 0) ? 0 : TMath::PiOver2();
684 }
685 }
686 return finalPsi;
687}
688
689////////////////////////////////////////////////////////////////////////////////
690/// Return YPsi.
691
693 return GetXPsi() - TMath::Pi()/2;
694}
695
696////////////////////////////////////////////////////////////////////////////////
697/// Set X axis.
698
700 const TVector3& xyPlane) {
703 TVector3 zAxis(axis);
705 fxx = zAxis.X(); fyx = zAxis.Y(); fzx = zAxis.Z();
706 fxy = xAxis.X(); fyy = xAxis.Y(); fzy = xAxis.Z();
707 fxz = yAxis.X(); fyz = yAxis.Y(); fzz = yAxis.Z();
708 return *this;
709}
710
711////////////////////////////////////////////////////////////////////////////////
712/// Set X axis.
713
715 TVector3 xyPlane(0.0,1.0,0.0);
716 return SetXAxis(axis,xyPlane);
717}
718
719////////////////////////////////////////////////////////////////////////////////
720/// Set Y axis.
721
723 const TVector3& yzPlane) {
726 TVector3 zAxis(axis);
728 fxx = yAxis.X(); fyx = yAxis.Y(); fzx = yAxis.Z();
729 fxy = zAxis.X(); fyy = zAxis.Y(); fzy = zAxis.Z();
730 fxz = xAxis.X(); fyz = xAxis.Y(); fzz = xAxis.Z();
731 return *this;
732}
733
734////////////////////////////////////////////////////////////////////////////////
735/// Set Y axis.
736
738 TVector3 yzPlane(0.0,0.0,1.0);
739 return SetYAxis(axis,yzPlane);
740}
741
742////////////////////////////////////////////////////////////////////////////////
743/// Set Z axis.
744
746 const TVector3& zxPlane) {
749 TVector3 zAxis(axis);
751 fxx = xAxis.X(); fyx = xAxis.Y(); fzx = xAxis.Z();
752 fxy = yAxis.X(); fyy = yAxis.Y(); fzy = yAxis.Z();
753 fxz = zAxis.X(); fyz = zAxis.Y(); fzz = zAxis.Z();
754 return *this;
755}
756
757////////////////////////////////////////////////////////////////////////////////
758/// Set Z axis.
759
761 TVector3 zxPlane(1.0,0.0,0.0);
762 return SetZAxis(axis,zxPlane);
763}
764
765////////////////////////////////////////////////////////////////////////////////
766/// Make the Z axis into a unit variable.
767
770 TVector3& zAxis) const {
771 Double_t zmag = zAxis.Mag();
772 if (zmag<TOLERANCE) {
773 Warning("MakeBasis(X,Y,Z)","non-zero Z Axis is required");
774 }
775 zAxis *= (1.0/zmag);
776
777 Double_t xmag = xAxis.Mag();
778 if (xmag<TOLERANCE*zmag) {
779 xAxis = zAxis.Orthogonal();
780 xmag = 1.0;
781 }
782
783 // Find the Y axis
784 yAxis = zAxis.Cross(xAxis)*(1.0/xmag);
785 Double_t ymag = yAxis.Mag();
786 if (ymag<TOLERANCE*zmag) {
787 yAxis = zAxis.Orthogonal();
788 } else {
789 yAxis *= (1.0/ymag);
790 }
791
792 xAxis = yAxis.Cross(zAxis);
793}
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
#define e(i)
Definition RSha256.hxx:103
#define ClassImp(name)
Definition Rtypes.h:376
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t del
Option_t Option_t TPoint TPoint angle
#define TOLERANCE
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1058
<div class="legacybox"><h2>Legacy Code</h2> TQuaternion is a legacy interface: there will be no bug f...
Definition TQuaternion.h:11
<div class="legacybox"><h2>Legacy Code</h2> TRotation is a legacy interface: there will be no bug fix...
Definition TRotation.h:20
Double_t fzz
Definition TRotation.h:182
Double_t fyy
Definition TRotation.h:182
TRotation & SetToIdentity()
Definition TRotation.h:251
TRotation & SetZAxis(const TVector3 &axis)
Set Z axis.
Double_t PhiY() const
Return Phi.
TRotation & Rotate(Double_t, const TVector3 &)
Rotate along an axis.
Double_t fzy
Definition TRotation.h:182
void SetXPhi(Double_t)
Set XPhi.
Double_t GetYPhi(void) const
Return YPhi.
TRotation()
Constructor.
Double_t operator()(int, int) const
Dereferencing operator const.
Double_t ThetaY() const
Return Theta.
TRotation & RotateYEulerAngles(Double_t phi, Double_t theta, Double_t psi)
Rotate using the y-convention.
void SetYPhi(Double_t)
Set YPhi.
TRotation & SetYAxis(const TVector3 &axis)
Set Y axis.
Double_t fyx
Definition TRotation.h:182
Double_t GetXPsi(void) const
Get psi angle.
void SetXPsi(Double_t)
Set XPsi.
Double_t PhiX() const
Return Phi.
Double_t fxz
Definition TRotation.h:182
TRotation & Transform(const TRotation &)
Definition TRotation.h:267
TRotation & RotateY(Double_t)
Rotate around y.
Double_t fyz
Definition TRotation.h:182
Double_t PhiZ() const
Return Phi.
TRotation & RotateZ(Double_t)
Rotate around z.
TVector3 operator*(const TVector3 &) const
Definition TRotation.h:257
Double_t GetYPsi(void) const
Return YPsi.
Double_t GetYTheta(void) const
Return YTheta.
TRotation & RotateXEulerAngles(Double_t phi, Double_t theta, Double_t psi)
Rotate using the x-convention.
TRotation & SetXEulerAngles(Double_t phi, Double_t theta, Double_t psi)
Rotate using the x-convention (Landau and Lifshitz, Goldstein, &c) by doing the explicit rotations.
void AngleAxis(Double_t &, TVector3 &) const
Rotation defined by an angle and a vector.
Double_t ThetaZ() const
Return Theta.
void SetYPsi(Double_t)
Set YPsi.
void SetYTheta(Double_t)
Set YTheta.
Double_t fxx
Definition TRotation.h:182
TRotation & SetYEulerAngles(Double_t phi, Double_t theta, Double_t psi)
Rotate using the y-convention.
void MakeBasis(TVector3 &xAxis, TVector3 &yAxis, TVector3 &zAxis) const
Make the Z axis into a unit variable.
TRotation & RotateAxes(const TVector3 &newX, const TVector3 &newY, const TVector3 &newZ)
Rotate axes.
void SetXTheta(Double_t)
Set XTheta.
Double_t GetXPhi(void) const
Return phi angle.
TRotation & SetXAxis(const TVector3 &axis)
Set X axis.
Double_t GetXTheta(void) const
Return XTheta.
Double_t fzx
Definition TRotation.h:182
Double_t ThetaX() const
Return Theta.
Double_t fxy
Definition TRotation.h:182
TRotation & RotateX(Double_t)
Rotate around x.
Double_t Z() const
Definition TVector3.h:218
Double_t Y() const
Definition TVector3.h:217
Double_t X() const
Definition TVector3.h:216
Double_t Mag() const
Definition TVector3.h:86
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Definition TMath.h:638
constexpr Double_t PiOver2()
Definition TMath.h:52
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Definition TMath.h:652
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition TMath.h:668
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:600
constexpr Double_t Pi()
Definition TMath.h:38
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:594
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:124
TMarker m
Definition textangle.C:8