14 #ifndef _BOARD_POINT_H_ 15 #define _BOARD_POINT_H_ 18 #include "DGtal/io/Color.h" 51 Point(
double xc,
double yc ):x(xc),y(yc) { }
66 inline void get(
double & xout,
double & yout )
const;
91 inline double norm()
const;
105 return Point( a.x + b.x, a.y + b.y );
111 return Point( a.x - b.x, a.y - b.y );
117 return a.x * b.x + a.y * b.y;
123 return Point( p.x * s, p.y * s );
129 return Point( s * p.x, s * p.y );
135 return Point( p.x / s, p.y / s );
173 return ( a.x == b.x ) && ( a.y == b.y ) ;
179 return ( a.x != b.x ) || ( a.y != b.y ) ;
195 return Point(*this).rotate( angle );
210 return Point(*this).rotate( angle, center );
216 return sqrt( x*x + y*y );
221 return Point( -x, -y );
Point & rotate(double angle)
Point operator/(const Point &p, double s)
Point(const Point &other)
double operator*(const Point &a, const Point &b)
Struct representing a 2D point.
Point(double xc, double yc)
Point & operator+=(const Point &other)
void get(double &xout, double &yout) const
Point & operator*=(double s)
Point & operator-=(const Point &other)
Point operator-(const Point &a, const Point &b)
bool operator!=(const Point &a, const Point &b)
bool operator==(const Point &a, const Point &b)
Point & operator/=(double s)
Point rotated(double angle) const
Point operator+(const Point &a, const Point &b)