Storage class for 2D points.
This class stores abscissa and ordinate of a 2D point.
At any time, the user should known:
- the unit of these coordinates
- the referential system of these coordinates.
|
| Point2D (const MP_real &x=0., const MP_real &y=0.) |
| Default constructor. More...
|
|
| Point2D (const Point2D &) |
| Copy constructor. More...
|
|
virtual | ~Point2D () |
| Destructor. More...
|
|
MP_real | distance (const Point2D &) const |
| Return distance between current point and given point reference. More...
|
|
Point2D & | transform (const Point2D &translate, const Point2D &dilate, bool do_round=false) |
| Return new point dilated. More...
|
|
MP_real | scalar (const Point2D &) const |
| Return the scalar product (_x*x + _y*y) between current point and given point reference. More...
|
|
MP_real | vectorial (const Point2D &) const |
| Return the vectorial product (_x*y - _y*x) between current point and given point reference. More...
|
|
Point2D & | reset (const MP_real &x=0., const MP_real &y=0.) |
| Reset current point coordinates to new values. More...
|
|
Point2D & | rotate_half_pi () |
| Rotate 90° current point anticlockwise. More...
|
|
Point2D & | rotate_pi () |
| Rotate 180° current point anticlockwise. More...
|
|
Point2D & | rotate (const Point2D ¢er, const MP_real &angle) |
| Rotate a point around a center (angle in radian) More...
|
|
Point2D & | rotate (const Point2D ¢er, const MP_real &cosinus, const MP_real &sinus) |
| Rotate a point around a center given the cosinus and the sinus of the angle. More...
|
|
Point2D & | rotate_inv (const Point2D ¢er, const MP_real &angle) |
| Inverse rotate a point around a center (angle in radian) More...
|
|
Point2D & | rotate_inv (const Point2D ¢er, const MP_real &cosinus, const MP_real &sinus) |
| Inverse rotate a point around a center given the cosinus and the sinus of the angle. More...
|
|
Point2D & | operator= (const Point2D &) |
| Affect current point by given reference point. More...
|
|
Point2D & | operator+= (const Point2D &) |
| Affect current point adding given reference point. More...
|
|
Point2D & | operator-= (const Point2D &) |
| Affect current point substracting given reference point. More...
|
|
Point2D & | operator*= (const MP_real &) |
| Affect current point multipling coordinates by given real value. More...
|
|
Point2D & | operator/= (const MP_real &) |
| Affect current point dividing coordinates by given real value. More...
|
|
bool | operator== (const Point2D &) const |
| Return true if current point coordinates are equal to given point ones. More...
|
|
bool | operator!= (const Point2D &) const |
| Return true if current point coordinates are different from given point ones. More...
|
|
MP_real | get_abscissa () const |
| Assessors get to the _x protected member variable. More...
|
|
void | set_abscissa (MP_real x) |
| Assessors set to the _x protected member variable. More...
|
|
MP_real | get_ordinate () const |
| Assessors get to the _y protected member variable. More...
|
|
void | set_ordinate (MP_real y) |
| Assessors set to the _y protected member variable. More...
|
|
MP_string | debug () const |
| Get debug information. More...
|
|
|
Point2D | operator- (const Point2D &) |
| Return a new point where _x = -x and _y = -y. More...
|
|
Point2D | operator+ (const Point2D &, const Point2D &) |
| Add two points. More...
|
|
Point2D | operator- (const Point2D &, const Point2D &) |
| Subtract two points. More...
|
|
Point2D | operator* (const Point2D &, const Point2D &) |
| Multiply coordinates of two points (_x*x, _y*y) More...
|
|
Point2D | operator* (const MP_real &, const Point2D &) |
| Multiply given point coordinates by the given real value. More...
|
|
Point2D | operator* (const Point2D &, const MP_real &) |
| Multiply given point coordinates by the given real value. More...
|
|
Point2D | operator/ (const Point2D &, const Point2D &) |
| Divide coordinates of two points (_x/x, _y/y) More...
|
|
Point2D | operator/ (const MP_real &, const Point2D &) |
| Divide given point coordinates by the given real value. More...
|
|
Point2D | operator/ (const Point2D &, const MP_real &) |
| Divide given point coordinates by the given real value. More...
|
|
MP_real | sqnorm (const Point2D &) |
| Return the square norm of segment between origin and given point. More...
|
|
MP_real | lgth (const Point2D &) |
| Return the distance of the segment between origin and given point. More...
|
|
MP_real | arc_tan (const Point2D &) |
| Return the arc tangante between origin and given point. More...
|
|
std::ostream & | operator<< (std::ostream &, const Point2D &) |
| Print given point coordinates into an output stream. More...
|
|
std::istream & | operator>> (std::istream &, Point2D &) |
| Initialize given point coordinates from an input stream. More...
|
|