MRPT  1.9.9
Namespaces | Functions
geometry.h File Reference
#include <mrpt/math/CMatrixDynamic.h>
#include <mrpt/math/CMatrixFixed.h>
#include <mrpt/math/CSparseMatrixTemplate.h>
#include <mrpt/math/TLine2D.h>
#include <mrpt/math/TPolygon3D.h>
#include <mrpt/math/TPolygonWithPlane.h>
#include <mrpt/math/TPose3D.h>
#include <mrpt/math/epsilon.h>
#include <mrpt/math/math_frwds.h>
#include <mrpt/math/wrap2pi.h>
Include dependency graph for geometry.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mrpt::math
 This base provides a set of functions for maths stuff.
 
 mrpt::math::internal
 

Functions

void mrpt::math::internal::unsafeProjectPolygon (const TPolygon3D &poly, const TPose3D &pose, TPolygon2D &newPoly)
 
Simple intersection operations, relying basically on geometrical

operations.

bool mrpt::math::intersect (const TSegment3D &s1, const TSegment3D &s2, TObject3D &obj)
 Gets the intersection between two 3D segments. More...
 
bool mrpt::math::intersect (const TSegment3D &s1, const TPlane &p2, TObject3D &obj)
 Gets the intersection between a 3D segment and a plane. More...
 
bool mrpt::math::intersect (const TSegment3D &s1, const TLine3D &r2, TObject3D &obj)
 Gets the intersection between a 3D segment and a 3D line. More...
 
bool mrpt::math::intersect (const TPlane &p1, const TSegment3D &s2, TObject3D &obj)
 Gets the intersection between a plane and a 3D segment. More...
 
bool mrpt::math::intersect (const TPlane &p1, const TPlane &p2, TObject3D &obj)
 Gets the intersection between two planes. More...
 
bool mrpt::math::intersect (const TPlane &p1, const TLine3D &p2, TObject3D &obj)
 Gets the intersection between a plane and a 3D line. More...
 
bool mrpt::math::intersect (const TLine3D &r1, const TSegment3D &s2, TObject3D &obj)
 Gets the intersection between a 3D line and a 3D segment. More...
 
bool mrpt::math::intersect (const TLine3D &r1, const TPlane &p2, TObject3D &obj)
 Gets the intersection between a 3D line and a plane. More...
 
bool mrpt::math::intersect (const TLine3D &r1, const TLine3D &r2, TObject3D &obj)
 Gets the intersection between two 3D lines. More...
 
bool mrpt::math::intersect (const TLine2D &r1, const TLine2D &r2, TObject2D &obj)
 Gets the intersection between two 2D lines. More...
 
bool mrpt::math::intersect (const TLine2D &r1, const TSegment2D &s2, TObject2D &obj)
 Gets the intersection between a 2D line and a 2D segment. More...
 
bool mrpt::math::intersect (const TSegment2D &s1, const TLine2D &r2, TObject2D &obj)
 Gets the intersection between a 2D line and a 2D segment. More...
 
bool mrpt::math::intersect (const TSegment2D &s1, const TSegment2D &s2, TObject2D &obj)
 Gets the intersection between two 2D segments. More...
 
Angle retrieval methods. Methods which use TSegments will

automatically use TLines' implicit constructors.

double mrpt::math::getAngle (const TPlane &p1, const TPlane &p2)
 Computes the angle between two planes. More...
 
double mrpt::math::getAngle (const TPlane &p1, const TLine3D &r2)
 Computes the angle between a plane and a 3D line or segment (implicit constructor will be used if passing a segment instead of a line). More...
 
double mrpt::math::getAngle (const TLine3D &r1, const TPlane &p2)
 Computes the angle between a 3D line or segment and a plane (implicit constructor will be used if passing a segment instead of a line). More...
 
double mrpt::math::getAngle (const TLine3D &r1, const TLine3D &r2)
 Computes the accute relative angle (range: [-PI/2,PI/2]) between two lines. More...
 
double mrpt::math::getAngle (const TLine2D &r1, const TLine2D &r2)
 Computes the relative angle (range: [-PI,PI]) of line 2 wrt line 1. More...
 
Creation of lines from poses.
void mrpt::math::createFromPoseX (const mrpt::math::TPose3D &p, TLine3D &r)
 Gets a 3D line corresponding to the X axis in a given pose. More...
 
void mrpt::math::createFromPoseY (const mrpt::math::TPose3D &p, TLine3D &r)
 Gets a 3D line corresponding to the Y axis in a given pose. More...
 
