21 static_assert(std::is_trivially_copyable_v<TLine3D>);
61 double dv = 0, d2 = 0, v2 = 0;
62 for (
size_t i = 0; i < 3; i++)
68 return sqrt(d2 - (dv * dv) / v2);
79 throw std::logic_error(
"Both points are the same");
static TLine3D FromTwoPoints(const TPoint3D &p1, const TPoint3D &p2)
Static constructor from two points.
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
#define ASSERT_(f)
Defines an assertion mechanism.
This base provides a set of functions for maths stuff.
3D segment, consisting of two points.
TPoint3D point2
final point
TVector3D director
Director vector.
bool contains(const TPoint3D &point) const
Check whether a point is inside the line.
static TLine3D FromPointAndDirector(const TPoint3D &basePoint, const TVector3D &directorVector)
Static constructor from a point and a director vector.
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.
T norm() const
Point norm: |v| = sqrt(x^2+y^2+z^2)
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.
CONTAINER::Scalar norm(const CONTAINER &v)
3D line, represented by a base point and a director vector.
2D line without bounds, represented by its equation .