16 #ifndef ROOT_Math_GenVector_Cartesian2D 17 #define ROOT_Math_GenVector_Cartesian2D 1 36 template <
class T =
double>
57 template <
class CoordSystem>
89 Scalar
X()
const {
return fX;}
90 Scalar
Y()
const {
return fY;}
127 const Scalar s =
sin(angle);
128 const Scalar c =
cos(angle);
136 template <
class CoordSystem>
147 return fX == rhs.
fX &&
fY == rhs.
fY;
156 Scalar
x()
const {
return X();}
157 Scalar
y()
const {
return Y();}
164 const Scalar r = v.
R();
177 const Scalar r = v.
R();
185 #if defined(__MAKECINT__) || defined(G__DICTIONARY) 191 void SetPhi(Scalar phi);
212 #if defined(__MAKECINT__) || defined(G__DICTIONARY)
Namespace for new ROOT classes and functions.
void SetY(Scalar a)
set the y coordinate value keeping x constant
void SetR(const T &r)
set the r coordinate value keeping phi constant
void SetXY(Scalar xx, Scalar yy)
set all values using cartesian coordinates
void Scale(Scalar a)
scale the vector by a scalar quantity a
void SetPhi(const T &phi)
set the phi coordinate value keeping r constant
void Negate()
negate the vector
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
Cartesian2D(const Cartesian2D &v)
copy constructor
bool operator==(const Cartesian2D &rhs) const
Exact equality.
void Rotate(Scalar angle)
rotate by an angle
Class describing a polar 2D coordinate system based on r and phi Phi is restricted to be in the range...
void SetX(Scalar a)
set the x coordinate value keeping y constant
bool operator!=(const Cartesian2D &rhs) const
void SetCoordinates(Scalar xx, Scalar yy)
Set internal data based on 2 Scalar numbers.
Cartesian2D()
Default constructor with x=y=0.
Cartesian2D(const Polar2D< T2 > &v)
Cartesian2D & operator=(const Cartesian2D &v)
assignment operator
Cartesian2D(Scalar xx, Scalar yy)
Constructor from x,y coordinates.
double atan2(double, double)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Class describing a 2D cartesian coordinate system (x, y coordinates)
Namespace for new Math classes and functions.
T fX
(Contiguous) data containing the coordinates values x and y
void GetCoordinates(Scalar &xx, Scalar &yy) const
get internal data into 2 Scalar numbers
Cartesian2D(const CoordSystem &v)
Construct from any Vector or coordinate system implementing X() and Y()