MRPT
2.0.4
|
2D segment, consisting of two points.
Definition at line 20 of file TSegment2D.h.
#include <mrpt/math/TSegment2D.h>
Public Member Functions | |
double | length () const |
Segment length. More... | |
double | distance (const TPoint2D &point) const |
Distance to point. More... | |
double | signedDistance (const TPoint2D &point) const |
Distance with sign to point (sign indicates which side the point is). More... | |
bool | contains (const TPoint2D &point) const |
Check whether a point is inside a segment. More... | |
TPoint2D & | operator[] (size_t i) |
Access to points using operator[0-1]. More... | |
constexpr const TPoint2D & | operator[] (size_t i) const |
Access to points using operator[0-1]. More... | |
void | generate3DObject (TSegment3D &s) const |
Project into 3D space, setting the z to 0. More... | |
void | getCenter (TPoint2D &p) const |
Segment's central point. More... | |
TSegment2D (const TPoint2D &p1, const TPoint2D &p2) | |
Constructor from both points. More... | |
TSegment2D ()=default | |
Fast default constructor. More... | |
TSegment2D (const TSegment3D &s) | |
Explicit constructor from 3D object, discarding the z. More... | |
bool | operator< (const TSegment2D &s) const |
Public Attributes | |
TPoint2D | point1 |
Origin point. More... | |
TPoint2D | point2 |
Destiny point. More... | |
Constructor from both points.
Definition at line 88 of file TSegment2D.h.
|
default |
Fast default constructor.
Initializes to garbage.
|
explicit |
Explicit constructor from 3D object, discarding the z.
Definition at line 55 of file TSegment2D.cpp.
References mrpt::math::TSegment3D::point1, point1, mrpt::math::TSegment3D::point2, and point2.
bool TSegment2D::contains | ( | const TPoint2D & | point | ) | const |
Check whether a point is inside a segment.
Definition at line 45 of file TSegment2D.cpp.
References mrpt::math::distance(), mrpt::math::getEpsilon(), point1, and point2.
Referenced by mrpt::math::intersect(), and intersect().
double TSegment2D::distance | ( | const TPoint2D & | point | ) | const |
Distance to point.
Definition at line 19 of file TSegment2D.cpp.
References signedDistance().
Referenced by mrpt::nav::CHolonomicFullEval::evalSingleTarget(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
void TSegment2D::generate3DObject | ( | TSegment3D & | s | ) | const |
Project into 3D space, setting the z to 0.
Definition at line 51 of file TSegment2D.cpp.
|
inline |
Segment's central point.
Definition at line 80 of file TSegment2D.h.
References point1, point2, mrpt::math::TPoint2D_data< T >::x, and mrpt::math::TPoint2D_data< T >::y.
Referenced by mrpt::math::getSegmentBisector().
double TSegment2D::length | ( | ) | const |
Segment length.
Definition at line 18 of file TSegment2D.cpp.
References mrpt::math::distance(), point1, and point2.
Referenced by signedDistance().
bool TSegment2D::operator< | ( | const TSegment2D & | s | ) | const |
Definition at line 63 of file TSegment2D.cpp.
|
inline |
Access to points using operator[0-1].
Definition at line 48 of file TSegment2D.h.
|
inline |
Access to points using operator[0-1].
Definition at line 61 of file TSegment2D.h.
double TSegment2D::signedDistance | ( | const TPoint2D & | point | ) | const |
Distance with sign to point (sign indicates which side the point is).
Definition at line 23 of file TSegment2D.cpp.
References mrpt::math::distance(), length(), point1, point2, mrpt::math::TLine2D::signedDistance(), and mrpt::square().
Referenced by distance().
TPoint2D mrpt::math::TSegment2D::point1 |
Origin point.
Definition at line 26 of file TSegment2D.h.
Referenced by contains(), mrpt::nav::CHolonomicFullEval::evalSingleTarget(), getCenter(), mrpt::math::getSegmentBisector(), length(), mrpt::math::operator!=(), operator<(), mrpt::math::operator<<(), mrpt::math::operator==(), mrpt::math::operator>>(), operator[](), signedDistance(), TEST(), mrpt::math::TLine2D::TLine2D(), TSegment2D(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
TPoint2D mrpt::math::TSegment2D::point2 |
Destiny point.
Definition at line 30 of file TSegment2D.h.
Referenced by contains(), mrpt::nav::CHolonomicFullEval::evalSingleTarget(), getCenter(), mrpt::math::getSegmentBisector(), length(), mrpt::math::operator!=(), operator<(), mrpt::math::operator<<(), mrpt::math::operator==(), mrpt::math::operator>>(), operator[](), signedDistance(), TEST(), mrpt::math::TLine2D::TLine2D(), TSegment2D(), and mrpt::nav::CWaypointsNavigator::waypoints_navigationStep().
Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020 |