Class Polar#

Class Documentation#

class Polar#

Polar coordinate representation.

Polar represents a tupel from C in polar coordinate form.

Authors

beyss, stratmann

Date

03.07.2018

Public Functions

inline Polar(double radius = 0, Angle angle = 0)#

Creates a Polar coordinate from a given radius and angle.

Parameters:
  • r – the radius

  • phi – the angle

inline bool operator==(const Polar &rhs) const#

Equal to operator checking for equality of radius and angle.

Parameters:

rhs – the other Polar

Returns:

if equal or not

inline const double &radius() const#

Access function for this Polar’s radius as readonly.

Returns:

a constant reference to this Polar’s radius

inline double &radius()#

Access function for this Polar’s radius.

Returns:

a reference to this Polar’s radius

inline const Angle &angle() const#

Access function for this Polar’s m_angle readonly.

Returns:

a constant reference to the Angle

inline Angle &angle()#

Access function for this Polar’s m_angle.

Returns:

a reference to the Angle

Public Static Functions

static inline Polar interpolate(const Polar &p1, const Polar &p2, double p)#

interpolate

Returns an Polar whose radius and Angle are (1-p) percent of p1’s and p percent of p2’s radius and Angle. To be consistent, p should be in [0,1].

Parameters:
  • p1 – the first Polar

  • p2 – the second Polar

  • p – the percentage

Returns:

the interpolated Polar

static inline Polar center(const Polar &p1, const Polar &p2)#

center

Returns a Polar centered between two given Polars.

Parameters:
Returns:

the centered Polar