void mrpt::math::createFromPoseZ (const mrpt::math::TPose3D &p, TLine3D &r)
 Gets a 3D line corresponding to the Z axis in a given pose. More...
 
void mrpt::math::createFromPoseAndVector (const mrpt::math::TPose3D &p, const double(&vector)[3], TLine3D &r)
 Gets a 3D line corresponding to any arbitrary vector, in the base given by the pose. More...
 
void mrpt::math::createFromPoseX (const TPose2D &p, TLine2D &r)
 Gets a 2D line corresponding to the X axis in a given pose. More...
 
void mrpt::math::createFromPoseY (const TPose2D &p, TLine2D &r)
 Gets a 2D line corresponding to the Y axis in a given pose. More...
 
void mrpt::math::createFromPoseAndVector (const TPose2D &p, const double(&vector)[2], TLine2D &r)
 Gets a 2D line corresponding to any arbitrary vector, in the base given the given pose. More...
 
Other line or plane related methods.
bool mrpt::math::conformAPlane (const std::vector< TPoint3D > &points)
 Checks whether this polygon or set of points acceptably fits a plane. More...
 
bool mrpt::math::conformAPlane (const std::vector< TPoint3D > &points, TPlane &p)
 Checks whether this polygon or set of points acceptably fits a plane, and if it's the case returns it in the second argument. More...
 
bool mrpt::math::areAligned (const std::vector< TPoint2D > &points)
 Checks whether this set of points acceptably fits a 2D line. More...
 
bool mrpt::math::areAligned (const std::vector< TPoint2D > &points, TLine2D &r)
 Checks whether this set of points acceptably fits a 2D line, and if it's the case returns it in the second argument. More...
 
bool mrpt::math::areAligned (const std::vector< TPoint3D > &points)
 Checks whether this set of points acceptably fits a 3D line. More...
 
bool mrpt::math::areAligned (const std::vector< TPoint3D > &points, TLine3D &r)
 Checks whether this set of points acceptably fits a 3D line, and if it's the case returns it in the second argument. More...
 
Projections
void mrpt::math::project3D (const TPoint3D &point, const mrpt::math::TPose3D &newXYpose, TPoint3D &newPoint)
 Uses the given pose 3D to project a point into a new base. More...
 
void mrpt::math::project3D (const TSegment3D &segment, const mrpt::math::TPose3D &newXYpose, TSegment3D &newSegment)
 Uses the given pose 3D to project a segment into a new base. More...
 
void mrpt::math::project3D (const TLine3D &line, const mrpt::math::TPose3D &newXYpose, TLine3D &newLine)
 Uses the given pose 3D to project a line into a new base. More...
 
void mrpt::math::project3D (const TPlane &plane, const mrpt::math::TPose3D &newXYpose, TPlane &newPlane)
 Uses the given pose 3D to project a plane into a new base. More...
 
void mrpt::math::project3D (const TPolygon3D &polygon, const mrpt::math::TPose3D &newXYpose, TPolygon3D &newPolygon)
 Uses the given pose 3D to project a polygon into a new base. More...
 
void mrpt::math::project3D (const TObject3D &object, const mrpt::math::TPose3D &newXYPose, TObject3D &newObject)
 Uses the given pose 3D to project any 3D object into a new base. More...
 
template<class T >
void mrpt::math::project3D (const T &obj, const TPlane &newXYPlane, T &newObj)
 Projects any 3D object into the plane's base, using its inverse pose. More...
 
template<class T >
void mrpt::math::project3D (const T &obj, const TPlane &newXYPlane, const TPoint3D &newOrigin, T &newObj)
 Projects any 3D object into the plane's base, using its inverse pose and forcing the position of the new coordinates origin. More...
 
template<class T >
void mrpt::math::project3D (const std::vector< T > &objs, const mrpt::math::TPose3D &newXYpose, std::vector< T > &newObjs)
 Projects a set of 3D objects into the plane's base. More...
 
void mrpt::math::project2D (const TPoint2D &point, const TPose2D &newXpose, TPoint2D &newPoint)
 Uses the given pose 2D to project a point into a new base. More...
 
void mrpt::math::project2D (const TSegment2D &segment, const TPose2D &newXpose, TSegment2D &newSegment)
 Uses the given pose 2D to project a segment into a new base. More...
 
void mrpt::math::project2D (const TLine2D &line, const TPose2D &newXpose, TLine2D &newLine)
 Uses the given pose 2D to project a line into a new base. More...
 
