![]() |
Flumy [Free API]
Process based model for meandering chanelized systems
|
Storage class for 2D points. More...
Storage class for 2D points.
This class stores abscissa and ordinate of a 2D point.
At any time, the user should known:
Public Member Functions | |
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... | |
Protected Attributes | |
MP_real | _x |
Point abscissa. More... | |
MP_real | _y |
Point ordinate. More... | |
Friends | |
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... | |
Point2D::Point2D | ( | const MP_real & | x = 0. , |
const MP_real & | y = 0. |
||
) |
Default constructor.
Point2D::Point2D | ( | const Point2D & | ) |
Copy constructor.
|
virtual |
Destructor.
MP_string Point2D::debug | ( | ) | const |
Get debug information.
MP_real Point2D::distance | ( | const Point2D & | ) | const |
Return distance between current point and given point reference.
|
inline |
Assessors get to the _x protected member variable.
|
inline |
Assessors get to the _y protected member variable.
bool Point2D::operator!= | ( | const Point2D & | ) | const |
Return true if current point coordinates are different from given point ones.
Point2D& Point2D::operator*= | ( | const MP_real & | ) |
Affect current point multipling coordinates by given real value.
Affect current point substracting given reference point.
Point2D& Point2D::operator/= | ( | const MP_real & | ) |
Affect current point dividing coordinates by given real value.
bool Point2D::operator== | ( | const Point2D & | ) | const |
Return true if current point coordinates are equal to given point ones.
Point2D& Point2D::reset | ( | const MP_real & | x = 0. , |
const MP_real & | y = 0. |
||
) |
Reset current point coordinates to new values.
Rotate a point around a center (angle in radian)
Rotate a point around a center given the cosinus and the sinus of the angle.
Point2D& Point2D::rotate_half_pi | ( | ) |
Rotate 90° current point anticlockwise.
Inverse rotate a point around a center (angle in radian)
Point2D& Point2D::rotate_inv | ( | const Point2D & | center, |
const MP_real & | cosinus, | ||
const MP_real & | sinus | ||
) |
Inverse rotate a point around a center given the cosinus and the sinus of the angle.
Point2D& Point2D::rotate_pi | ( | ) |
Rotate 180° current point anticlockwise.
MP_real Point2D::scalar | ( | const Point2D & | ) | const |
Return the scalar product (_x*x + _y*y) between current point and given point reference.
|
inline |
Assessors set to the _x protected member variable.
|
inline |
Assessors set to the _y protected member variable.
Point2D& Point2D::transform | ( | const Point2D & | translate, |
const Point2D & | dilate, | ||
bool | do_round = false |
||
) |
Return new point dilated.
MP_real Point2D::vectorial | ( | const Point2D & | ) | const |
Return the vectorial product (_x*y - _y*x) between current point and given point reference.
|
friend |
Return the arc tangante between origin and given point.
|
friend |
Return the distance of the segment between origin and given point.
Multiply given point coordinates by the given real value.
Multiply given point coordinates by the given real value.
Multiply coordinates of two points (_x*x, _y*y)
Divide given point coordinates by the given real value.
Divide given point coordinates by the given real value.
Divide coordinates of two points (_x/x, _y/y)
|
friend |
Print given point coordinates into an output stream.
|
friend |
Initialize given point coordinates from an input stream.
|
friend |
Return the square norm of segment between origin and given point.
|
protected |
Point abscissa.
|
protected |
Point ordinate.