summaryrefslogtreecommitdiffstats
path: root/Vertex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Vertex.cpp')
-rw-r--r--Vertex.cpp55
1 files changed, 0 insertions, 55 deletions
diff --git a/Vertex.cpp b/Vertex.cpp
deleted file mode 100644
index 6e1f26b..0000000
--- a/Vertex.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-#include "Vertex.h"
-#include <math.h>
-
-float Vertex::distanceSq(const Vertex &v) const {
- return (x - v.x)*(x - v.x) + (y - v.y)*(y - v.y);
-}
-
-float Vertex::distance(const Vertex &v) const {
- return sqrtf(distanceSq(v));
-}
-
-
-Vertex Vertex::operator+(const Vertex &v) const {
- return Vertex(x + v.x, y + v.y);
-}
-
-Vertex Vertex::operator-(const Vertex &v) const {
- return Vertex(x - v.x, y - v.y);
-}
-
-Vertex Vertex::operator*(float f) const {
- return Vertex(x*f, y*f);
-}
-
-Vertex Vertex::operator/(float f) const {
- return Vertex(x/f, y/f);
-}
-
-Vertex& Vertex::operator+=(const Vertex &v) {
- x += v.x;
- y += v.y;
-
- return *this;
-}
-
-Vertex& Vertex::operator-=(const Vertex &v) {
- x -= v.x;
- y -= v.y;
-
- return *this;
-}
-
-Vertex& Vertex::operator*=(float f) {
- x *= f;
- y *= f;
-
- return *this;
-}
-
-Vertex& Vertex::operator/=(float f) {
- x /= f;
- y /= f;
-
- return *this;
-}