void mrpt::math::project2D (const TPolygon2D &polygon, const TPose2D &newXpose, TPolygon2D &newPolygon)
 Uses the given pose 2D to project a polygon into a new base. More...
 
void mrpt::math::project2D (const TObject2D &object, const TPose2D &newXpose, TObject2D &newObject)
 Uses the given pose 2D to project any 2D object into a new base. More...
 
template<class T , class CPOSE2D >
void mrpt::math::project2D (const T &obj, const TLine2D &newXLine, T &newObj)
 Projects any 2D object into the line's base, using its inverse pose. More...
 
template<class T , class CPOSE2D >
void mrpt::math::project2D (const T &obj, const TLine2D &newXLine, const TPoint2D &newOrigin, T &newObj)
 Projects any 2D object into the line's base, using its inverse pose and forcing the position of the new coordinate origin. More...
 
template<class T >
void mrpt::math::project2D (const std::vector< T > &objs, const TPose2D &newXpose, std::vector< T > &newObjs)
 Projects a set of 2D objects into the line's base. More...
 
Polygon intersections. These operations rely more on spatial reasoning

than in raw numerical operations.

bool mrpt::math::intersect (const TPolygon2D &p1, const TSegment2D &s2, TObject2D &obj)
 Gets the intersection between a 2D polygon and a 2D segment. More...
 
bool mrpt::math::intersect (const TPolygon2D &p1, const TLine2D &r2, TObject2D &obj)
 Gets the intersection between a 2D polygon and a 2D line. More...
 
bool mrpt::math::intersect (const TPolygon2D &p1, const TPolygon2D &p2, TObject2D &obj)
 Gets the intersection between two 2D polygons. More...
 
bool mrpt::math::intersect (const TSegment2D &s1, const TPolygon2D &p2, TObject2D &obj)
 Gets the intersection between a 2D segment and a 2D polygon. More...
 
bool mrpt::math::intersect (const TLine2D &r1, const TPolygon2D &p2, TObject2D &obj)
 Gets the intersection between a 2D line and a 2D polygon. More...
 
bool mrpt::math::intersect (const TPolygon3D &p1, const TSegment3D &s2, TObject3D &obj)
 Gets the intersection between a 3D polygon and a 3D segment. More...
 
bool mrpt::math::intersect (const TPolygon3D &p1, const TLine3D &r2, TObject3D &obj)
 Gets the intersection between a 3D polygon and a 3D line. More...
 
bool mrpt::math::intersect (const TPolygon3D &p1, const TPlane &p2, TObject3D &obj)
 Gets the intersection between a 3D polygon and a plane. More...
 
bool mrpt::math::intersect (const TPolygon3D &p1, const TPolygon3D &p2, TObject3D &obj)
 Gets the intersection between two 3D polygons. More...
 
bool mrpt::math::intersect (const TSegment3D &s1, const TPolygon3D &p2, TObject3D &obj)
 Gets the intersection between a 3D segment and a 3D polygon. More...
 
bool mrpt::math::intersect (const TLine3D &r1, const TPolygon3D &p2, TObject3D &obj)
 Gets the intersection between a 3D line and a 3D polygon. More...
 
bool mrpt::math::intersect (const TPlane &p1, const TPolygon3D &p2, TObject3D &obj)
 Gets the intersection between a plane and a 3D polygon. More...
 
size_t mrpt::math::intersect (const std::vector< TPolygon3D > &v1, const std::vector< TPolygon3D > &v2, CSparseMatrixTemplate< TObject3D > &objs)
 Gets the intersection between two sets of 3D polygons. More...
 
size_t mrpt::math::intersect (const std::vector< TPolygon3D > &v1, const std::vector< TPolygon3D > &v2, std::vector< TObject3D > &objs)
 Gets the intersection between two sets of 3D polygons. More...
 
Other intersections
template<class T , class U , class O >
size_t mrpt::math::intersect (const std::vector< T > &v1, const std::vector< U > &v2, CSparseMatrixTemplate< O > &objs)
 Gets the intersection between vectors of geometric objects and returns it in a sparse matrix of either TObject2D or TObject3D. More...
 
template<class T , class U , class O >
size_t mrpt::math::intersect (const std::vector< T > &v1, const std::vector< U > &v2, std::vector< O > objs)
 Gets the intersection between vectors of geometric objects and returns it in a vector of either TObject2D or TObject3D. More...
 
bool mrpt::math::intersect (const TObject2D &o1, const TObject2D &o2, TObject2D &obj)
 Gets the intersection between any pair of 2D objects. More...
 
