49 : x(that.x), y(that.y)
120 return (
value_type)sqrt( (p.
x - x)*(p.
x - x) + (p.
y - y)*(p.
y - y) );
136 (x - center.
x) * std::cos(angle) - (y - center.
y) * std::sin(angle);
138 (x - center.
x) * std::sin(angle) + (y - center.
y) * std::cos(angle);
152 return std::atan2( to.
y - y, to.
x - x );
163 return (x == that.
x) && (y == that.
y);
174 return !(*
this == that);
303 template<
typename T,
typename U>
305 claw::math::operator*( U v,
const coordinate_2d<T>&
self )
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.
void set(const value_type &_x, const value_type &_y)
Sets new values to the coordinate.
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.