30 #ifndef __CLAW_COORDINATE_2D_HPP__
31 #define __CLAW_COORDINATE_2D_HPP__
92 template<
typename T,
typename U>
100 #endif // __CLAW_COORDINATE_2D_HPP__
void rotate(const self_type ¢er, double angle)
Rotate this point around an other point.
T value_type
The type of the values we store.
Implementation of claw::math::coordinate_2d class.
void set(const value_type &_x, const value_type &_y)
Sets new values to the coordinate.
coordinate_2d< value_type > self_type
The type of the current class.
coordinate_2d()
Constructor.
self_type & operator*=(const value_type &v)
Multiply the coordinates.
bool operator==(const self_type &vect) const
Equality operator.
self_type & operator+=(const self_type &vect)
Add a coordinate.
self_type operator-(const self_type &vect) const
Subtraction.
Coordinates in a two dimensional space.
self_type operator*(const value_type &v) const
Multiplication.
self_type operator+(const self_type &vect) const
Addition.
self_type operator/(const value_type &v) const
Division.
bool operator!=(const self_type &vect) const
Difference operator.
value_type y
Y-coordinate.
self_type & operator-=(const self_type &vect)
Subtract a coordinate.
self_type & operator/=(const value_type &v)
Divide the coordinates.
value_type distance(const self_type &p) const
Get the distance separing two coordinates.
double slope_angle(const self_type &to) const
Get the angle of the slope starting from this and ending with an other coordinate.
value_type x
X-coordinate.