Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::Cartesian2D< T > Class Template Reference

template<class T = double>
class ROOT::Math::Cartesian2D< T >

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

See also
Physics Vectors

Definition at line 39 of file Cartesian2D.h.

Public Types

typedefScalar
 

Public Member Functions

constexpr Cartesian2D () noexcept=default
 Default constructor with x=y=0.
 
template<class CoordSystem >
constexpr Cartesian2D (const CoordSystem &v)
 Construct from any Vector or coordinate system implementing X() and Y()
 
template<class T2 >
constexpr Cartesian2D (const Polar2D< T2 > &v)
 
 Cartesian2D (Scalar xx, Scalar yy)
 Constructor from x,y coordinates.
 
void GetCoordinates (Scalar &xx, Scalar &yy) const
 get internal data into 2 Scalar numbers
 
Scalar Mag2 () const
 
void Negate ()
 negate the vector
 
bool operator!= (const Cartesian2D &rhs) const
 
template<class CoordSystem >
Cartesian2Doperator= (const CoordSystem &v)
 Assignment from any class implementing x(),y() (can assign from any coordinate system)
 
template<class T2 >
Cartesian2Doperator= (const Polar2D< T2 > &v)
 
bool operator== (const Cartesian2D &rhs) const
 Exact equality.
 
Scalar Phi () const
 
Scalar R () const
 
void Rotate (Scalar angle)
 rotate by an angle
 
void Scale (Scalar a)
 scale the vector by a scalar quantity a
 
void SetCoordinates (Scalar xx, Scalar yy)
 Set internal data based on 2 Scalar numbers.
 
void SetX (Scalar a)
 set the x coordinate value keeping y constant
 
void SetXY (Scalar xx, Scalar yy)
 set all values using cartesian coordinates
 
void SetY (Scalar a)
 set the y coordinate value keeping x constant
 
Scalar X () const
 
Scalar x () const
 
Scalar Y () const
 
Scalar y () const
 

Static Public Attributes

static constexpr unsigned int Dimension = 2U
 

Private Attributes

fX = 0
 (Contiguous) data containing the coordinates values x and y
 
fY = 0
 

#include <Math/GenVector/Cartesian2D.h>

Member Typedef Documentation

◆ Scalar

template<class T = double>
typedef T ROOT::Math::Cartesian2D< T >::Scalar

Definition at line 43 of file Cartesian2D.h.

Constructor & Destructor Documentation

◆ Cartesian2D() [1/4]

template<class T = double>
constexpr ROOT::Math::Cartesian2D< T >::Cartesian2D ( )
constexprdefaultnoexcept

Default constructor with x=y=0.

◆ Cartesian2D() [2/4]

template<class T = double>
ROOT::Math::Cartesian2D< T >::Cartesian2D ( Scalar xx,
Scalar yy )
inline

Constructor from x,y coordinates.

Definition at line 55 of file Cartesian2D.h.

◆ Cartesian2D() [3/4]

template<class T = double>
template<class CoordSystem >
constexpr ROOT::Math::Cartesian2D< T >::Cartesian2D ( const CoordSystem & v)
inlineexplicitconstexpr

Construct from any Vector or coordinate system implementing X() and Y()

Definition at line 62 of file Cartesian2D.h.

◆ Cartesian2D() [4/4]

template<class T = double>
template<class T2 >
constexpr ROOT::Math::Cartesian2D< T >::Cartesian2D ( const Polar2D< T2 > & v)
inlineexplicitconstexpr

Definition at line 150 of file Cartesian2D.h.

Member Function Documentation

◆ GetCoordinates()

template<class T = double>
void ROOT::Math::Cartesian2D< T >::GetCoordinates ( Scalar & xx,
Scalar & yy ) const
inline

get internal data into 2 Scalar numbers

Definition at line 73 of file Cartesian2D.h.

◆ Mag2()

template<class T = double>
Scalar ROOT::Math::Cartesian2D< T >::Mag2 ( ) const
inline

Definition at line 77 of file Cartesian2D.h.

◆ Negate()

template<class T = double>
void ROOT::Math::Cartesian2D< T >::Negate ( )
inline

negate the vector

