14 #ifndef _BOARD_POINT_H_
15 #define _BOARD_POINT_H_
18 #include "DGtal/io/Color.h"
58 Point(
double xc,
double yc ):x(xc),y(yc) { }
73 inline void get(
double & xout,
double & yout )
const;
98 inline double norm()
const;
112 return Point( a.x + b.x, a.y + b.y );
118 return Point( a.x - b.x, a.y - b.y );
124 return a.x * b.x + a.y * b.y;
130 return Point( p.x * s, p.y * s );
136 return Point( s * p.x, s * p.y );
142 return Point( p.x / s, p.y / s );
180 return ( a.x == b.x ) && ( a.y == b.y ) ;
186 return ( a.x != b.x ) || ( a.y != b.y ) ;
202 return Point(*this).rotate( angle );
209 (*this).rotate( angle );
217 return Point(*this).rotate( angle, center );
223 return sqrt( x*x + y*y );
228 return Point( -x, -y );
Point operator+(const Point &a, const Point &b)
Point operator-(const Point &a, const Point &b)
Point operator/(const Point &p, double s)
bool operator!=(const Point &a, const Point &b)
bool operator==(const Point &a, const Point &b)
double operator*(const Point &a, const Point &b)
Struct representing a 2D point.
Point & operator-=(const Point &other)
Point & operator+=(const Point &other)
Point & operator/=(double s)
void get(double &xout, double &yout) const
Point & operator*=(double s)
Point rotated(double angle) const
Point(double xc, double yc)
Point(const Point &other)
Point & rotate(double angle)
Point & operator=(const Point &other)=default