Image Component Library (ICL)
Public Types | Public Member Functions | Public Attributes | List of all members
icl::math::StraightLine2D Struct Reference

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...
 

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

◆ PointPolar

internal typedef

◆ Pos

internal typedef for 2D points

Constructor & Destructor Documentation

◆ StraightLine2D() [1/3]

icl::math::StraightLine2D::StraightLine2D ( float  angle,
float  distance 
)

creates a straight line from given angle and distance to origin

◆ StraightLine2D() [2/3]

icl::math::StraightLine2D::StraightLine2D ( const Pos o = Pos(0, 0),
const Pos v = Pos(0, 0) 
)

creates a straight line from given 2 points

◆ StraightLine2D() [3/3]

icl::math::StraightLine2D::StraightLine2D ( const utils::Point32f o,
const utils::Point32f v 
)

creates a straight line from given point32f

Member Function Documentation

◆ distance() [1/2]

float icl::math::StraightLine2D::distance ( const Pos p) const

computes closest distance to given 2D point

◆ distance() [2/2]

float icl::math::StraightLine2D::distance ( const utils::Point32f p) const
inline

computes closest distance to given 2D point

◆ getAngleAndDistance()

PointPolar icl::math::StraightLine2D::getAngleAndDistance ( ) const

returns current angle and distance

◆ getClosestPoint()

Pos icl::math::StraightLine2D::getClosestPoint ( const Pos p) const

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

◆ intersect()

Pos icl::math::StraightLine2D::intersect ( const StraightLine2D o) const

computes intersection with given other straight line

if lines are parallel, an ICLException is thrown

◆ signedDistance() [1/2]

float icl::math::StraightLine2D::signedDistance ( const Pos p) const

computes closest distance to given 2D point

◆ signedDistance() [2/2]

float icl::math::StraightLine2D::signedDistance ( const utils::Point32f p) const
inline

computes closest distance to given 2D point

Member Data Documentation

◆ o

Pos icl::math::StraightLine2D::o

2D offset vector

◆ v

Pos icl::math::StraightLine2D::v

2D direction vector


The documentation for this struct was generated from the following file: