|
CelestialCalendar 1.0.0 · unreleased development @ 67a7c4c79a4a4a6aa7e703c9e6f0039ae34bee82
|
Represents an angle. More...
#include <toolbox.hpp>
Public Member Functions | |
| constexpr | Angle (const double value) |
| template<AngleUnit As> | |
| constexpr | operator Angle< As > () const |
| Convert to the other unit — explicit, so a unit change never happens silently. | |
| constexpr auto | operator+ (const Angle< Unit > &other) const -> Angle< Unit > |
| constexpr auto | operator- (const Angle< Unit > &other) const -> Angle< Unit > |
| constexpr auto | operator- () const -> Angle< Unit > |
| constexpr auto | operator* (const double other) const -> Angle< Unit > |
| constexpr auto | operator/ (const double other) const -> Angle< Unit > |
| Divide the angle by a bare (dimensionless) factor. | |
| template<AngleUnit As> | |
| constexpr auto | as () const -> double |
| Convert the angle to another unit. | |
| constexpr auto | normalize () const -> Angle< Unit > |
| Normalize the angle to [0, 360) / [0, 2π), depending on the angle's unit. | |
| constexpr auto | deg () const -> double |
| Return the angle in degrees. | |
| constexpr auto | rad () const -> double |
| Return the angle in radians. | |
Static Public Member Functions | |
| static constexpr auto | from_arcmin (const double value) -> Angle< Unit > |
| Build an angle from a count of arcminutes, carried in this angle's own unit. | |
| static constexpr auto | from_arcsec (const double value) -> Angle< Unit > |
| Build an angle from a count of arcseconds, carried in this angle's own unit. | |
Represents an angle.
| Unit | The angle's unit, either degree or radian. |
|
inlineexplicitconstexpr |
|
inlinenodiscardconstexpr |
Convert the angle to another unit.
| As | The unit to convert to. |
|
inlinenodiscardconstexpr |
Return the angle in degrees.
|
inlinestaticnodiscardconstexpr |
Build an angle from a count of arcminutes, carried in this angle's own unit.
|
inlinestaticnodiscardconstexpr |
Build an angle from a count of arcseconds, carried in this angle's own unit.
|
inlinenodiscardconstexpr |
Normalize the angle to [0, 360) / [0, 2π), depending on the angle's unit.
| std::invalid_argument | If the angle is not finite — inherited from normalize_deg / normalize_rad. |
|
inlineexplicitconstexpr |
Convert to the other unit — explicit, so a unit change never happens silently.
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
Divide the angle by a bare (dimensionless) factor.
| std::invalid_argument | if the divisor is zero — an infinite angle is never the intent (#48). |
|
inlinenodiscardconstexpr |
Return the angle in radians.