modm API documentation
modm::Line2D< T > Class Template Reference

Line. More...

#include <modm/math/geometry/line_2d.hpp>

Public Typedefs

typedef GeometricTraits< T >::WideType WideType
 
typedef GeometricTraits< T >::FloatType FloatType
 

Public Member Functions

 Line2D ()
 Default-Constructor.
 
 Line2D (const Vector< T, 2 > &point, const Vector< T, 2 > &directionVector)
 Construct a line. More...
 
void setPoint (const Vector< T, 2 > &point)
 
const Vector< T, 2 > & getPoint () const
 
void setDirectionVector (const Vector< T, 2 > &vector)
 
const Vector< T, 2 > & getDirectionVector () const
 
void set (const Vector< T, 2 > &point, const Vector< T, 2 > &directionVector)
 
getDistanceTo (const Vector< T, 2 > &point) const
 Shortest distance to a point.
 
bool getIntersections (const Line2D &other, PointSet2D< T > &intersections) const
 Calculate intersection point(s) More...
 
bool getIntersections (const Circle2D< T > &circle, PointSet2D< T > &intersections) const
 Calculate intersection point(s) More...
 

Protected Attributes

Vector< T, 2 > point
 
Vector< T, 2 > directionVector
 

Detailed Description

template<typename T>
class modm::Line2D< T >

Line.

Author
Fabian Greif

Constructor & Destructor Documentation

template<typename T >
modm::Line2D< T >::Line2D ( const Vector< T, 2 > &  point,
const Vector< T, 2 > &  directionVector 
)

Construct a line.

Parameters
pointa point on the line
directionVectordirection vector, the length doesn't matter

Member Function Documentation

template<typename T >
bool modm::Line2D< T >::getIntersections ( const Circle2D< T > &  circle,
PointSet2D< T > &  intersections 
) const

Calculate intersection point(s)

Parameters
[in]circleA circle
[out]intersectionsIntersection points
See also
http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/
template<typename T >
bool modm::Line2D< T >::getIntersections ( const Line2D< T > &  other,
PointSet2D< T > &  intersections 
) const

Calculate intersection point(s)

Parameters
[in]otherOther line
[out]intersectionsIntersection point

The documentation for this class was generated from the following files: