Image Component Library (ICL)
|
A straight line is parameterized in offset/direction form. More...
#include <StraightLine2D.h>
Public Types | |
typedef FixedColVector< float, 2 > | PointPolar |
internal typedef | |
typedef FixedColVector< float, 2 > | Pos |
internal typedef for 2D points | |
Public Member Functions | |
StraightLine2D (float angle, float distance) | |
creates a straight line from given angle and distance to origin | |
StraightLine2D (const Pos &o=Pos(0, 0), const Pos &v=Pos(0, 0)) | |
creates a straight line from given 2 points | |
StraightLine2D (const utils::Point32f &o, const utils::Point32f &v) | |
creates a straight line from given point32f | |
float | distance (const Pos &p) const |
computes closest distance to given 2D point | |
float | signedDistance (const Pos &p) const |
computes closest distance to given 2D point | |
float | distance (const utils::Point32f &p) const |
computes closest distance to given 2D point | |
float | signedDistance (const utils::Point32f &p) const |
computes closest distance to given 2D point | |
Pos | intersect (const StraightLine2D &o) const throw (utils::ICLException) |
computes intersection with given other straight line | |
PointPolar | getAngleAndDistance () const |
returns current angle and distance | |
Pos | getClosestPoint (const Pos &p) const |
retunrs the closest point on the straight line to a given other point | |
Public Attributes | |
Pos | o |
2D offset vector | |
Pos | v |
2D direction vector |
A straight line is parameterized in offset/direction form.
This formular is used:
The template is instantiated for template parameter Pos type Point32f and FixedColVector<float,2>
typedef FixedColVector<float,2> icl::math::StraightLine2D::PointPolar |
internal typedef
typedef FixedColVector<float,2> icl::math::StraightLine2D::Pos |
internal typedef for 2D points
icl::math::StraightLine2D::StraightLine2D | ( | float | angle, |
float | distance | ||
) |
creates a straight line from given angle and distance to origin
icl::math::StraightLine2D::StraightLine2D | ( | const Pos & | o = Pos(0, 0) , |
const Pos & | v = Pos(0, 0) |
||
) |
creates a straight line from given 2 points
icl::math::StraightLine2D::StraightLine2D | ( | const utils::Point32f & | o, |
const utils::Point32f & | v | ||
) |
creates a straight line from given point32f
float icl::math::StraightLine2D::distance | ( | const Pos & | p | ) | const |
computes closest distance to given 2D point
float icl::math::StraightLine2D::distance | ( | const utils::Point32f & | p | ) | const [inline] |
computes closest distance to given 2D point
returns current angle and distance
Pos icl::math::StraightLine2D::getClosestPoint | ( | const Pos & | p | ) | const |
retunrs the closest point on the straight line to a given other point
Pos icl::math::StraightLine2D::intersect | ( | const StraightLine2D & | o | ) | const throw (utils::ICLException) |
computes intersection with given other straight line
if lines are parallel, an ICLException is thrown
float icl::math::StraightLine2D::signedDistance | ( | const Pos & | p | ) | const |
computes closest distance to given 2D point
float icl::math::StraightLine2D::signedDistance | ( | const utils::Point32f & | p | ) | const [inline] |
computes closest distance to given 2D point
2D offset vector
2D direction vector