9namespace LinearAlgebra {
11static float pi = 3.1415927410125732421875F;
13static float Rad2Deg = 360.0f / (pi * 2);
14static float Deg2Rad = (pi * 2) / 360.0f;
220using namespace Passer::LinearAlgebra;
An angle in various representations.
Definition Angle.h:21
AngleOf< T > operator-() const
Negate the angle.
Definition Angle.cpp:69
static float Cos(AngleOf< T > angle)
Calculates the cosine of an angle.
Definition Angle.cpp:166
static const AngleOf< T > zero
An zero value angle.
Definition Angle.h:27
static AngleOf< T > SineRuleAngle(float a, AngleOf< T > beta, float c)
Computes the angle of a corner using the rule of sines.
Definition Angle.cpp:264
static float Tan(AngleOf< T > angle)
Calculates the tangent of an angle.
Definition Angle.cpp:172
bool operator<(AngleOf< T > angle) const
Tests if this angle is less than the given angle.
Definition Angle.cpp:44
static AngleOf< T > Radians(float radians)
Creates an angle in radians.
float InDegrees() const
Get the angle value in degrees.
T GetBinary() const
Get the raw value for the angle.
Definition Angle.cpp:26
static AngleOf< T > Atan(float f)
Calculates the arc tangent angle.
Definition Angle.cpp:182
static AngleOf< T > CosineRuleAngle(float a, float b, float c)
Computes the angle of a corner using the rule of cosines.
Definition Angle.cpp:239
void SetBinary(T rawValue)
Set the raw value of the angle.
Definition Angle.cpp:27
AngleOf()
Create a new angle with a zero value.
Definition Angle.cpp:14
friend AngleOf< T > operator*(float factor, const AngleOf< T > &angle)
Multiplies the angle.
Definition Angle.h:124
static AngleOf< T > MoveTowards(AngleOf< T > fromAngle, AngleOf< T > toAngle, float maxAngle)
Rotates an angle towards another angle with a max distance.
Definition Angle.cpp:154
bool operator<=(AngleOf< T > angle) const
Tests if this angle is less than or equal to the given angle.
Definition Angle.cpp:48
void Normalize()
Normalizes the angle to (-180..180] or (-PI..PI] Should not be needed but available in case it is.
Definition Angle.cpp:123
bool operator>=(AngleOf< T > angle) const
Tests if this angle is greater than or equal to the given angle.
Definition Angle.cpp:40
static AngleOf< T > Degrees(float degrees)
Creates an angle in degrees.
static AngleOf< T > Abs(AngleOf< T > angle)
Returns the magnitude of the angle.
Definition Angle.cpp:62
static AngleOf< T > Binary(T rawValue)
Creates an angle from a raw value.
Definition Angle.cpp:20
float InRadians() const
Get the angle value in radians.
static AngleOf< T > Asin(float f)
Calculates the arc sine angle.
Definition Angle.cpp:179
AngleOf< T > operator+=(const AngleOf< T > &angle)
Add another angle to this angle.
Definition Angle.cpp:106
static signed int Sign(AngleOf< T > angle)
Returns the sign of the angle.
Definition Angle.cpp:53
friend AngleOf< T > operator*(const AngleOf< T > &angle, float factor)
Mutliplies the angle.
Definition Angle.h:117
bool operator==(const AngleOf< T > angle) const
Tests whether this angle is equal to the given angle.
Definition Angle.cpp:32
static AngleOf< T > Acos(float f)
Calculates the arc cosine angle.
Definition Angle.cpp:176
bool operator>(AngleOf< T > angle) const
Tests if this angle is greater than the given angle.
Definition Angle.cpp:36
static float CosineRuleSide(float a, float b, AngleOf< T > gamma)
Computes the length of a side using the rule of cosines.
Definition Angle.cpp:209
static AngleOf< T > Atan2(float y, float x)
Calculates the tangent for the given values.
Definition Angle.cpp:187
AngleOf< T > operator+(const AngleOf< T > &angle) const
Add another angle from this angle.
Definition Angle.cpp:93
static AngleOf< T > Clamp(AngleOf< T > angle, AngleOf< T > min, AngleOf< T > max)
Clamps the angle value between the two given angles.
Definition Angle.cpp:148
static float Sin(AngleOf< T > angle)
Calculates the sine of an angle.
Definition Angle.cpp:169