modm API documentation
|
Polygon. More...
#include <modm/math/geometry/polygon_2d.hpp>
Public Member Functions | |
Polygon2D (SizeType n) | |
Constructs a polygon capable of holding n points. | |
Polygon2D (std::initializer_list< PointType > init) | |
Polygon2D (const Polygon2D &other) | |
Polygon2D & | operator= (const Polygon2D &other) |
Polygon2D & | operator<< (const PointType &point) |
append a point to the polygon | |
bool | intersects (const Polygon2D &other) const |
Check if a intersection exists. More... | |
bool | intersects (const Circle2D< T > &circle) const |
Check if a intersection exists. | |
bool | intersects (const LineSegment2D< T > &segment) const |
Check if a intersection exists. | |
bool | intersects (const Ray2D< T > &segment) const |
Check if a intersection exists. | |
bool | getIntersections (const LineSegment2D< T > &segment, PointSet2D< T > &intersectionPoints) const |
Calculate the intersection point(s) | |
bool | isInside (const PointType &point) |
Polygon.
The Polygon class provides a vector of points. The polygon is implicit closed, which means the first and the last point are connected.
bool modm::Polygon2D< T >::intersects | ( | const Polygon2D< T > & | other | ) | const |
Check if a intersection exists.
bool modm::Polygon2D< T >::isInside | ( | const PointType & | point | ) |
Check if the point is contained inside the area of the polygon.
The borders of the polygon are included in the area of the polygon.
true
if point is contained in the area, false
if it is outside.