Skip to content

mp_units::utility::polar_vector

A 2-D polar coordinate facade: a scalar-quantity radius r and an angle theta from the +x axis (counter-clockwise).

Synopsis

Declared in <mp-units/utility/polar_vector.h>

template<
  /* implementation-defined */ auto RadiusRef,
  /* implementation-defined */ auto AngleUnit = si::radian, std::floating_point Rep = double>
class polar_vector;

Description

RadiusRef is the radius reference - a unit like si::metre, or a quantity_spec[unit] like isq::radius[m]; AngleUnit is the stored angle unit (default si::radian; SI's degree/arcminute and the opt-in strong angular system are also accepted); Rep is the numeric type. The radius is stored as quantity<RadiusRef, Rep>. Construct from native parts or explicitly from a 2-D vector quantity, and convert back with to_cartesian().

Type Aliases

Member Functions

NameDescription
polar_vector [constructor]Constructors
magnitude
radius
rotated_by
theta
to_cartesian

Data Members

Name
_r_
_theta_

Static Data Members

Deduction Guides

Friends