3D line, represented by a base point and a director vector.
Definition at line 1244 of file lightweight_geom_data.h.
#include <mrpt/math/lightweight_geom_data.h>
Public Member Functions | |
bool | contains (const TPoint3D &point) const |
Check whether a point is inside the line. More... | |
double | distance (const TPoint3D &point) const |
Distance between the line and a point. More... | |
void | unitarize () |
Unitarize director vector. More... | |
void | getDirectorVector (double(&vector)[3]) const |
Get director vector. More... | |
void | getUnitaryDirectorVector (double(&vector)[3]) |
Unitarize and then get director vector. More... | |
void | generate2DObject (TLine2D &l) const |
Project into 2D space, discarding the Z coordinate. More... | |
TLine3D (const TPoint3D &p1, const TPoint3D &p2) | |
Constructor from two points, through which the line will pass. More... | |
TLine3D (const TSegment3D &s) | |
Constructor from 3D segment. More... | |
TLine3D () | |
Fast default constructor. More... | |
TLine3D (const TLine2D &l) | |
Constructor from 2D object. More... | |
Public Attributes | |
TPoint3D | pBase |
Base point. More... | |
double | director [3] |
Director vector. More... | |
Constructor from two points, through which the line will pass.
std::logic_error | if both points are the same. |
Definition at line 781 of file lightweight_geom_data.cpp.
References director, mrpt::math::distance(), mrpt::math::getEpsilon(), pBase, mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
|
explicit |
Constructor from 3D segment.
Definition at line 790 of file lightweight_geom_data.cpp.
|
inline |
Fast default constructor.
Initializes to garbage.
Definition at line 1300 of file lightweight_geom_data.h.
|
explicit |
Constructor from 2D object.
Zeroes the z.
Definition at line 797 of file lightweight_geom_data.cpp.
References mrpt::math::TLine2D::coefs, director, mrpt::math::getEpsilon(), pBase, mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
bool mrpt::math::TLine3D::contains | ( | const TPoint3D & | point | ) | const |
Check whether a point is inside the line.
Definition at line 745 of file lightweight_geom_data.cpp.
References director, mrpt::math::getEpsilon(), pBase, mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
Referenced by mrpt::math::intersect(), and mrpt::math::TPlane::TPlane().
double mrpt::math::TLine3D::distance | ( | const TPoint3D & | point | ) | const |
Distance between the line and a point.
Definition at line 760 of file lightweight_geom_data.cpp.
References director, pBase, mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
Referenced by mrpt::math::distance(), and mrpt::math::TSegment3D::distance().
Project into 2D space, discarding the Z coordinate.
std::logic_error | if the line's director vector is orthogonal to the XY plane. |
Definition at line 1287 of file lightweight_geom_data.h.
Referenced by intersect().
|
inline |
Get director vector.
Definition at line 1270 of file lightweight_geom_data.h.
References director.
Referenced by getUnitaryDirectorVector().
|
inline |
Unitarize and then get director vector.
Definition at line 1277 of file lightweight_geom_data.h.
References getDirectorVector(), and unitarize().
void mrpt::math::TLine3D::unitarize | ( | ) |
Unitarize director vector.
Definition at line 776 of file lightweight_geom_data.cpp.
References director.
Referenced by getUnitaryDirectorVector(), mrpt::math::intersect(), mrpt::math::project3D(), mrpt::opengl::CCylinder::traceRay(), mrpt::opengl::CEllipsoid::traceRay(), and mrpt::math::traceRay().
double mrpt::math::TLine3D::director[3] |
Director vector.
Definition at line 1254 of file lightweight_geom_data.h.
Referenced by contains(), mrpt::math::distance(), distance(), mrpt::opengl::COpenGLViewport::get3DRayForPixelCoord(), mrpt::math::getAngle(), getDirectorVector(), mrpt::math::getRegressionLine(), mrpt::math::intersect(), intersect(), intersectInCommonLine(), mrpt::math::operator<<(), mrpt::math::operator>>(), mrpt::math::project3D(), mrpt::math::TLine2D::TLine2D(), TLine3D(), mrpt::math::TPlane::TPlane(), mrpt::opengl::CCylinder::traceRay(), mrpt::opengl::CEllipsoid::traceRay(), and unitarize().
TPoint3D mrpt::math::TLine3D::pBase |
Base point.
Definition at line 1250 of file lightweight_geom_data.h.
Referenced by contains(), mrpt::math::TPlane::contains(), mrpt::math::distance(), distance(), mrpt::math::TPlane::distance(), mrpt::opengl::COpenGLViewport::get3DRayForPixelCoord(), mrpt::math::getRegressionLine(), mrpt::math::intersect(), intersect(), mrpt::math::operator<<(), mrpt::math::operator>>(), mrpt::math::project3D(), mrpt::math::TLine2D::TLine2D(), TLine3D(), mrpt::math::TPlane::TPlane(), mrpt::opengl::CCylinder::traceRay(), and mrpt::opengl::CEllipsoid::traceRay().
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST |