Megadocs 0.0.1
All of megapop's internal libraries
Megapop.MegaCore.Math2D Class Reference

Static Public Member Functions

static Vector2 Average (this IList< Vector2 > points)
 Find the average point More...
 
static Vector2 NormalizedDirection (Vector2 start, Vector2 end)
 
static Vector2 Intersection (Vector2 a1, Vector2 a2, Vector2 b1, Vector2 b2, out bool found)
 Find the intersection point between a vector going through a1 and a2, and a vector going through b1 and b2. More...
 
static float ChordLength (float radius, float degrees)
 Calculates the chord length of a circle segment. More...
 
static Vector2 ClosestPointOnLineSegment (Vector2 segmentStart, Vector2 segmentEnd, Vector2 point)
 
static Vector2 ClosestPointOnLineSegment (Vector2 segmentStart, Vector2 segmentEnd, Vector2 point, out float t)
 
static Vector2 DirectionFromAngle (float radians)
 Returns a normalized direction vector representing the rotation More...
 
static float AngleSigned (Vector2 a, Vector2 b)
 
static float Angle (Vector2 a, Vector2 b)
 
static Vector2 Rotate (Vector2 v, float radians)
 
static bool Approximately (Vector2 v1, Vector2 v2)
 Return true if v1 and v2 are equal, or different but very close. TODO: Better implementation More...
 

Member Function Documentation

◆ Angle()

static float Megapop.MegaCore.Math2D.Angle ( Vector2  a,
Vector2  b 
)
inlinestatic

◆ AngleSigned()

static float Megapop.MegaCore.Math2D.AngleSigned ( Vector2  a,
Vector2  b 
)
inlinestatic

◆ Approximately()

static bool Megapop.MegaCore.Math2D.Approximately ( Vector2  v1,
Vector2  v2 
)
inlinestatic

Return true if v1 and v2 are equal, or different but very close. TODO: Better implementation

◆ Average()

static Vector2 Megapop.MegaCore.Math2D.Average ( this IList< Vector2 >  points)
inlinestatic

Find the average point

◆ ChordLength()

static float Megapop.MegaCore.Math2D.ChordLength ( float  radius,
float  degrees 
)
inlinestatic

Calculates the chord length of a circle segment.

◆ ClosestPointOnLineSegment() [1/2]

static Vector2 Megapop.MegaCore.Math2D.ClosestPointOnLineSegment ( Vector2  segmentStart,
Vector2  segmentEnd,
Vector2  point 
)
inlinestatic

◆ ClosestPointOnLineSegment() [2/2]

static Vector2 Megapop.MegaCore.Math2D.ClosestPointOnLineSegment ( Vector2  segmentStart,
Vector2  segmentEnd,
Vector2  point,
out float  t 
)
inlinestatic

◆ DirectionFromAngle()

static Vector2 Megapop.MegaCore.Math2D.DirectionFromAngle ( float  radians)
inlinestatic

Returns a normalized direction vector representing the rotation

◆ Intersection()

static Vector2 Megapop.MegaCore.Math2D.Intersection ( Vector2  a1,
Vector2  a2,
Vector2  b1,
Vector2  b2,
out bool  found 
)
inlinestatic

Find the intersection point between a vector going through a1 and a2, and a vector going through b1 and b2.

◆ NormalizedDirection()

static Vector2 Megapop.MegaCore.Math2D.NormalizedDirection ( Vector2  start,
Vector2  end 
)
inlinestatic

◆ Rotate()

static Vector2 Megapop.MegaCore.Math2D.Rotate ( Vector2  v,
float  radians 
)
inlinestatic

The documentation for this class was generated from the following file: