Angle
template<typename T>
struct Angle;
Angle is a wrapper type around a representation that helps manage angles in a consistent manner.
Angle values are always kepts within the ]-PI, PI] range at all times.
Member types
Member Type | Definition |
---|---|
value_type |
T |
Member functions
Member | Behavior |
---|---|
(destructor) | does nothing |
operator= | ovewrite the angle with another angle |
from_deg | new angle from a degree value |
from_rad | new angle from a radian value |
as_deg | get the angle value as radians |
as_rad | get the angle value as degrees |
Non-member functions
Language support
Function | Behavior |
---|---|
operator<< | print to stream |
Binary operations
Function | Behavior |
---|---|
operator== | compares two angles for equality |
operator!= | compares two angles for inequality |
operator< | compares two angles |
operator<= | compares two angles |
operator> | compares two angles |
operator>= | compares two angles |
operator-= | in-place diff angles |
operator+= | in-place add angles |
operator- | diff angles |
operator+ | add angles |
operator*= | in-place scale angle |
operator/= | in-place scale angle |
operator* | scale angle |
operator/ | scale angle |
Unary operations
Function | Behavior |
---|---|
operator-(unary) | negation |
Trigonometric functions
Function | Behavior |
---|---|
sin | sine |
cos | cosine |
tan | tangent |
Advanced/unsafe functions
Member | Behavior |
---|---|
raw | gets the raw internal value of the angle |
from_clamped_deg | unsafe new angle from a degree value |
from_clamped_rad | unsafe new angle from a radian value |