21 static_assert(std::is_trivially_copyable_v<TLine3D>);
47 double dv = 0, d2 = 0, v2 = 0;
48 for (
size_t i = 0; i < 3; i++)
54 return sqrt(d2 - (dv * dv) / v2);
58 double s = sqrt(squareNorm<3, double>(
director));
64 throw std::logic_error(
"Both points are the same");
This file implements several operations that operate element-wise on individual or pairs of container...
TPoint3D pBase
Base point.
void generate2DObject(TLine2D &l) const
Project into 2D space, discarding the Z coordinate.
mrpt::serialization::CArchive & operator>>(mrpt::serialization::CArchive &in, CMatrixD::Ptr &pObj)
TPoint3D point1
origin point
This base provides a set of functions for maths stuff.
3D segment, consisting of two points.
std::array< double, 3 > director
Director vector.
TPoint3D point2
final point
bool contains(const TPoint3D &point) const
Check whether a point is inside the line.
std::array< double, 3 > coefs
Line coefficients, stored as an array: .
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 unitarize()
Unitarize director vector.
TLine3D()=default
Fast default constructor.
double distance(const TPoint3D &point) const
Distance between the line and a point.
double distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.
3D line, represented by a base point and a director vector.
2D line without bounds, represented by its equation .