Logo ROOT   6.13/01
Reference Guide
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
TVector2 Class Reference

TVector2 is a general two vector class, which can be used for the description of different vectors in 2D.

Definition at line 18 of file TVector2.h.

Public Types

typedef Double_t Scalar
 

Public Member Functions

 TVector2 ()
 Constructor. More...
 
 TVector2 (Double_t *s)
 Constructor. More...
 
 TVector2 (Double_t x0, Double_t y0)
 Constructor. More...
 
virtual ~TVector2 ()
 
Double_t DeltaPhi (const TVector2 &v) const
 
Double_t Mod () const
 Return modulo of this vector. More...
 
Double_t Mod2 () const
 
TVector2 Norm (const TVector2 &v) const
 
Double_t operator*= (TVector2 const &v)
 
TVector2operator*= (Double_t s)
 
TVector2operator+= (TVector2 const &v)
 
TVector2operator-= (TVector2 const &v)
 
TVector2operator/= (Double_t s)
 
TVector2operator= (TVector2 const &v)
 
TVector2 Ort () const
 
Double_t Phi () const
 Return vector phi. More...
 
void Print (Option_t *option="") const
 
TVector2 Proj (const TVector2 &v) const
 
Double_t Px () const
 
Double_t Py () const
 
TVector2 Rotate (Double_t phi) const
 Rotation by phi. More...
 
void Set (const TVector2 &v)
 
void Set (Double_t x0, Double_t y0)
 
void Set (float x0, float y0)
 
void SetMagPhi (Double_t mag, Double_t phi)
 Set vector using mag and phi. More...
 
void SetX (Double_t x0)
 
void SetY (Double_t y0)
 
TVector2 Unit () const
 Return module normalized to 1. More...
 
Double_t X () const
 
Double_t Y () const
 

Static Public Member Functions

static Double_t Phi_0_2pi (Double_t x)
 Returns phi angle in the interval [0,2*PI) More...
 
static Double_t Phi_mpi_pi (Double_t x)
 Returns phi angle in the interval [-PI,PI) More...
 

Protected Attributes

Double_t fX
 
Double_t fY
 

Friends

Double_t operator* (const TVector2 &, const TVector2 &)
 
TVector2 operator* (const TVector2 &, Double_t)
 
TVector2 operator* (Double_t, const TVector2 &)
 
TVector2 operator+ (const TVector2 &, const TVector2 &)
 
TVector2 operator+ (const TVector2 &, Double_t)
 
TVector2 operator+ (Double_t, const TVector2 &)
 
TVector2 operator- (const TVector2 &, const TVector2 &)
 
TVector2 operator- (const TVector2 &, Double_t)
 
TVector2 operator/ (const TVector2 &, Double_t)
 
Double_t operator^ (const TVector2 &, const TVector2 &)
 

#include <TVector2.h>

Inheritance diagram for TVector2:
[legend]

Member Typedef Documentation

◆ Scalar

typedef Double_t TVector2::Scalar

Definition at line 31 of file TVector2.h.

Constructor & Destructor Documentation

◆ TVector2() [1/3]

TVector2::TVector2 ( )

Constructor.

Definition at line 31 of file TVector2.cxx.

◆ TVector2() [2/3]

TVector2::TVector2 ( Double_t *  s)

Constructor.

Definition at line 40 of file TVector2.cxx.

◆ TVector2() [3/3]

TVector2::TVector2 ( Double_t  x0,
Double_t  y0 
)

Constructor.

Definition at line 49 of file TVector2.cxx.

◆ ~TVector2()

TVector2::~TVector2 ( )
virtual

Definition at line 57 of file TVector2.cxx.

Member Function Documentation

◆ DeltaPhi()

Double_t TVector2::DeltaPhi ( const TVector2 v) const
inline

Definition at line 166 of file TVector2.h.

◆ Mod()

Double_t TVector2::Mod ( ) const

Return modulo of this vector.

Definition at line 64 of file TVector2.cxx.

◆ Mod2()

Double_t TVector2::Mod2 ( ) const
inline

Definition at line 67 of file TVector2.h.

◆ Norm()

TVector2 TVector2::Norm ( const TVector2 v) const
inline

Definition at line 172 of file TVector2.h.

◆ operator*=() [1/2]

Double_t TVector2::operator*= ( TVector2 const &  v)
inline

Definition at line 119 of file TVector2.h.

◆ operator*=() [2/2]

TVector2 & TVector2::operator*= ( Double_t  s)
inline

Definition at line 121 of file TVector2.h.

◆ operator+=()

TVector2 & TVector2::operator+= ( TVector2 const &  v)
inline

Definition at line 114 of file TVector2.h.

◆ operator-=()

TVector2 & TVector2::operator-= ( TVector2 const &  v)
inline

Definition at line 115 of file TVector2.h.

