1 #ifndef AWFUL_MATH_VECTOR2_H_
2 #define AWFUL_MATH_VECTOR2_H_
6 namespace awful
{ namespace math
16 Vector2( float x_
, float y_
) :
22 float& x() { return m_x
; }
23 float& y() { return m_y
; }
24 const float& x() const { return m_x
; }
25 const float& y() const { return m_y
; }
27 Vector2
operator+( const Vector2
& b
) const
29 return Vector2( m_x
+ b
.m_x
, m_y
+ b
.m_y
);
32 Vector2
operator-( const Vector2
& b
) const
34 return Vector2( m_x
- b
.m_x
, m_y
- b
.m_y
);
37 const Vector2
& operator+=( const Vector2
& b
)
44 const Vector2
& operator-=( const Vector2
& b
)
51 bool operator==( const Vector2
& b
) const
53 return m_x
== b
.m_x
&& m_y
== b
.m_y
;