Main   GitHub

Functions
Vector2Math

Functions

string Vector2Abs (Vector2 v1, Vector2 v2)
 
string Vector2Add (Vector2 v1, Vector2 v2)
 
float Vector2AngleBetween (Vector2 v1, Vector2 v2)
 
float Vector2AngleToPoint (Vector2 p1, Vector2 p1)
 
string Vector2AreaNormalize (Vector2 v1, Vector2 v2)
 
bool Vector2Compare (Vector2 p1, Vector2 p2,[epsilon])
 
string Vector2Direction (F32 angle, F32 magnitude)
 
float Vector2Distance (Vector2 p1, Vector2 p2)
 
float Vector2Dot (Vector2 v1, Vector2 v2)
 
string Vector2Inverse (Vector2 v1)
 
string Vector2InverseX (Vector2 v1)
 
string Vector2InverseY (Vector2 v1)
 
float Vector2Length (Vector2 v1)
 
string Vector2Mult (Vector2 v1, Vector2 v2)
 
string Vector2Normalize (Vector2 v1)
 
string Vector2Scale (Vector2 v1, scale)
 
string Vector2Sub (Vector2 v1, Vector2 v2)
 

Detailed Description

Vector2 math functions.

Function Documentation

string Vector2Abs ( Vector2  v1,
Vector2  v2 
)
  • Returns abs(v1-v2).
string Vector2Add ( Vector2  v1,
Vector2  v2 
)
  • Returns v1+v2.
float Vector2AngleBetween ( Vector2  v1,
Vector2  v2 
)
  • Returns the angle between v1 and v2.
float Vector2AngleToPoint ( Vector2  p1,
Vector2  p1 
)
  • Returns the angle from p1 to p2.
string Vector2AreaNormalize ( Vector2  v1,
Vector2  v2 
)
  • Returns Normalize rectangle of v1 and v2.
bool Vector2Compare ( Vector2  p1,
Vector2  p2 
)
  • Compares points p1 and p2 with optional difference (epsilon).
string Vector2Direction ( F32  angle,
F32  magnitude 
)
  • Calculates a direction from an angle and magnitude.
    Parameters
    angleThe angle of the direction.
    magnitudeThe magnitude of the direction.
    Returns
    No return value.
float Vector2Distance ( Vector2  p1,
Vector2  p2 
)
  • Returns the distance between points p1 and p2.
float Vector2Dot ( Vector2  v1,
Vector2  v2 
)
  • Returns dot-product of v1 and v2.
string Vector2Inverse ( Vector2  v1)
  • Returns the inverse of v1.
string Vector2InverseX ( Vector2  v1)
  • Returns the inverse of the v1 X component.
string Vector2InverseY ( Vector2  v1)
  • Returns the inverse of the v1 Y component.
float Vector2Length ( Vector2  v1)
  • Returns the length of v1.
string Vector2Mult ( Vector2  v1,
Vector2  v2 
)
  • Returns v1 mult v2.
string Vector2Normalize ( Vector2  v1)
  • Returns Normalized v1.
string Vector2Scale ( Vector2  v1,
scale   
)
  • Returns v1 scaled by scale.
string Vector2Sub ( Vector2  v1,
Vector2  v2 
)
  • Returns v1-v2.


Copyright © 2013 GarageGames, LLC. All Rights Reserved.