bool mrpt::math::intersect (const TObject3D &o1, const TObject3D &o2, TObject3D &obj)
 Gets the intersection between any pair of 3D objects. More...
 
Distances
double mrpt::math::distance (const TPoint2D &p1, const TPoint2D &p2)
 Gets the distance between two points in a 2D space. More...
 
double mrpt::math::distance (const TPoint3D &p1, const TPoint3D &p2)
 Gets the distance between two points in a 3D space. More...
 
double mrpt::math::distance (const TLine2D &r1, const TLine2D &r2)
 Gets the distance between two lines in a 2D space. More...
 
double mrpt::math::distance (const TLine3D &r1, const TLine3D &r2)
 Gets the distance between two lines in a 3D space. More...
 
double mrpt::math::distance (const TPlane &p1, const TPlane &p2)
 Gets the distance between two planes. More...
 
double mrpt::math::distance (const TPolygon2D &p1, const TPolygon2D &p2)
 Gets the distance between two polygons in a 2D space. More...
 
double mrpt::math::distance (const TPolygon2D &p1, const TSegment2D &s2)
 Gets the distance between a polygon and a segment in a 2D space. More...
 
double mrpt::math::distance (const TSegment2D &s1, const TPolygon2D &p2)
 Gets the distance between a segment and a polygon in a 2D space. More...
 
double mrpt::math::distance (const TPolygon2D &p1, const TLine2D &l2)
 Gets the distance between a polygon and a line in a 2D space. More...
 
double mrpt::math::distance (const TLine2D &l1, const TPolygon2D &p2)
 
double mrpt::math::distance (const TPolygon3D &p1, const TPolygon3D &p2)
 Gets the distance between two polygons in a 3D space. More...
 
double mrpt::math::distance (const TPolygon3D &p1, const TSegment3D &s2)
 Gets the distance between a polygon and a segment in a 3D space. More...
 
double mrpt::math::distance (const TSegment3D &s1, const TPolygon3D &p2)
 Gets the distance between a segment and a polygon in a 3D space. More...
 
double mrpt::math::distance (const TPolygon3D &p1, const TLine3D &l2)
 Gets the distance between a polygon and a line in a 3D space. More...
 
double mrpt::math::distance (const TLine3D &l1, const TPolygon3D &p2)
 Gets the distance between a line and a polygon in a 3D space. More...
 
double mrpt::math::distance (const TPolygon3D &po, const TPlane &pl)
 Gets the distance between a polygon and a plane. More...
 
double mrpt::math::distance (const TPlane &pl, const TPolygon3D &po)
 Gets the distance between a plane and a polygon. More...
 
Bound checkers
void mrpt::math::getRectangleBounds (const std::vector< TPoint2D > &poly, TPoint2D &pMin, TPoint2D &pMax)
 Gets the rectangular bounds of a 2D polygon or set of 2D points. More...
 
void mrpt::math::getPrismBounds (const std::vector< TPoint3D > &poly, TPoint3D &pMin, TPoint3D &pMax)
 Gets the prism bounds of a 3D polygon or set of 3D points. More...
 
Creation of planes from poses
void mrpt::math::createPlaneFromPoseXY (const mrpt::math::TPose3D &pose, TPlane &plane)
 Given a pose, creates a plane orthogonal to its Z vector. More...
 
void mrpt::math::createPlaneFromPoseXZ (const mrpt::math::TPose3D &pose, TPlane &plane)
 Given a pose, creates a plane orthogonal to its Y vector. More...
 
void mrpt::math::createPlaneFromPoseYZ (const mrpt::math::TPose3D &pose, TPlane &plane)
 Given a pose, creates a plane orthogonal to its X vector. More...
 
void mrpt::math::createPlaneFromPoseAndNormal (const mrpt::math::TPose3D &pose, const double(&normal)[3], TPlane &plane)
 Given a pose and any vector, creates a plane orthogonal to that vector in the pose's coordinates. More...
 
CMatrixDouble44 mrpt::math::generateAxisBaseFromDirectionAndAxis (const mrpt::math::TVector3D &vec, uint8_t coord)
 Creates a homogeneus matrix (4x4) such that the coordinate given (0 for x, 1 for y, 2 for z) corresponds to the provided vector. More...
 
Linear regression methods
double mrpt::math::getRegressionLine (const std::vector< TPoint2D > &points, TLine2D &line)
 Using eigenvalues, gets the best fitting line for a set of 2D points. More...
 
