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

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

Public Typedefs

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

Public Member Functions

 Ray2D (const Vector< T, 2 > &start, const Vector< T, 2 > &direction)
 
void setStartPoint (const Vector< T, 2 > &point)
 Set the starting point of the ray.
 
const Vector< T, 2 > & getStartPoint () const
 
void setDirectionVector (const Vector< T, 2 > &direction)
 
const Vector< T, 2 > & getDirectionVector () const
 
void translate (const Vector< T, 2 > &vector)
 
getLength () const
 Length of the line segment.
 
bool intersects (const LineSegment2D< T > &line) const
 Shortest distance to a point. More...
 
bool ccw (const modm::Vector< T, 2 > &point)
 
bool operator== (const Ray2D &other) const
 
bool operator!= (const Ray2D &other) const
 

Protected Attributes

modm::Vector< T, 2 > basePoint
 
modm::Vector< T, 2 > direction
 

Detailed Description

template<typename T = int16_t>
class modm::Ray2D< T >

Ray.

A ray is composed of a starting point and a direction vector.

Author
Fabian Greif

Member Function Documentation

template<typename T = int16_t>
bool modm::Ray2D< T >::intersects ( const LineSegment2D< T > &  line) const

Shortest distance to a point.

Check if two line segments intersect

Uses Ray2D::ccw() to check if any intersection exists.


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