~brandontschaefer/nux/xim-tests

« back to all changes in this revision

Viewing changes to NuxCore/Math/Point2D-inl.h

  • Committer: Brandon Schaefer
  • Date: 2012-08-22 18:56:57 UTC
  • mfrom: (637.2.13 nux)
  • Revision ID: brandontschaefer@gmail.com-20120822185657-l37rclu7dcgyalvh
* Merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    return !(lhs == rhs);
29
29
  }
30
30
 
 
31
  template<typename T>
 
32
  Point2D<T> operator -(const Point2D<T>& lhs, const Point2D<T>& rhs)
 
33
  {
 
34
    return Point2D<T>(lhs.x - rhs.x, lhs.y - rhs.y);
 
35
  }
 
36
 
 
37
  template<typename T>
 
38
  Point2D<T> operator +(const Point2D<T>& lhs, const Point2D<T>& rhs)
 
39
  {
 
40
    return Point2D<T>(lhs.x + rhs.x, lhs.y + rhs.y);
 
41
  }
 
42
 
 
43
  template<typename T, typename S>
 
44
  Point2D<T> operator *(const Point2D<T>& lhs, S rhs)
 
45
  {
 
46
    return Point2D<T>(lhs.x * rhs, lhs.y * rhs);
 
47
  }
 
48
 
 
49
  template<typename T, typename S>
 
50
  Point2D<T> operator *(S lhs, const Point2D<T>& rhs)
 
51
  {
 
52
    return Point2D<T>(rhs.x * lhs, rhs.y * lhs);
 
53
  }
 
54
 
31
55
}
32
56
 
33
57