Definition at line 107 of file Cartesian2D.h.

◆ operator!=()

template<class T = double>
bool ROOT::Math::Cartesian2D< T >::operator!= ( const Cartesian2D< T > & rhs) const
inline

Definition at line 137 of file Cartesian2D.h.

◆ operator=() [1/2]

template<class T = double>
template<class CoordSystem >
Cartesian2D & ROOT::Math::Cartesian2D< T >::operator= ( const CoordSystem & v)
inline

Assignment from any class implementing x(),y() (can assign from any coordinate system)

Definition at line 125 of file Cartesian2D.h.

◆ operator=() [2/2]

template<class T = double>
template<class T2 >
Cartesian2D & ROOT::Math::Cartesian2D< T >::operator= ( const Polar2D< T2 > & v)
inline

Definition at line 165 of file Cartesian2D.h.

◆ operator==()

template<class T = double>
bool ROOT::Math::Cartesian2D< T >::operator== ( const Cartesian2D< T > & rhs) const
inline

Exact equality.

Definition at line 134 of file Cartesian2D.h.

◆ Phi()

template<class T = double>
Scalar ROOT::Math::Cartesian2D< T >::Phi ( ) const
inline

Definition at line 79 of file Cartesian2D.h.

◆ R()

template<class T = double>
Scalar ROOT::Math::Cartesian2D< T >::R ( ) const
inline

Definition at line 78 of file Cartesian2D.h.

◆ Rotate()

template<class T = double>
void ROOT::Math::Cartesian2D< T >::Rotate ( Scalar angle)
inline

rotate by an angle

Definition at line 112 of file Cartesian2D.h.

◆ Scale()

template<class T = double>
void ROOT::Math::Cartesian2D< T >::Scale ( Scalar a)
inline

scale the vector by a scalar quantity a

Definition at line 102 of file Cartesian2D.h.

◆ SetCoordinates()

template<class T = double>
void ROOT::Math::Cartesian2D< T >::SetCoordinates ( Scalar xx,
Scalar yy )
inline

Set internal data based on 2 Scalar numbers.

Definition at line 68 of file Cartesian2D.h.

◆ SetX()

template<class T = double>
void ROOT::Math::Cartesian2D< T >::SetX ( Scalar a)
inline

set the x coordinate value keeping y constant

Definition at line 84 of file Cartesian2D.h.

◆ SetXY()

template<class T = double>
void ROOT::Math::Cartesian2D< T >::SetXY ( Scalar xx,
Scalar yy )
inline

set all values using cartesian coordinates

Definition at line 94 of file Cartesian2D.h.

◆ SetY()

template<class T = double>
void ROOT::Math::Cartesian2D< T >::SetY ( Scalar a)
inline

set the y coordinate value keeping x constant

Definition at line 89 of file Cartesian2D.h.

◆ X()

template<class T = double>
Scalar ROOT::Math::Cartesian2D< T >::X ( ) const
inline

Definition at line 75 of file Cartesian2D.h.

◆ x()

template<class T = double>
Scalar ROOT::Math::Cartesian2D< T >::x ( ) const
inline

Definition at line 144 of file Cartesian2D.h.

◆ Y()

template<class T = double>
Scalar ROOT::Math::Cartesian2D< T >::Y ( ) const
inline

Definition at line 76 of file Cartesian2D.h.

◆ y()

template<class T = double>
Scalar ROOT::Math::Cartesian2D< T >::y ( ) const
inline

Definition at line 145 of file Cartesian2D.h.

Member Data Documentation

◆ Dimension

template<class T = double>
constexpr unsigned int ROOT::Math::Cartesian2D< T >::Dimension = 2U
staticconstexpr

Definition at line 45 of file Cartesian2D.h.

◆ fX

template<class T = double>
T ROOT::Math::Cartesian2D< T >::fX = 0
private

(Contiguous) data containing the coordinates values x and y

Definition at line 193 of file Cartesian2D.h.

◆ fY

template<class T = double>
T ROOT::Math::Cartesian2D< T >::fY = 0
private

Definition at line 194 of file Cartesian2D.h.

  • math/genvector/inc/Math/GenVector/Cartesian2D.h