2018-01-09 13:22:10 +01:00
|
|
|
#ifndef __vector_h__
|
|
|
|
#define __vector_h__
|
|
|
|
|
|
|
|
// Structs
|
|
|
|
typedef struct vectorStruct {
|
|
|
|
double x, y;
|
|
|
|
} Vector;
|
|
|
|
// End Structs
|
|
|
|
|
|
|
|
// Prototypes
|
2018-01-20 10:56:52 +01:00
|
|
|
Vector VECTOR_ScaleBy(Vector v, double factor);
|
|
|
|
double VECTOR_GetMagnitude(Vector v);
|
|
|
|
double VECTOR_GetRotation(Vector v);
|
|
|
|
Vector VECTOR_ChangeScaleTo(Vector v, double magnitude);
|
|
|
|
double VECTOR_DotProduct(Vector v1, Vector v2);
|
|
|
|
double VECTOR_Distance(Vector v1, Vector v2);
|
|
|
|
Vector VECTOR_Add(Vector v1, Vector v2);
|
|
|
|
Vector VECTOR_Subtract(Vector v1, Vector v2);
|
2018-01-09 13:22:10 +01:00
|
|
|
double degreeSin(double x);
|
|
|
|
double degreeCos(double x);
|
2018-01-20 10:56:52 +01:00
|
|
|
Vector VECTOR_GetDirectionalUnitVector(double rotation);
|
|
|
|
Vector VECTOR_GetScaledDirectionalUnitVector(double rotation, double Magnitude);
|
|
|
|
Vector VECTOR_GetScaledVectorFromTo(Vector from, Vector to, double Magnitude);
|
2018-01-21 15:33:09 +01:00
|
|
|
Vector VECTOR_GetVectorFromTo(Vector from, Vector to);
|
2018-01-09 13:22:10 +01:00
|
|
|
// End Prototypes
|
|
|
|
|
|
|
|
#endif // __vector_h__
|