Logo ROOT   6.10/00
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
math/genvector/doc/Point3D.md
Go to the documentation of this file.
1 // Point3d doxygen page
2 
3 /**
4 
5 \page Point3DPage Point3D Classes
6 
7 To avoid exposing templated parameter to the users, typedefs are defined for all types of vectors based an double's and float's. To use them, one must include the header file _Math/Point3D.h_. The following typedef's, defined in the header file _Math/Point3Dfwd.h_, are available for the different instantiations of the template class ROOT::Math::PositionVector3D:
8 
9 * ROOT::Math::XYZPoint point based on x,y,z coordinates (cartesian) in double precision
10 * ROOT::Math::XYZPointF point based on x,y,z coordinates (cartesian) in float precision
11 * ROOT::Math::Polar3DPoint point based on r,theta,phi coordinates (polar) in double precision
12 * ROOT::Math::Polar3DPointF point based on r,theta,phi coordinates (polar) in float precision
13 * ROOT::Math::RhoZPhiPoint point based on rho,z,phi coordinates (cylindrical using z) in double precision
14 * ROOT::Math::RhoZPhiPointF point based on rho,z,phi coordinates (cylindrical using z) in float precision
15 * ROOT::Math::RhoEtaPhiPoint point based on rho,eta,phi coordinates (cylindrical using eta instead of z) in double precision
16 * ROOT::Math::RhoEtaPhiPointF point based on rho,eta,phi coordinates (cylindrical using eta instead of z) in float precision
17 
18 #### Constructors and Assignment
19 
20 The following declarations are available:
21 
22 <pre> XYZPoint p1; // create an empty vector (x = 0, y = 0, z = 0)
23  XYZPoint p2( 1,2,3); // create a vector with x=1, y = 2, z = 3;
24  Polar3DPoint p3( 1, PI/2, PI); // create a vector with r = 1, theta = PI/2 and phi=PI
25  RhoEtaPHiPoint p4( 1, 2, PI) // create a vector with rho= 1, eta = 2, phi = PI
26 </pre>
27 
28 Note that each type of vector is constructed by passing its coordinates representations, so a XYZPoint(1,2,3) is different from a Polar3DPoint(1,2,3).
29 
30 In addition the Point classes can be constructed by any vector, which implements the accessors x(), y() and z(). This con be another Point3D based on a different coordinate system types or even any vector of a different package, like the CLHEP HepThreePoint that implements the required signatures.
31 
32 <pre> XYZPoint p1(1,2,3);
33  RhoEtaPHiPoint r2(v1);
34  CLHEP::HepThreePoint q(1,2,3);
35  XYZPoint p3(q)
36 </pre>
37 
38 #### Coordinate Accessors and Setter Methods
39 
40 For the Points classes we have the same getter and setter methods as for the Vector classes. See the examples for the \ref Vector3DPage.
41 
42 #### Point-Vector Operations
43 
44 The following operations are possible between points and vector classes: ( p1 ,p2 and p3 are instantiations of the ROOT::Math::PositionVector3D class, p1 and p3 of the same type v1 and v2 are a ROOT::Math::DisplacementVector3D class )
45 
46 <pre>p1 += v1;
47 p1 -= v1;
48 p3 = p1 + v1; // p1 and p3 are the same type
49 p3 = v1 + p1; // p3 is based on the same coordinate system as v1
50 p3 = p1 - v1;
51 p3 = v1 - p1;
52 v2 = p1 - p2; // difference between points returns a vector v2 based on the same coordinate system as p1
53 </pre>
54 
55 Note that additions between two points is NOT possible and the difference between points returns a vector.
56 
57 #### Other Operations
58 
59 Exactly as for the 3D Vectors, the following operations are allowed:
60 
61 * comparison of points
62 * scaling and division of points with a scalar
63 * dot and cross product with any type of vector
64 
65 */