◆ operator/=()

TVector2 & TVector2::operator/= ( Double_t  s)
inline

Definition at line 122 of file TVector2.h.

◆ operator=()

TVector2 & TVector2::operator= ( TVector2 const &  v)
inline

Definition at line 113 of file TVector2.h.

◆ Ort()

TVector2 TVector2::Ort ( ) const
inline

Definition at line 168 of file TVector2.h.

◆ Phi()

Double_t TVector2::Phi ( ) const

Return vector phi.

Definition at line 80 of file TVector2.cxx.

◆ Phi_0_2pi()

Double_t TVector2::Phi_0_2pi ( Double_t  x)
static

Returns phi angle in the interval [0,2*PI)

Definition at line 88 of file TVector2.cxx.

◆ Phi_mpi_pi()

Double_t TVector2::Phi_mpi_pi ( Double_t  x)
static

Returns phi angle in the interval [-PI,PI)

Definition at line 101 of file TVector2.cxx.

◆ Print()

void TVector2::Print ( Option_t *  option = "") const

Definition at line 152 of file TVector2.cxx.

◆ Proj()

TVector2 TVector2::Proj ( const TVector2 v) const
inline

Definition at line 170 of file TVector2.h.

◆ Px()

Double_t TVector2::Px ( ) const
inline

Definition at line 70 of file TVector2.h.

◆ Py()

Double_t TVector2::Py ( ) const
inline

Definition at line 71 of file TVector2.h.

◆ Rotate()

TVector2 TVector2::Rotate ( Double_t  phi) const

Rotation by phi.

Definition at line 114 of file TVector2.cxx.

◆ Set() [1/3]

void TVector2::Set ( const TVector2 v)
inline

Definition at line 176 of file TVector2.h.

◆ Set() [2/3]

void TVector2::Set ( Double_t  x0,
Double_t  y0 
)
inline

Definition at line 177 of file TVector2.h.

◆ Set() [3/3]

void TVector2::Set ( float  x0,
float  y0 
)
inline

Definition at line 178 of file TVector2.h.

◆ SetMagPhi()

void TVector2::SetMagPhi ( Double_t  mag,
Double_t  phi 
)

Set vector using mag and phi.

Definition at line 122 of file TVector2.cxx.

◆ SetX()

void TVector2::SetX ( Double_t  x0)
inline

Definition at line 179 of file TVector2.h.

◆ SetY()

void TVector2::SetY ( Double_t  y0)
inline

Definition at line 180 of file TVector2.h.

◆ Unit()

TVector2 TVector2::Unit ( ) const

Return module normalized to 1.

Definition at line 72 of file TVector2.cxx.

◆ X()

Double_t TVector2::X ( ) const
inline

Definition at line 72 of file TVector2.h.

◆ Y()

Double_t TVector2::Y ( ) const
inline

Definition at line 73 of file TVector2.h.

Friends And Related Function Documentation

◆ operator* [1/3]

Double_t operator* ( const TVector2 v1,
const TVector2 v2 
)
friend

Definition at line 154 of file TVector2.h.

◆ operator* [2/3]

TVector2 operator* ( const TVector2 v,
Double_t  s 
)
friend

Definition at line 146 of file TVector2.h.

◆ operator* [3/3]

TVector2 operator* ( Double_t  s,
const TVector2 v 
)
friend

Definition at line 150 of file TVector2.h.

◆ operator+ [1/3]

TVector2 operator+ ( const TVector2 v1,
const TVector2 v2 
)
friend

Definition at line 126 of file TVector2.h.

◆ operator+ [2/3]

TVector2 operator+ ( const TVector2 v1,
Double_t  bias 
)
friend

Definition at line 130 of file TVector2.h.

◆ operator+ [3/3]

TVector2 operator+ ( Double_t  bias,
const TVector2 v1 
)
friend

Definition at line 134 of file TVector2.h.

◆ operator- [1/2]

TVector2 operator- ( const TVector2 v1,
const TVector2 v2 
)
friend

Definition at line 138 of file TVector2.h.

◆ operator- [2/2]

TVector2 operator- ( const TVector2 v1,
Double_t  bias 
)
friend

Definition at line 142 of file TVector2.h.

◆ operator/

TVector2 operator/ ( const TVector2 v,
Double_t  s 
)
friend

Definition at line 158 of file TVector2.h.

◆ operator^

Double_t operator^ ( const TVector2 v1,
const TVector2 v2 
)
friend

Definition at line 162 of file TVector2.h.

Member Data Documentation

◆ fX

Double_t TVector2::fX
protected

Definition at line 24 of file TVector2.h.

◆ fY

Double_t TVector2::fY
protected

Definition at line 25 of file TVector2.h.

Libraries for TVector2:
[legend]

The documentation for this class was generated from the following files: