Detailed Description
The PPoint2Df class represents a 2D-point with float coordinates; PPoint2Df instances are immutable (thread-safe).
Definition at line 28 of file PPoint2Df.h.
#include <PPoint2Df.h>
Constructor & Destructor Documentation
◆ PPoint2Df() [1/4]
|
explicit |
Constructs a 2D-point from its coordinates (x, y), (0,0) by default.
◆ PPoint2Df() [2/4]
|
explicit |
Constructs a 2D-point from its coordinates (x, y), (0,0) by default.
◆ PPoint2Df() [3/4]
|
explicit |
Constructs a 2D-point from its coordinates (x, y), (0,0) by default.
◆ PPoint2Df() [4/4]
PPoint2Df::PPoint2Df | ( | const PPoint2Df & | other | ) |
Constructs a shared copy of other.
◆ ~PPoint2Df()
|
virtual |
Destroys this object.
Member Function Documentation
◆ Bad()
|
inlinestatic |
Returns the constant holding the bad instance of a PPoint2Df.
Definition at line 34 of file PPoint2Df.h.
◆ EuclideanDistance()
float PPoint2Df::EuclideanDistance | ( | const PPoint2Df & | other | ) | const |
Computes the Euclidean distance between this and other point.
◆ GetX()
float PPoint2Df::GetX | ( | ) | const |
Returns the first coordinate of this 2D-point (column).
◆ GetY()
float PPoint2Df::GetY | ( | ) | const |
Returns the second coordinate of this 2D-point (row).
◆ IsBad()
bool PPoint2Df::IsBad | ( | ) | const |
Returns true if this 2D-point is NOT valid (at least one NaN coordinate), false otherwise.
◆ IsValid()
bool PPoint2Df::IsValid | ( | ) | const |
Returns true if this 2D-point is valid (no NaN coordinates), false otherwise.
◆ Middle()
Returns the middle of the segment [AB].
◆ operator!=()
bool PPoint2Df::operator!= | ( | const PPoint2Df & | other | ) | const |
◆ operator*()
PPoint2Df PPoint2Df::operator* | ( | float | scaleBy | ) | const |
Returns a point corresponding to this point where both coordinates have been scaled by the given factor.
◆ operator+()
Returns a point corresponding to this point translated by the specified vector v.
◆ operator-() [1/2]
Returns a point corresponding to this point translated by the specified vector -v.
◆ operator-() [2/2]
PPoint2Df PPoint2Df::operator- | ( | ) | const |
Returns a point with unary minus operator applied to coordinates.
◆ operator=()
Performs a shared copy of other to this object.
◆ operator==()
bool PPoint2Df::operator== | ( | const PPoint2Df & | other | ) | const |
◆ Scaled()
PPoint2Df PPoint2Df::Scaled | ( | float | scaleBy | ) | const |
Returns a point corresponding to this point where both coordinates have been scaled by the given factor.
This can be useful if you have feature points in an image and then scale the image by a factor.
◆ ToPPoint2Di()
◆ Translated() [1/2]
PPoint2Df PPoint2Df::Translated | ( | float | vx, |
float | vy | ||
) | const |
Returns a point corresponding to this point translated by the specified vector (vx, vy).
◆ Translated() [2/2]
Returns a point corresponding to this point translated by the specified vector (vx, vy).
◆ Zero()
|
inlinestatic |
Returns the constant holding the point (0,0).
Definition at line 39 of file PPoint2Df.h.