Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Member Functions | Public Attributes
mrpt::math::TPlane Struct Reference

Detailed Description

3D Plane, represented by its equation $Ax+By+Cz+D=0$

See also
TSegment3D,TLine3D,TPolygon3D,TPoint3D

Definition at line 1309 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Member Functions

double evaluatePoint (const TPoint3D &point) const
 Evaluate a point in the plane's equation. More...
 
bool contains (const TPoint3D &point) const
 Check whether a point is contained into the plane. More...
 
bool contains (const TSegment3D &segment) const
 Check whether a segment is fully contained into the plane. More...
 
bool contains (const TLine3D &line) const
 Check whether a line is fully contained into the plane. More...
 
double distance (const TPoint3D &point) const
 Distance to 3D point. More...
 
double distance (const TLine3D &line) const
 Distance to 3D line. More...
 
void getNormalVector (double(&vec)[3]) const
 Get plane's normal vector. More...
 
void unitarize ()
 Unitarize normal vector. More...
 
void getAsPose3D (mrpt::math::TPose3D &outPose)
 
void getUnitaryNormalVector (double(&vec)[3])
 Unitarize, then get normal vector. More...
 
 TPlane (const TPoint3D &p1, const TPoint3D &p2, const TPoint3D &p3)
 Gets a plane which contains these three points. More...
 
 TPlane (const TPoint3D &p1, const TLine3D &r2)
 Gets a plane which contains this point and this line. More...
 
 TPlane (const TLine3D &r1, const TLine3D &r2)
 Gets a plane which contains the two lines. More...
 
 TPlane ()
 Fast default constructor. More...
 
constexpr TPlane (double A, double B, double C, double D)
 Constructor from plane coefficients. More...
 
 TPlane (const double(&vec)[4])
 Constructor from an array of coefficients. More...
 
void getAsPose3DForcingOrigin (const TPoint3D &newOrigin, TPose3D &pose)
 

Public Attributes

double coefs [4]
 Plane coefficients, stored as an array: $\left[A,B,C,D\right]$. More...
 

Constructor & Destructor Documentation

◆ TPlane() [1/6]

mrpt::math::TPlane::TPlane ( const TPoint3D p1,
const TPoint3D p2,
const TPoint3D p3 
)

Gets a plane which contains these three points.

Exceptions
std::logic_errorif the points are linearly dependants.

Definition at line 880 of file lightweight_geom_data.cpp.

References coefs, mrpt::math::getEpsilon(), mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.

◆ TPlane() [2/6]

mrpt::math::TPlane::TPlane ( const TPoint3D p1,
const TLine3D r2 
)

Gets a plane which contains this point and this line.

Exceptions
std::logic_errorif the point is inside the line.

Definition at line 896 of file lightweight_geom_data.cpp.

References coefs, mrpt::math::TLine3D::director, mrpt::math::getEpsilon(), mrpt::math::TLine3D::pBase, mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.

◆ TPlane() [3/6]

mrpt::math::TPlane::TPlane ( const TLine3D r1,
const TLine3D r2 
)

◆ TPlane() [4/6]

mrpt::math::TPlane::TPlane ( )
inline

Fast default constructor.

Initializes to garbage.

Definition at line 1379 of file lightweight_geom_data.h.

◆ TPlane() [5/6]

constexpr mrpt::math::TPlane::TPlane ( double  A,
double  B,
double  C,
double  D 
)
inlineconstexpr

Constructor from plane coefficients.

Definition at line 1383 of file lightweight_geom_data.h.

◆ TPlane() [6/6]

mrpt::math::TPlane::TPlane ( const double(&)  vec[4])
inline

Constructor from an array of coefficients.

Definition at line 1390 of file lightweight_geom_data.h.

References coefs.

Member Function Documentation

◆ contains() [1/3]

bool mrpt::math::TPlane::contains ( const TLine3D line) const

Check whether a line is fully contained into the plane.

Definition at line 825 of file lightweight_geom_data.cpp.

References contains(), mrpt::math::getAngle(), mrpt::math::getEpsilon(), and mrpt::math::TLine3D::pBase.

◆ contains() [2/3]

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

Check whether a point is contained into the plane.

Definition at line 821 of file lightweight_geom_data.cpp.

References distance(), and mrpt::math::getEpsilon().

Referenced by contains(), getAsPose3DForcingOrigin(), and mrpt::math::intersect().

◆ contains() [3/3]

bool mrpt::math::TPlane::contains ( const TSegment3D segment) const
inline

Check whether a segment is fully contained into the plane.

Definition at line 1327 of file lightweight_geom_data.h.

References contains(), mrpt::math::TSegment3D::point1, and mrpt::math::TSegment3D::point2.

◆ distance() [1/2]

double mrpt::math::TPlane::distance ( const TLine3D line) const

Distance to 3D line.

Will be zero if the line is not parallel to the plane.

Definition at line 835 of file lightweight_geom_data.cpp.

References distance(), mrpt::math::getAngle(), mrpt::math::getEpsilon(), and mrpt::math::TLine3D::pBase.

◆ distance() [2/2]

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

Distance to 3D point.

Definition at line 831 of file lightweight_geom_data.cpp.

References coefs, and evaluatePoint().

Referenced by contains(), mrpt::math::distance(), distance(), and mrpt::math::ransac3Dplane_distance().

◆ evaluatePoint()

double mrpt::math::TPlane::evaluatePoint ( const TPoint3D point) const

Evaluate a point in the plane's equation.

Definition at line 817 of file lightweight_geom_data.cpp.

References coefs.

Referenced by mrpt::opengl::CPolyhedron::augment(), distance(), mrpt::math::intersect(), mrpt::math::project3D(), and TPlane().

◆ getAsPose3D()

void mrpt::math::TPlane::getAsPose3D ( mrpt::math::TPose3D outPose)

◆ getAsPose3DForcingOrigin()

void mrpt::math::TPlane::getAsPose3DForcingOrigin ( const TPoint3D newOrigin,
TPose3D pose 
)

◆ getNormalVector()

void mrpt::math::TPlane::getNormalVector ( double(&)  vec[3]) const

Get plane's normal vector.

Definition at line 842 of file lightweight_geom_data.cpp.

References coefs.

Referenced by getUnitaryNormalVector(), and mrpt::opengl::CPolyhedron::setNormal().

◆ getUnitaryNormalVector()

void mrpt::math::TPlane::getUnitaryNormalVector ( double(&)  vec[3])
inline

Unitarize, then get normal vector.

Definition at line 1356 of file lightweight_geom_data.h.

References getNormalVector(), and unitarize().

Referenced by getAsPose3D(), and getAsPose3DForcingOrigin().

◆ unitarize()

void mrpt::math::TPlane::unitarize ( )

Member Data Documentation

◆ coefs

double mrpt::math::TPlane::coefs[4]



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