ROOT logo
ROOT » MATH » GENVECTOR » ROOT::Math::Cartesian2D<Double32_t>

class ROOT::Math::Cartesian2D<Double32_t>


       Class describing a 2D cartesian coordinate system
       (x, y coordinates)

       @ingroup GenVector

This class is also known as (typedefs to this class)

ROOT::Math::DisplacementVector2D<ROOT::Math::Cartesian2D<Double32_t>,ROOT::Math::DefaultCoordinateSystemTag>::CoordinateType

Function Members (Methods)

public:
~Cartesian2D<Double32_t>()
ROOT::Math::Cartesian2D<Double32_t>Cartesian2D<Double32_t>()
ROOT::Math::Cartesian2D<Double32_t>Cartesian2D<Double32_t>(const ROOT::Math::Cartesian2D<Double32_t>& v)
ROOT::Math::Cartesian2D<Double32_t>Cartesian2D<Double32_t>(ROOT::Math::Cartesian2D<Double32_t>::Scalar xx, ROOT::Math::Cartesian2D<Double32_t>::Scalar yy)
voidGetCoordinates(ROOT::Math::Cartesian2D<Double32_t>::Scalar& xx, ROOT::Math::Cartesian2D<Double32_t>::Scalar& yy) const
ROOT::Math::Cartesian2D<Double32_t>::ScalarMag2() const
voidNegate()
booloperator!=(const ROOT::Math::Cartesian2D<Double32_t>& rhs) const
ROOT::Math::Cartesian2D<Double32_t>&operator=(const ROOT::Math::Cartesian2D<Double32_t>& v)
booloperator==(const ROOT::Math::Cartesian2D<Double32_t>& rhs) const
ROOT::Math::Cartesian2D<Double32_t>::ScalarPhi() const
ROOT::Math::Cartesian2D<Double32_t>::ScalarR() const
voidRotate(ROOT::Math::Cartesian2D<Double32_t>::Scalar angle)
voidScale(ROOT::Math::Cartesian2D<Double32_t>::Scalar a)
voidSetCoordinates(ROOT::Math::Cartesian2D<Double32_t>::Scalar xx, ROOT::Math::Cartesian2D<Double32_t>::Scalar yy)
voidSetPhi(ROOT::Math::Cartesian2D<Double32_t>::Scalar phi)
voidSetR(ROOT::Math::Cartesian2D<Double32_t>::Scalar r)
voidSetX(ROOT::Math::Cartesian2D<Double32_t>::Scalar a)
voidSetXY(ROOT::Math::Cartesian2D<Double32_t>::Scalar xx, ROOT::Math::Cartesian2D<Double32_t>::Scalar yy)
voidSetY(ROOT::Math::Cartesian2D<Double32_t>::Scalar a)
ROOT::Math::Cartesian2D<Double32_t>::ScalarX() const
ROOT::Math::Cartesian2D<Double32_t>::Scalarx() const
ROOT::Math::Cartesian2D<Double32_t>::ScalarY() const
ROOT::Math::Cartesian2D<Double32_t>::Scalary() const

Data Members

private:
Double32_tfX
Double32_tfY

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

Cartesian2D & operator=(const ROOT::Math::Cartesian2D<Double32_t>& v)
      assignment operator

void SetCoordinates(ROOT::Math::Cartesian2D<Double32_t>::Scalar xx, ROOT::Math::Cartesian2D<Double32_t>::Scalar yy)
      Set internal data based on 2 Scalar numbers

{ fX=xx; fY=yy; }
void GetCoordinates(ROOT::Math::Cartesian2D<Double32_t>::Scalar& xx, ROOT::Math::Cartesian2D<Double32_t>::Scalar& yy) const
      get internal data into 2 Scalar numbers

{xx=fX; yy=fY; }
Scalar X() const
{ return fX;}
Scalar Y() const
{ return fY;}
Scalar Mag2() const
{ return fX*fX + fY*fY; }
Scalar R() const
{ return std::sqrt( Mag2());}
Scalar Phi() const
{ return (fX==0 && fY==0) ? 0.0 : atan2(fY,fX);}
void SetX(ROOT::Math::Cartesian2D<Double32_t>::Scalar a)
       set the x coordinate value keeping y constant

{ fX = a; }
void SetY(ROOT::Math::Cartesian2D<Double32_t>::Scalar a)
       set the y coordinate value keeping x constant

{ fY = a; }
void SetXY(ROOT::Math::Cartesian2D<Double32_t>::Scalar xx, ROOT::Math::Cartesian2D<Double32_t>::Scalar yy)
       set all values using cartesian coordinates

void Scale(ROOT::Math::Cartesian2D<Double32_t>::Scalar a)
      scale the vector by a scalar quantity a

{ fX *= a; fY *= a; }
void Negate()
      negate the vector

{ fX = -fX; fY = -fY; }
void Rotate(ROOT::Math::Cartesian2D<Double32_t>::Scalar angle)
       rotate by an angle

Scalar x() const
 ============= Compatibility section ==================
 The following make this coordinate system look enough like a CLHEP
 vector that an assignment member template can work with either
{ return X();}
Scalar y() const
{ return Y();}
void SetR(ROOT::Math::Cartesian2D<Double32_t>::Scalar r)
 ====== Set member functions for coordinates in other systems =======
void SetPhi(ROOT::Math::Cartesian2D<Double32_t>::Scalar phi)