34 const double d3 =
length();
35 const double ds1 =
square(d1);
36 const double ds2 =
square(d2);
37 const double ds3 =
square(d3);
38 if (ds1 > (ds2 + ds3) || ds2 > (ds1 + ds3))
40 return std::min(d1, d2) *
60 throw std::logic_error(
"Segment is normal to projection plane");
double distance(const TPoint2D &point) const
Distance to point.
TPoint2D_< double > TPoint2D
Lightweight 2D point.
double length() const
Segment length.
mrpt::serialization::CArchive & operator>>(mrpt::serialization::CArchive &in, CMatrixD::Ptr &pObj)
TPoint3D point1
origin point
double signedDistance(const TPoint2D &point) const
Distance with sign to point (sign indicates which side the point is).
This base provides a set of functions for maths stuff.
2D segment, consisting of two points.
3D segment, consisting of two points.
TSegment2D()=default
Fast default constructor.
TPoint3D point2
final point
bool operator<(const TSegment2D &s) const
TPoint2D point2
Destiny point.
bool contains(const TPoint2D &point) const
Check whether a point is inside a segment.
TPoint2D point1
Origin point.
return_t square(const num_t x)
Inline function for the square of a number.
Virtual base class for "archives": classes abstracting I/O streams.
double getEpsilon()
Gets the value of the geometric epsilon (default = 1e-5)
mrpt::vision::TStereoCalibResults out
mrpt::serialization::CArchive & operator<<(mrpt::serialization::CArchive &s, const CVectorFloat &a)
void generate3DObject(TSegment3D &s) const
Project into 3D space, setting the z to 0.
double distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.
double signedDistance(const TPoint2D &point) const
Distance with sign from a given point (sign indicates side).
2D line without bounds, represented by its equation .