ROOT   Reference Guide
Loading...
Searching...
No Matches
ROOT::Math::Polar2D< T > Class Template Reference
template<class T>
class ROOT::Math::Polar2D< T >

Class describing a polar 2D coordinate system based on r and phi Phi is restricted to be in the range [-PI,PI)

See also
Overview of the physics vector library
Class describing a 2D Polar coordinate system


(r, phi coordinates)

Definition at line 45 of file Polar2D.h.

typedef T Scalar

## Public Member Functions

Polar2D ()
Default constructor with r=1,phi=0.

template<class CoordSystem >
constexpr Polar2D (const CoordSystem &v)
Construct from any Vector or coordinate system implementing R() and Phi()

Polar2D (const Polar2D &v)
copy constructor

Polar2D (T r, T phi)
Construct from the polar coordinates: r and phi.

void GetCoordinates (Scalar &r, Scalar &phi) const
get internal data into 2 Scalar numbers

Scalar Mag2 () const

void Negate ()
negate the vector

bool operator!= (const Polar2D &rhs) const

template<class CoordSystem >
Polar2Doperator= (const CoordSystem &c)
generic assignment operator from any coordinate system

Polar2Doperator= (const Polar2D &v)
assignment operator

bool operator== (const Polar2D &rhs) const
Exact equality.

Scalar Phi () const

Scalar R () const

void Rotate (T angle)
rotate the vector

void Scale (T a)
scale by a scalar quantity - for polar coordinates r changes

void SetCoordinates (Scalar r, Scalar phi)
Set internal data based on 2 Scalar numbers.

void SetPhi (const T &phi)
set the phi coordinate value keeping r constant

void SetR (const T &r)
set the r coordinate value keeping phi constant

void SetXY (Scalar a, Scalar b)
set all values using cartesian coordinates

Scalar X () const

x () const

Scalar Y () const

y () const

## Static Public Attributes

static constexpr unsigned int Dimension = 2U

## Private Member Functions

void Restrict ()
restrict abgle hi to be between -PI and PI

## Static Private Member Functions

static double pi ()

## Private Attributes

fPhi

fR

#include <Math/GenVector/Polar2D.h>

## ◆ Scalar

template<class T >
 typedef T ROOT::Math::Polar2D< T >::Scalar

Definition at line 49 of file Polar2D.h.

## ◆ Polar2D() [1/4]

template<class T >
 ROOT::Math::Polar2D< T >::Polar2D ( )
inline

Default constructor with r=1,phi=0.

Definition at line 55 of file Polar2D.h.

## ◆ Polar2D() [2/4]

template<class T >
 ROOT::Math::Polar2D< T >::Polar2D ( T r, T phi )
inline

Construct from the polar coordinates: r and phi.

Definition at line 60 of file Polar2D.h.

## ◆ Polar2D() [3/4]

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

Construct from any Vector or coordinate system implementing R() and Phi()

Definition at line 67 of file Polar2D.h.

## ◆ Polar2D() [4/4]

template<class T >
 ROOT::Math::Polar2D< T >::Polar2D ( const Polar2D< T > & v )
inline

copy constructor

Definition at line 76 of file Polar2D.h.

## ◆ GetCoordinates()

template<class T >
 void ROOT::Math::Polar2D< T >::GetCoordinates ( Scalar & r, Scalar & phi ) const
inline

get internal data into 2 Scalar numbers

Definition at line 98 of file Polar2D.h.

## ◆ Mag2()

template<class T >
 Scalar ROOT::Math::Polar2D< T >::Mag2 ( ) const
inline

Definition at line 105 of file Polar2D.h.

## ◆ Negate()

template<class T >
 void ROOT::Math::Polar2D< T >::Negate ( )
inline

negate the vector

Definition at line 161 of file Polar2D.h.

## ◆ operator!=()

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

Definition at line 190 of file Polar2D.h.

## ◆ operator=() [1/2]

template<class T >
template<class CoordSystem >
 Polar2D & ROOT::Math::Polar2D< T >::operator= ( const CoordSystem & c )
inline

generic assignment operator from any coordinate system

Definition at line 178 of file Polar2D.h.

## ◆ operator=() [2/2]

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

assignment operator

Definition at line 82 of file Polar2D.h.

## ◆ operator==()

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

Exact equality.

Definition at line 187 of file Polar2D.h.

## ◆ Phi()

template<class T >
 Scalar ROOT::Math::Polar2D< T >::Phi ( ) const
inline

Definition at line 102 of file Polar2D.h.

## ◆ pi()

template<class T >
 static double ROOT::Math::Polar2D< T >::pi ( )
inlinestaticprivate

Definition at line 134 of file Polar2D.h.

## ◆ R()

template<class T >
 Scalar ROOT::Math::Polar2D< T >::R ( ) const
inline

Definition at line 101 of file Polar2D.h.

## ◆ Restrict()

template<class T >
 void ROOT::Math::Polar2D< T >::Restrict ( )
inlineprivate

restrict abgle hi to be between -PI and PI

Definition at line 139 of file Polar2D.h.

## ◆ Rotate()

template<class T >
 void ROOT::Math::Polar2D< T >::Rotate ( T angle )
inline

rotate the vector

Definition at line 168 of file Polar2D.h.

## ◆ Scale()

template<class T >
 void ROOT::Math::Polar2D< T >::Scale ( T a )
inline

scale by a scalar quantity - for polar coordinates r changes

Definition at line 149 of file Polar2D.h.

## ◆ SetCoordinates()

template<class T >
 void ROOT::Math::Polar2D< T >::SetCoordinates ( Scalar r, Scalar phi )
inline

Set internal data based on 2 Scalar numbers.

Definition at line 92 of file Polar2D.h.

## ◆ SetPhi()

template<class T >
 void ROOT::Math::Polar2D< T >::SetPhi ( const T & phi )
inline

set the phi coordinate value keeping r constant

Definition at line 122 of file Polar2D.h.

## ◆ SetR()

template<class T >
 void ROOT::Math::Polar2D< T >::SetR ( const T & r )
inline

set the r coordinate value keeping phi constant

Definition at line 114 of file Polar2D.h.

## ◆ SetXY()

template<class T >
 void ROOT::Math::Polar2D< T >::SetXY ( Scalar a, Scalar b )

set all values using cartesian coordinates

Definition at line 238 of file Polar2D.h.

## ◆ X()

template<class T >
 Scalar ROOT::Math::Polar2D< T >::X ( ) const
inline

Definition at line 103 of file Polar2D.h.

## ◆ x()

template<class T >
 T ROOT::Math::Polar2D< T >::x ( ) const
inline

Definition at line 197 of file Polar2D.h.

## ◆ Y()

template<class T >
 Scalar ROOT::Math::Polar2D< T >::Y ( ) const
inline

Definition at line 104 of file Polar2D.h.

## ◆ y()

template<class T >
 T ROOT::Math::Polar2D< T >::y ( ) const
inline

Definition at line 198 of file Polar2D.h.

## ◆ Dimension

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

Definition at line 50 of file Polar2D.h.

## ◆ fPhi

template<class T >
 T ROOT::Math::Polar2D< T >::fPhi
private

Definition at line 216 of file Polar2D.h.

## ◆ fR

template<class T >
 T ROOT::Math::Polar2D< T >::fR
private

Definition at line 215 of file Polar2D.h.

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