Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Public Attributes
icl::math::StraightLine2D Struct Reference

A straight line is parameterized in offset/direction form. More...

#include <StraightLine2D.h>

List of all members.

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

Detailed Description

A straight line is parameterized in offset/direction form.

This formular is used:

\[ L(x) = \vec{o} + x\vec{v} \]

The template is instantiated for template parameter Pos type Point32f and FixedColVector<float,2>


Member Typedef Documentation

internal typedef

internal typedef for 2D points


Constructor & Destructor Documentation

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

creates a straight line from given point32f


Member Function Documentation

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

retunrs the closest point on the straight line to a given other point

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


Member Data Documentation

2D offset vector

2D direction vector


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines