cleaned make file, removed allegro stuff, fixed entity name space issues
[physics.git] / src / mathw.cpp
CommitLineData
ad9f1fb6
PG
1#include "mathw.h"
2
3
4/// ***** Private Varibles *****
5
6const float PI = 3.141592653;
7
8
9/// ***** Public Methods *****
10
11int mod(int x, int y)
12{
13 return x % y + (x < 0 ? y : 0);
14}
15
ad9f1fb6
PG
16/// Vector2 Math
17
18Vector2 perp(const Vector2& vec)
19{
20 return Vector2(-vec.y, vec.x);
21}
22
23float dot(const Vector2& vec1, const Vector2& vec2)
24{
25 return vec1.x * vec2.x + vec1.y * vec2.y;
26}
27
28//TODO float Vector2::projectionCoeff(const Vector2* vec) const;
29//TODO Vector2* Vector2::projection(const Vector2* vec) const;
30