double mrpt::math::getRegressionLine (const std::vector< TPoint3D > &points, TLine3D &line)
 Using eigenvalues, gets the best fitting line for a set of 3D points. More...
 
double mrpt::math::getRegressionPlane (const std::vector< TPoint3D > &points, TPlane &plane)
 Using eigenvalues, gets the best fitting plane for a set of 3D points. More...
 
Miscellaneous Geometry methods
void mrpt::math::assemblePolygons (const std::vector< TSegment3D > &segms, std::vector< TPolygon3D > &polys)
 Tries to assemble a set of segments into a set of closed polygons. More...
 
void mrpt::math::assemblePolygons (const std::vector< TSegment3D > &segms, std::vector< TPolygon3D > &polys, std::vector< TSegment3D > &remainder)
 Tries to assemble a set of segments into a set of closed polygons, returning the unused segments as another out parameter. More...
 
void mrpt::math::assemblePolygons (const std::vector< TObject3D > &objs, std::vector< TPolygon3D > &polys)
 Extracts all the polygons, including those formed from segments, from the set of objects. More...
 
void mrpt::math::assemblePolygons (const std::vector< TObject3D > &objs, std::vector< TPolygon3D > &polys, std::vector< TObject3D > &remainder)
 Extracts all the polygons, including those formed from segments, from the set of objects. More...
 
void mrpt::math::assemblePolygons (const std::vector< TObject3D > &objs, std::vector< TPolygon3D > &polys, std::vector< TSegment3D > &remainder1, std::vector< TObject3D > &remainder2)
 Extracts all the polygons, including those formed from segments, from the set of objects. More...
 
bool mrpt::math::splitInConvexComponents (const TPolygon2D &poly, std::vector< TPolygon2D > &components)
 Splits a 2D polygon into convex components. More...
 
bool mrpt::math::splitInConvexComponents (const TPolygon3D &poly, std::vector< TPolygon3D > &components)
 Splits a 3D polygon into convex components. More...
 
void mrpt::math::getSegmentBisector (const TSegment2D &sgm, TLine2D &bis)
 Gets the bisector of a 2D segment. More...
 
void mrpt::math::getSegmentBisector (const TSegment3D &sgm, TPlane &bis)
 Gets the bisector of a 3D segment. More...
 
void mrpt::math::getAngleBisector (const TLine2D &l1, const TLine2D &l2, TLine2D &bis)
 Gets the bisector of two lines or segments (implicit constructor will be used if necessary) More...
 
void mrpt::math::getAngleBisector (const TLine3D &l1, const TLine3D &l2, TLine3D &bis)
 Gets the bisector of two lines or segments (implicit constructor will be used if necessary) More...
 
bool mrpt::math::traceRay (const std::vector< TPolygonWithPlane > &vec, const mrpt::math::TPose3D &pose, double &dist)
 Fast ray tracing method using polygons' properties. More...
 
bool mrpt::math::traceRay (const std::vector< TPolygon3D > &vec, const mrpt::math::TPose3D &pose, double &dist)
 Fast ray tracing method using polygons' properties. More...
 
template<class T , class U , class V >
void mrpt::math::crossProduct3D (const T &v0, const U &v1, V &vOut)
 Computes the cross product of two 3D vectors, returning a vector normal to both. More...
 
template<class T >
void mrpt::math::crossProduct3D (const std::vector< T > &v0, const std::vector< T > &v1, std::vector< T > &v_out)
 
template<class VEC1 , class VEC2 >
VEC1 mrpt::math::crossProduct3D (const VEC1 &v0, const VEC2 &v1)
 overload (returning a vector of size 3 by value). More...
 
template<class VECTOR , class MATRIX >
void mrpt::math::skew_symmetric3 (const VECTOR &v, MATRIX &M)
 Computes the 3x3 skew symmetric matrix from a 3-vector or 3-array:

\[ M([x ~ y ~ z]^\top) = \left( \begin{array}{c c c} 0 & -z & y \\ z & 0 & -x \\ -y & x & 0 \end{array} \right) \]

. More...

 
template<class VECTOR >
mrpt::math::CMatrixDouble33 mrpt::math::skew_symmetric3 (const VECTOR &v)
 
template<class VECTOR , class MATRIX >
void mrpt::math::skew_symmetric3_neg (const VECTOR &v, MATRIX &M)
 Computes the negative version of a 3x3 skew symmetric matrix from a 3-vector or 3-array:

