class ROOT::Math::PositionVector2D<ROOT::Math::Polar2D<double>,ROOT::Math::DefaultCoordinateSystemTag>

```
Class describing a generic position vector (point) in 2 dimensions.
This class is templated on the type of Coordinate system.
One example is the XYPoint which is a vector based on
double precision x,y data members by using the
ROOT::Math::Cartesian2D<double> Coordinate system.
The class is having also an extra template parameter, the coordinate system tag,
to be able to identify (tag) vector described in different reference coordinate system,
like global or local coordinate systems.

@ingroup GenVector

```

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

ROOT::Math::Polar2DPointD, ROOT::Math::Polar2DPoint, ROOT::Math::PositionVector2D<ROOT::Math::Polar2D<double> >, ROOT::Math::PositionVector2D<Polar2D<double>,DefaultCoordinateSystemTag>

Data Members

private:
 ROOT::Math::Polar2D fCoordinates

Function documentation

PositionVector2D & operator=(const ROOT::Math::PositionVector2D<ROOT::Math::Polar2D<double>,ROOT::Math::DefaultCoordinateSystemTag>& )
```          Assignment from a foreign 2D vector type, for example, Hep2Vector
Precondition: v must implement methods x() and y()

```
const CoordSystem & Coordinates() const
```          Retrieve a copy of the coordinates object

```

```          Set internal data based on 2 Scalar numbers.
These are for example (x,y) for a cartesian vector or (r,phi) for a polar vector

```

```          get internal data into 2 Scalar numbers.
These are for example (x,y) for a cartesian vector or (r,phi) for a polar vector

```
`{ fCoordinates.GetCoordinates(a, b); }`
bool operator==(const ROOT::Math::PositionVector2D<ROOT::Math::Polar2D<double>,ROOT::Math::DefaultCoordinateSystemTag>& rhs) const
``` ------------------- Equality -----------------

Exact equality

```
bool operator!=(const ROOT::Math::PositionVector2D<ROOT::Math::Polar2D<double>,ROOT::Math::DefaultCoordinateSystemTag>& rhs) const
Scalar X() const
``` ------ Individual element access, in various coordinate systems ------

Cartesian X, converting if necessary from internal coordinate system.

```
`{ return fCoordinates.X(); }`
Scalar Y() const
```          Cartesian Y, converting if necessary from internal coordinate system.

```
`{ return fCoordinates.Y(); }`
Scalar R() const
```          Polar R, converting if necessary from internal coordinate system.

```
`{ return fCoordinates.R(); }`
Scalar Phi() const
```          Polar phi, converting if necessary from internal coordinate system.

```
`{ return fCoordinates.Phi(); }`
Scalar Mag2() const
```          Magnitute squared ( r^2 in spherical coordinate)

```
`{ return fCoordinates.Mag2();}`
PositionVector2D<CoordSystem, Tag>& SetX(ROOT::Math::PositionVector2D<ROOT::Math::Polar2D<double>,ROOT::Math::DefaultCoordinateSystemTag>::Scalar a)
``` It is physically meaningless to speak of the unit vector corresponding
to a point.
------ Setting individual elements present in coordinate system ------

Change X - Cartesian2D coordinates only

```
PositionVector2D<CoordSystem, Tag>& SetY(ROOT::Math::PositionVector2D<ROOT::Math::Polar2D<double>,ROOT::Math::DefaultCoordinateSystemTag>::Scalar a)
```          Change Y - Cartesian2D coordinates only

```
PositionVector2D<CoordSystem, Tag>& SetR(ROOT::Math::PositionVector2D<ROOT::Math::Polar2D<double>,ROOT::Math::DefaultCoordinateSystemTag>::Scalar a)
```          Change R - Polar2D coordinates only

```
PositionVector2D<CoordSystem, Tag>& SetPhi(ROOT::Math::PositionVector2D<ROOT::Math::Polar2D<double>,ROOT::Math::DefaultCoordinateSystemTag>::Scalar ang)
```          Change Phi - Polar2D coordinates

```

```          Rotate by an angle

```
Scalar x() const
``` Limited backward name compatibility with CLHEP
```
`{ return fCoordinates.X(); }`
Scalar y() const
`{ return fCoordinates.Y(); }`
Scalar phi() const
`{ return fCoordinates.Phi(); }`
Scalar mag2() const
`{ return fCoordinates.Mag2(); }`