16 #ifndef ROOT_Math_GenVector_Cartesian2D
17 #define ROOT_Math_GenVector_Cartesian2D 1
19 #ifndef ROOT_Math_GenVector_Polar2Dfwd
23 #ifndef ROOT_Math_Math
40 template <
class T =
double>
61 template <
class CoordSystem>
93 Scalar
X()
const {
return fX;}
94 Scalar
Y()
const {
return fY;}
140 template <
class CoordSystem>
151 return fX == rhs.
fX &&
fY == rhs.
fY;
160 Scalar
x()
const {
return X();}
161 Scalar
y()
const {
return Y();}
189 #if defined(__MAKECINT__) || defined(G__DICTIONARY)
195 void SetPhi(Scalar phi);
216 #if defined(__MAKECINT__) || defined(G__DICTIONARY)
221 #ifndef ROOT_Math_GenVector_GenVector_exception
224 #ifndef ROOT_Math_GenVector_Polar2D
235 void Cartesian2D<T>::SetR(
Scalar r) {
236 GenVector_exception e(
"Cartesian2D::SetR() is not supposed to be called");
238 Polar2D<Scalar>
v(*
this); v.SetR(r); *
this = Cartesian2D<Scalar>(
v);
243 void Cartesian2D<T>::SetPhi(
Scalar phi) {
244 GenVector_exception e(
"Cartesian2D::SetPhi() is not supposed to be called");
246 Polar2D<Scalar>
v(*
this);
v.SetPhi(phi); *
this = Cartesian2D<Scalar>(
v);
void GetCoordinates(Scalar &xx, Scalar &yy) const
get internal data into 2 Scalar numbers
Namespace for new ROOT classes and functions.
void SetY(Scalar a)
set the y coordinate value keeping x 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
bool operator==(const Cartesian2D &rhs) const
Exact equality.
void Negate()
negate the vector
Cartesian2D(const Cartesian2D &v)
copy constructor
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)
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
Cartesian2D(const CoordSystem &v)
Construct from any Vector or coordinate system implementing X() and Y()