]> git.localhorst.tv Git - l2e.git/blobdiff - src/geometry/operators.h
merged Point into Vector
[l2e.git] / src / geometry / operators.h
diff --git a/src/geometry/operators.h b/src/geometry/operators.h
deleted file mode 100644 (file)
index 295daa1..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * operators.h
- *
- *  Created on: Aug 6, 2012
- *      Author: holy
- */
-
-#ifndef GEOMETRY_OPERATORS_H_
-#define GEOMETRY_OPERATORS_H_
-
-#include "Point.h"
-#include "Vector.h"
-
-#include <ostream>
-
-namespace geometry {
-
-template<class T>
-inline Vector<T> operator +(const Vector<T> &lhs, const Vector<T> &rhs) {
-       return Vector<T>(lhs.X() + rhs.X(), lhs.Y() + rhs.Y());
-}
-template<class T>
-inline Point<T> operator +(const Point<T> &lhs, const Vector<T> &rhs) {
-       return Point<T>(lhs.X() + rhs.X(), lhs.Y() + rhs.Y());
-}
-
-template<class T>
-inline Vector<T> &operator +=(Vector<T> &lhs, const Vector<T> &rhs) {
-       return lhs = lhs + rhs;
-}
-template<class T>
-inline Point<T> &operator +=(Point<T> &lhs, const Vector<T> &rhs) {
-       return lhs = lhs + rhs;
-}
-
-template<class T>
-inline Vector<T> operator -(const Vector<T> &lhs, const Vector<T> &rhs) {
-       return Vector<T>(lhs.X() - rhs.X(), lhs.Y() - rhs.Y());
-}
-template<class T>
-inline Point<T> operator -(const Point<T> &lhs, const Vector<T> &rhs) {
-       return Point<T>(lhs.X() - rhs.X(), lhs.Y() - rhs.Y());
-}
-
-template<class T>
-inline Vector<T> &operator -=(Vector<T> &lhs, const Vector<T> &rhs) {
-       return lhs = lhs - rhs;
-}
-template<class T>
-inline Point<T> &operator -=(Point<T> &lhs, const Vector<T> &rhs) {
-       return lhs = lhs - rhs;
-}
-
-template<class T>
-inline Vector<T> operator -(const Vector<T> &v) {
-       return Vector<T>(-v.X(), -v.Y());
-}
-
-template<class T>
-inline std::ostream &operator <<(std::ostream &out, const Point<T> &p) {
-       out << '(' << p.X() << ", " << p.Y() << ')';
-       return out;
-}
-template<class T>
-inline std::ostream &operator <<(std::ostream &out, const Vector<T> &v) {
-       out << '<' << v.X() << ", " << v.Y() << '>';
-       return out;
-}
-
-}
-
-#endif /* GEOMETRY_OPERATORS_H_ */