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;
103Point::get(
double & xout,
double & yout )
const
103Point::get(
double & xout,
double & yout )
const {
…}
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 );
146Point::operator+=(
const Point & other )
146Point::operator+=(
const Point & other ) {
…}
154Point::operator-=(
const Point & other )
154Point::operator-=(
const Point & other ) {
…}
162Point::operator*=(
double s )
162Point::operator*=(
double s ) {
…}
170Point::operator/=(
double s )
170Point::operator/=(
double s ) {
…}
180 return ( a.
x == b.
x ) && ( a.
y == b.
y ) ;
186 return ( a.
x != b.
x ) || ( a.
y != b.
y ) ;
192 double newx = cos(
angle ) * Point::x - sin(
angle ) * Point::y;
193 double newy = sin(
angle ) * Point::x + cos(
angle ) * Point::y;
209 (*this).rotate(
angle );
223 return sqrt(
x*
x +
y*
y );
MyPointD operator-(const MyPointD &other) const
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
double angle(const DGtal::Z2i::RealPoint &point)