7 Vector(float nx, float ny)
10 Vector(const Vector& other)
11 : x(other.x), y(other.y)
17 bool operator ==(const Vector& other) const
19 return x == other.x && y == other.y;
22 const Vector& operator=(const Vector& other)
29 Vector operator+(const Vector& other) const
31 return Vector(x + other.x, y + other.y);
34 Vector operator-(const Vector& other) const
36 return Vector(x - other.x, y - other.y);
39 Vector operator*(float s) const
41 return Vector(x * s, y * s);
44 Vector operator/(float s) const
46 return Vector(x / s, y / s);
49 const Vector& operator +=(const Vector& other)
56 // scalar product of 2 vectors
57 float operator*(const Vector& other) const
59 return x*other.x + y*other.y;
65 // ... add the other operators as needed, I'm too lazy now ...
67 float x, y; // leave this public, get/set methods just give me headaches
68 // for such simple stuff :)