4 * Created on: Aug 6, 2012
8 #ifndef GEOMETRY_OPERATORS_H_
9 #define GEOMETRY_OPERATORS_H_
17 inline Vector<T> operator +(const Vector<T> &lhs, const Vector<T> &rhs) {
18 return Vector<T>(lhs.X() + rhs.X(), lhs.Y() + rhs.Y());
21 inline Point<T> operator +(const Point<T> &lhs, const Vector<T> &rhs) {
22 return Point<T>(lhs.X() + rhs.X(), lhs.Y() + rhs.Y());
26 inline Vector<T> operator -(const Vector<T> &lhs, const Vector<T> &rhs) {
27 return Vector<T>(lhs.X() - rhs.X(), lhs.Y() - rhs.Y());
30 inline Point<T> operator -(const Point<T> &lhs, const Vector<T> &rhs) {
31 return Point<T>(lhs.X() - rhs.X(), lhs.Y() - rhs.Y());
35 inline Vector<T> operator -(const Vector<T> &v) {
36 return Vector<T>(-v.X(), -v.Y());
41 #endif /* GEOMETRY_OPERATORS_H_ */