|
sandbox
|
Unified angle type stored internally in radians. More...
#include <angle.hpp>
Public Types | |
| using | value_type = Type |
| Underlying scalar value type. | |
Public Member Functions | |
| constexpr | basic_angle (const basic_degree< value_type > °ree) noexcept |
| Constructs an angle from a degree value. More... | |
| constexpr | basic_angle (const basic_radian< value_type > &radian) noexcept |
| Constructs an angle from a radian value. More... | |
| template<floating_point Other> requires (std::is_convertible_v<Other, Type>) | |
| constexpr | basic_angle (const basic_angle< Other > &other) noexcept |
| Constructs an angle from another angle type. More... | |
| template<floating_point Other> requires (std::is_convertible_v<Other, Type>) | |
| constexpr auto | operator+= (const basic_angle< Other > &other) noexcept -> basic_angle< Type > & |
| Adds another angle to this angle. More... | |
| template<floating_point Other> requires (std::is_convertible_v<Other, Type>) | |
| constexpr auto | operator+= (const basic_degree< Other > &other) noexcept -> basic_angle< Type > & |
| Adds a degree value to this angle. More... | |
| template<floating_point Other> requires (std::is_convertible_v<Other, Type>) | |
| constexpr auto | operator+= (const basic_radian< Other > &other) noexcept -> basic_angle< Type > & |
| Adds a radian value to this angle. More... | |
| template<floating_point Other> requires (std::is_convertible_v<Other, Type>) | |
| constexpr auto | operator-= (const basic_angle< Other > &other) noexcept -> basic_angle< Type > & |
| Subtracts another angle from this angle. More... | |
| template<floating_point Other> requires (std::is_convertible_v<Other, Type>) | |
| constexpr auto | operator-= (const basic_degree< Other > &other) noexcept -> basic_angle< Type > & |
| Subtracts a degree value from this angle. More... | |
| template<floating_point Other> requires (std::is_convertible_v<Other, Type>) | |
| constexpr auto | operator-= (const basic_radian< Other > &other) noexcept -> basic_angle< Type > & |
| Subtracts a radian value from this angle. More... | |
| template<floating_point Other> requires (std::is_convertible_v<Other, Type>) | |
| constexpr auto | operator*= (const Other other) noexcept -> basic_angle< Type > & |
| Scales this angle by a floating point factor. More... | |
| constexpr auto | to_degrees () const noexcept -> basic_degree< value_type > |
| Converts this angle to degrees. More... | |
| constexpr auto | to_radians () const noexcept -> basic_radian< value_type > |
| Converts this angle to radians. More... | |
Unified angle type stored internally in radians.
This type provides explicit construction from degrees or radians, supports arithmetic, and provides unit conversion helpers.
| Type | Floating-point storage type. |
|
constexprnoexcept |
Constructs an angle from a degree value.
| degree | Angle expressed in degrees. |
|
constexprnoexcept |
Constructs an angle from a radian value.
| radian | Angle expressed in radians. |
|
constexprnoexcept |
Constructs an angle from another angle type.
| Other | Floating-point storage type of the source. |
| other | Source angle. |
|
constexprnoexcept |
Scales this angle by a floating point factor.
| Other | Floating-point type convertible to value_type. |
| other | Scale factor. |
|
constexprnoexcept |
Adds another angle to this angle.
| Other | Floating-point storage type of the operand. |
| other | Angle to add. |
|
constexprnoexcept |
Adds a degree value to this angle.
| Other | Floating-point storage type of the operand. |
| other | Degree value to add. |
|
constexprnoexcept |
Adds a radian value to this angle.
| Other | Floating-point storage type of the operand. |
| other | Radian value to add. |
|
constexprnoexcept |
Subtracts another angle from this angle.
| Other | Floating-point storage type of the operand. |
| other | Angle to subtract. |
|
constexprnoexcept |
Subtracts a degree value from this angle.
| Other | Floating-point storage type of the operand. |
| other | Degree value to subtract. |
|
constexprnoexcept |
Subtracts a radian value from this angle.
| Other | Floating-point storage type of the operand. |
| other | Radian value to subtract. |
|
constexprnoexcept |
Converts this angle to degrees.
|
constexprnoexcept |
Converts this angle to radians.