Roboid Control for C# 0.4
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
LinearAlgebra.Angles Class Reference

Detailed Description

Angle utilities

Static Public Member Functions

static float Difference (float a, float b)
 Determine the angle difference, result is a normalized angle.
 
static float Normalize (float angle)
 Normalize an angle to the range -180 < angle <= 180.
 
static float ToFactor (Vector2 v1, Vector2 v2)
 Map interval of angles between vectors [0..Pi] to interval [0..1].
 

Static Public Attributes

const float pi = 3.1415927410125732421875F
 

Member Function Documentation

◆ Difference()

static float LinearAlgebra.Angles.Difference ( float  a,
float  b 
)
static

Determine the angle difference, result is a normalized angle.

Parameters
aFirst first angle
bThe second angle
Returns
the angle between the two angles

Angle values should be degrees

◆ Normalize()

static float LinearAlgebra.Angles.Normalize ( float  angle)
static

Normalize an angle to the range -180 < angle <= 180.

Parameters
angleThe angle to normalize
Returns
The normalized angle in interval (-180..180]

Angle values should be in degrees

◆ ToFactor()

static float LinearAlgebra.Angles.ToFactor ( Vector2  v1,
Vector2  v2 
)
static

Map interval of angles between vectors [0..Pi] to interval [0..1].

Parameters
v1The first vector
v2The second vector
Returns
The resulting factor in interval [0..1]

Vectors a and b must be normalized

Deprecated:
Please use Vector2.ToFactor instead.