-
Notifications
You must be signed in to change notification settings - Fork 0
/
mathvector.h
73 lines (47 loc) · 1.08 KB
/
mathvector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef MATHVECTOR_H
#define MATHVECTOR_H
#include <math.h>
#include <SFML/Graphics.hpp>
class MathVector
{
private:
double vectorArray[2];
public:
~MathVector();
MathVector()
{
vectorArray[0] = 0;
vectorArray[1] = 0;
}
MathVector(double value1, double value2);
MathVector(sf::Vector2f);
double getX();
double getY();
MathVector addVectors(MathVector inputVector);
MathVector subtractVectors(MathVector inputVector);
MathVector addX(double x);
MathVector addY(double y);
MathVector subtractX(double x);
MathVector subtractY(double y);
double magnitude();
double angle(MathVector &vector);
double dotProduct(MathVector &vector);
double wedgeProduct(MathVector &vector);
double crossProduct(MathVector vector);
/* {
if(type == 0)
{
return MathVector(inScalar*vectorArray[1],-inScalar*vectorArray[0]);
} else
{
return MathVector(-inScalar*vectorArray[1],inScalar*vectorArray[0]);
}
}
*/
MathVector toUnit();
MathVector negate();
MathVector multiply(double scalar);
MathVector perpendicular();
sf::Vector2f toSFMLVector();
};
#endif