Main MRPT website > C++ reference for MRPT 1.5.7
List of all members | Public Member Functions | Public Attributes

Detailed Description

3D line, represented by a base point and a director vector.

See also
TLine2D,TSegment3D,TPlane,TPolygon3D,TPoint3D

Definition at line 830 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 & Destructor Documentation

◆ TLine3D() [1/4]

mrpt::math::TLine3D::TLine3D ( const TPoint3D p1,
const TPoint3D p2 
)

Constructor from two points, through which the line will pass.

Exceptions
std::logic_errorif both points are the same.

Definition at line 495 of file lightweight_geom_data.cpp.

References director, mrpt::math::distance(), mrpt::math::geometryEpsilon, pBase, mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.

◆ TLine3D() [2/4]

mrpt::math::TLine3D::TLine3D ( const TSegment3D s)
explicit

Constructor from 3D segment.

Definition at line 502 of file lightweight_geom_data.cpp.

References director, and pBase.

◆ TLine3D() [3/4]

mrpt::math::TLine3D::TLine3D ( )
inline

Fast default constructor.

Initializes to garbage.

Definition at line 884 of file lightweight_geom_data.h.

◆ TLine3D() [4/4]

mrpt::math::TLine3D::TLine3D ( const TLine2D l)
explicit

Member Function Documentation

◆ contains()

bool mrpt::math::TLine3D::contains ( const TPoint3D point) const

◆ distance()

double mrpt::math::TLine3D::distance ( const TPoint3D point) const

Distance between the line and a point.

Definition at line 479 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().

◆ generate2DObject()

void mrpt::math::TLine3D::generate2DObject ( TLine2D l) const
inline

Project into 2D space, discarding the Z coordinate.

Exceptions
std::logic_errorif the line's director vector is orthogonal to the XY plane.

Definition at line 869 of file lightweight_geom_data.h.

Referenced by intersect().

◆ getDirectorVector()

void mrpt::math::TLine3D::getDirectorVector ( double(&)  vector[3]) const
inline

Get director vector.

Definition at line 855 of file lightweight_geom_data.h.

◆ getUnitaryDirectorVector()

void mrpt::math::TLine3D::getUnitaryDirectorVector ( double(&)  vector[3])
inline

Unitarize and then get director vector.

Definition at line 861 of file lightweight_geom_data.h.

◆ unitarize()

void mrpt::math::TLine3D::unitarize ( )

Member Data Documentation

◆ director

double mrpt::math::TLine3D::director[3]

◆ pBase

TPoint3D mrpt::math::TLine3D::pBase



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019