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 More... | |
typedef FixedColVector< float, 2 > | Pos |
internal typedef for 2D points More... | |
Public Member Functions | |
StraightLine2D (float angle, float distance) | |
creates a straight line from given angle and distance to origin More... | |
StraightLine2D (const Pos &o=Pos(0, 0), const Pos &v=Pos(0, 0)) | |
creates a straight line from given 2 points More... | |
StraightLine2D (const utils::Point32f &o, const utils::Point32f &v) | |
creates a straight line from given point32f More... | |
float | distance (const Pos &p) const |
computes closest distance to given 2D point More... | |
float | signedDistance (const Pos &p) const |
computes closest distance to given 2D point More... | |
float | distance (const utils::Point32f &p) const |
computes closest distance to given 2D point More... | |
float | signedDistance (const utils::Point32f &p) const |
computes closest distance to given 2D point More... | |
Pos | intersect (const StraightLine2D &o) const |
computes intersection with given other straight line More... | |
PointPolar | getAngleAndDistance () const |
returns current angle and distance More... | |
Pos | getClosestPoint (const Pos &p) const |
retunrs the closest point on the straight line to a given other point More... | |
Public Attributes | |
Pos | o |
2D offset vector More... | |
Pos | v |
2D direction vector More... | |
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
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
|
inline |
computes closest distance to given 2D point
PointPolar icl::math::StraightLine2D::getAngleAndDistance | ( | ) | const |
returns current angle and distance
retunrs the closest point on the straight line to a given other point
Pos icl::math::StraightLine2D::intersect | ( | const StraightLine2D & | o | ) | const |
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
|
inline |
computes closest distance to given 2D point
Pos icl::math::StraightLine2D::o |
2D offset vector
Pos icl::math::StraightLine2D::v |
2D direction vector