modm API documentation
|
#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) |
T | 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 |
Ray.
A ray is composed of a starting point and a direction vector.
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.