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

Detailed Description

2D line without bounds, represented by its equation $Ax+By+C=0$.

See Also
TLine3D,TSegment2D,TPolygon2D,TPoint2D

Definition at line 801 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Member Functions

double evaluatePoint (const TPoint2D &point) const
 Evaluate point in the line's equation.
 
bool contains (const TPoint2D &point) const
 Check whether a point is inside the line.
 
double distance (const TPoint2D &point) const
 Distance from a given point.
 
double signedDistance (const TPoint2D &point) const
 Distance with sign from a given point (sign indicates side).
 
void getNormalVector (double(&vector)[2]) const
 Get line's normal vector.
 
void unitarize ()
 Unitarize line's normal vector.
 
void getUnitaryNormalVector (double(&vector)[2])
 Get line's normal vector after unitarizing line.
 
void getDirectorVector (double(&vector)[2]) const
 Get line's director vector.
 
void getUnitaryDirectorVector (double(&vector)[2])
 Unitarize line and then get director vector.
 
void generate3DObject (TLine3D &l) const
 Project into 3D space, setting the z to 0.
 
void getAsPose2D (mrpt::poses::CPose2D &outPose) const
 Get a pose2D whose X axis corresponds to the line.
 
void getAsPose2DForcingOrigin (const TPoint2D &origin, mrpt::poses::CPose2D &outPose) const
 Get a pose2D whose X axis corresponds to the line, forcing the base point to one given.
 
 TLine2D (const TPoint2D &p1, const TPoint2D &p2) throw (std::logic_error)
 Constructor from two points, through which the line will pass.
 
 TLine2D (const TSegment2D &s)
 Constructor from a segment.
 
 TLine2D ()
 Fast default constructor.
 
 TLine2D (double A, double B, double C)
 Constructor from line's coefficients.
 
 TLine2D (const TLine3D &l)
 Construction from 3D object, discarding the Z.
 

Public Attributes

double coefs [3]
 Line coefficients, stored as an array: $\left[A,B,C\right]$.
 

Constructor & Destructor Documentation

mrpt::math::TLine2D::TLine2D ( const TPoint2D p1,
const TPoint2D p2 
) throw (std::logic_error)

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

Exceptions
logic_errorif both points are the same
mrpt::math::TLine2D::TLine2D ( const TSegment2D s)
explicit

Constructor from a segment.

mrpt::math::TLine2D::TLine2D ( )
inline

Fast default constructor.

Initializes to garbage.

Definition at line 876 of file lightweight_geom_data.h.

mrpt::math::TLine2D::TLine2D ( double  A,
double  B,
double  C 
)
inline

Constructor from line's coefficients.

Definition at line 880 of file lightweight_geom_data.h.

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

Construction from 3D object, discarding the Z.

Exceptions
std::logic_errorif the line is normal to the XY plane.

Member Function Documentation

bool mrpt::math::TLine2D::contains ( const TPoint2D point) const

Check whether a point is inside the line.

double mrpt::math::TLine2D::distance ( const TPoint2D point) const

Distance from a given point.

double mrpt::math::TLine2D::evaluatePoint ( const TPoint2D point) const

Evaluate point in the line's equation.

void mrpt::math::TLine2D::generate3DObject ( TLine3D l) const

Project into 3D space, setting the z to 0.

void mrpt::math::TLine2D::getAsPose2D ( mrpt::poses::CPose2D outPose) const

Get a pose2D whose X axis corresponds to the line.

See Also
mrpt::poses::CPose2D.

Referenced by mrpt::math::project2D().

void mrpt::math::TLine2D::getAsPose2DForcingOrigin ( const TPoint2D origin,
mrpt::poses::CPose2D outPose 
) const

Get a pose2D whose X axis corresponds to the line, forcing the base point to one given.

Exceptions
logic_errorif the point is not inside the line.
See Also
mrpt::poses::CPose2D.

Referenced by mrpt::math::project2D().

void mrpt::math::TLine2D::getDirectorVector ( double(&)  vector[2]) const

Get line's director vector.

void mrpt::math::TLine2D::getNormalVector ( double(&)  vector[2]) const

Get line's normal vector.

void mrpt::math::TLine2D::getUnitaryDirectorVector ( double(&)  vector[2])
inline

Unitarize line and then get director vector.

Definition at line 845 of file lightweight_geom_data.h.

void mrpt::math::TLine2D::getUnitaryNormalVector ( double(&)  vector[2])
inline

Get line's normal vector after unitarizing line.

Definition at line 834 of file lightweight_geom_data.h.

double mrpt::math::TLine2D::signedDistance ( const TPoint2D point) const

Distance with sign from a given point (sign indicates side).

void mrpt::math::TLine2D::unitarize ( )

Unitarize line's normal vector.

Member Data Documentation

double mrpt::math::TLine2D::coefs[3]

Line coefficients, stored as an array: $\left[A,B,C\right]$.

Definition at line 806 of file lightweight_geom_data.h.

Referenced by mrpt::math::operator<<(), and mrpt::math::operator>>().




Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013