class ROOT::Math::Polar3D<double>

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

@ingroup GenVector

```

Function Members (Methods)

public:
 ~Polar3D() ROOT::Math::Polar3D::Scalar Eta() const void GetCoordinates(ROOT::Math::Polar3D::Scalar* dest) const void GetCoordinates(ROOT::Math::Polar3D::Scalar& r, ROOT::Math::Polar3D::Scalar& theta, ROOT::Math::Polar3D::Scalar& phi) const ROOT::Math::Polar3D::Scalar Mag2() const void Negate() bool operator!=(const ROOT::Math::Polar3D& rhs) const ROOT::Math::Polar3D& operator=(const ROOT::Math::Polar3D& v) bool operator==(const ROOT::Math::Polar3D& rhs) const ROOT::Math::Polar3D::Scalar Perp2() const ROOT::Math::Polar3D::Scalar Phi() const ROOT::Math::Polar3D Polar3D() ROOT::Math::Polar3D Polar3D(const ROOT::Math::Polar3D& v) ROOT::Math::Polar3D Polar3D(double r, double theta, double phi) ROOT::Math::Polar3D::Scalar R() const ROOT::Math::Polar3D::Scalar Rho() const void Scale(double a) void SetCoordinates(const ROOT::Math::Polar3D::Scalar* src) void SetCoordinates(ROOT::Math::Polar3D::Scalar r, ROOT::Math::Polar3D::Scalar theta, ROOT::Math::Polar3D::Scalar phi) void SetEta(ROOT::Math::Polar3D::Scalar eta) void SetPhi(const double& phi) void SetR(const double& r) void SetRho(ROOT::Math::Polar3D::Scalar rho) void SetTheta(const double& theta) void SetX(ROOT::Math::Polar3D::Scalar x) void SetXYZ(ROOT::Math::Polar3D::Scalar x, ROOT::Math::Polar3D::Scalar y, ROOT::Math::Polar3D::Scalar z) void SetY(ROOT::Math::Polar3D::Scalar y) void SetZ(ROOT::Math::Polar3D::Scalar z) ROOT::Math::Polar3D::Scalar Theta() const ROOT::Math::Polar3D::Scalar X() const double x() const ROOT::Math::Polar3D::Scalar Y() const double y() const ROOT::Math::Polar3D::Scalar Z() const double z() const
private:
 static double pi() void Restrict()

Data Members

private:
 double fPhi double fR double fTheta

Function documentation

Polar3D & operator=(const ROOT::Math::Polar3D<double>& v)
```assignment operator

```
void SetCoordinates(const ROOT::Math::Polar3D<double>::Scalar* src)
```Set internal data based on an array of 3 Scalar numbers

```
`{ fR=src[0]; fTheta=src[1]; fPhi=src[2]; Restrict(); }`
void GetCoordinates(ROOT::Math::Polar3D<double>::Scalar* dest) const
```get internal data into an array of 3 Scalar numbers

```
`{ dest[0] = fR; dest[1] = fTheta; dest[2] = fPhi; }`
void SetCoordinates(ROOT::Math::Polar3D<double>::Scalar r, ROOT::Math::Polar3D<double>::Scalar theta, ROOT::Math::Polar3D<double>::Scalar phi)
```Set internal data based on 3 Scalar numbers

```
`{ fR=r; fTheta=theta; fPhi=phi; Restrict(); }`
void GetCoordinates(ROOT::Math::Polar3D<double>::Scalar& r, ROOT::Math::Polar3D<double>::Scalar& theta, ROOT::Math::Polar3D<double>::Scalar& phi) const
```get internal data into 3 Scalar numbers

```
`{r=fR; theta=fTheta; phi=fPhi;}`
Scalar R()
`{ return fR;}`
Scalar Phi()
`{ return fPhi; }`
Scalar Theta()
`{ return fTheta; }`
Scalar Rho()
`{ return fR*std::sin(fTheta); }`
Scalar X()
`{ return Rho()*std::cos(fPhi);}`
Scalar Y()
`{ return Rho()*std::sin(fPhi);}`
Scalar Z()
`{ return fR*std::cos(fTheta); }`
Scalar Mag2()
`{ return fR*fR;}`
Scalar Perp2()
`{ return Rho()*Rho(); }`
Scalar Eta()
``` pseudorapidity
```
void SetR(const double& r)
``` setters (only for data members)

set the r coordinate value keeping theta and phi constant

```
void SetTheta(const double& theta)
```set the theta coordinate value keeping r and phi constant

```
void SetPhi(const double& phi)
```set the phi coordinate value keeping r and theta constant

```
Restrict()
void SetXYZ(ROOT::Math::Polar3D<double>::Scalar x, ROOT::Math::Polar3D<double>::Scalar y, ROOT::Math::Polar3D<double>::Scalar z)
``` all values using cartesian coordina

```
double pi()
`{ return M_PI; }`
void Scale(double a)
```cale by a scalar quantity - for polar coordinates r change

```
Negate()
bool operator==(const ROOT::Math::Polar3D<double>& rhs) const
```Exact equality

```
bool operator!=(const ROOT::Math::Polar3D<double>& rhs) const
`{return !(operator==(rhs));}`
T x()
``` ============= 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();}`
T y()
`{ return Y();}`
T z()
`{ return Z(); }`
void SetX(ROOT::Math::Polar3D<double>::Scalar x)
``` ============= Specializations for improved speed ==================
(none)
====== Set member functions for coordinates in other systems =======
```
void SetY(ROOT::Math::Polar3D<double>::Scalar y)
void SetZ(ROOT::Math::Polar3D<double>::Scalar z)
void SetRho(ROOT::Math::Polar3D<double>::Scalar rho)
void SetEta(ROOT::Math::Polar3D<double>::Scalar eta)

Last update: root/mathcore:\$Id: Polar3D.h 21503 2007-12-19 17:34:54Z moneta \$
Copyright (c) 2005 , LCG ROOT MathLib Team and *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.