breakout/vector.h

28 lines
872 B
C
Raw Permalink Normal View History

#ifndef __vector_h__
#define __vector_h__
// Structs
typedef struct vectorStruct {
double x, y;
} Vector;
// End Structs
// Prototypes
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);
double degreeSin(double x);
double degreeCos(double x);
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);
// End Prototypes
#endif // __vector_h__