\[ -M([x ~ y ~ z]^\top) = \left( \begin{array}{c c c} 0 & z & -y \\ -z & 0 & x \\ y & -x & 0 \end{array} \right) \]

. More...

 
template<class VECTOR >
mrpt::math::CMatrixDouble33 mrpt::math::skew_symmetric3_neg (const VECTOR &v)
 
template<class T , class U >
bool mrpt::math::vectorsAreParallel2D (const T &v1, const U &v2)
 Returns true if two 2D vectors are parallel. More...
 
template<class T , class U >
bool mrpt::math::vectorsAreParallel3D (const T &v1, const U &v2)
 Returns true if two 3D vectors are parallel. More...
 
void mrpt::math::closestFromPointToSegment (double Px, double Py, double x1, double y1, double x2, double y2, double &out_x, double &out_y)
 Computes the closest point from a given point to a segment. More...
 
void mrpt::math::closestFromPointToLine (double Px, double Py, double x1, double y1, double x2, double y2, double &out_x, double &out_y)
 Computes the closest point from a given point to a (infinite) line. More...
 
double mrpt::math::closestSquareDistanceFromPointToLine (double Px, double Py, double x1, double y1, double x2, double y2)
 Returns the square distance from a point to a line. More...
 
template<typename T >
mrpt::math::distanceBetweenPoints (const T x1, const T y1, const T x2, const T y2)
 Returns the distance between 2 points in 2D. More...
 
template<typename T >
mrpt::math::distanceBetweenPoints (const T x1, const T y1, const T z1, const T x2, const T y2, const T z2)
 Returns the distance between 2 points in 3D. More...
 
template<typename T >
mrpt::math::distanceSqrBetweenPoints (const T x1, const T y1, const T x2, const T y2)
 Returns the square distance between 2 points in 2D. More...
 
template<typename T >
mrpt::math::distanceSqrBetweenPoints (const T x1, const T y1, const T z1, const T x2, const T y2, const T z2)
 Returns the square distance between 2 points in 3D. More...
 
template<typename T >
double mrpt::math::minimumDistanceFromPointToSegment (const double Px, const double Py, const double x1, const double y1, const double x2, const double y2, T &out_x, T &out_y)
 Computes the closest point from a given point to a segment, and returns that minimum distance. More...
 
bool mrpt::math::SegmentsIntersection (const double x1, const double y1, const double x2, const double y2, const double x3, const double y3, const double x4, const double y4, double &ix, double &iy)
 Returns the intersection point, and if it exists, between two segments. More...
 
bool mrpt::math::SegmentsIntersection (const double x1, const double y1, const double x2, const double y2, const double x3, const double y3, const double x4, const double y4, float &ix, float &iy)
 Returns the intersection point, and if it exists, between two segments. More...
 
bool mrpt::math::pointIntoPolygon2D (double px, double py, unsigned int polyEdges, const double *poly_xs, const double *poly_ys)
 Returns true if the 2D point (px,py) falls INTO the given polygon. More...
 
template<typename T >
bool mrpt::math::pointIntoQuadrangle (T x, T y, T v1x, T v1y, T v2x, T v2y, T v3x, T v3y, T v4x, T v4y)
 Specialized method to check whether a point (x,y) falls into a quadrangle. More...
 
double mrpt::math::distancePointToPolygon2D (double px, double py, unsigned int polyEdges, const double *poly_xs, const double *poly_ys)
 Returns the closest distance of a given 2D point to a polygon, or "0" if the point is INTO the polygon or its perimeter. More...
 
bool mrpt::math::minDistBetweenLines (double p1_x, double p1_y, double p1_z, double p2_x, double p2_y, double p2_z, double p3_x, double p3_y, double p3_z, double p4_x, double p4_y, double p4_z, double &x, double &y, double &z, double &dist)
 Calculates the minimum distance between a pair of lines. More...
 
bool mrpt::math::RectanglesIntersection (double R1_x_min, double R1_x_max, double R1_y_min, double R1_y_max, double R2_x_min, double R2_x_max, double R2_y_min, double R2_y_max, double R2_pose_x, double R2_pose_y, double R2_pose_phi)
 Returns whether two rotated rectangles intersect. More...
 
CMatrixDouble33 mrpt::math::generateAxisBaseFromDirection (double dx, double dy, double dz)
 Computes an axis base (a set of three 3D normal vectors) with the given vector being the first of them ("X") NOTE: Make sure of passing all floats or doubles and that the template of the receiving matrix is of the same type! More...
 



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020