AUTh-ARL Core Stack  0.7
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Math/Geometry

Math related to geometric calculations. More...

Functions

arma::mat arl::math::getLineSegment (const arma::vec &p1, const arma::vec &p2, double dlambda)
 Calculates a discrete line segments between two points in the N-dimensional space. The function assumes that the two given points are of the same dimension. More...
 
bool arl::math::areCoplanar (const std::vector< KDL::Vector > &point, double epsilon=1e-6)
 Checks if a set of 3D points are cooplannar. More...
 
bool arl::math::areCoplanar (const std::vector< Eigen::Vector3d > &point, double epsilon=1e-6)
 Checks if a set of 3D points are cooplannar. More...
 
void arl::math::sortCircularOrder (const std::vector< KDL::Vector > &input, std::vector< KDL::Vector > *output)
 Sorts a set of unsorted points in circular ordering. More...
 
std::vector< Eigen::Vector3d > arl::math::sortCircularOrder (const std::vector< Eigen::Vector3d > &input)
 Sorts a set of unsorted points in circular ordering. More...
 
bool arl::math::isWithinPolygon (const arma::vec &point, const arma::mat &polygon)
 Checks if a point lies within a polygon. More...
 
double arl::math::getMinimumDistanceOfPointFromLine (const Eigen::Vector3d &line_point_1, const Eigen::Vector3d &line_point_2, const Eigen::Vector3d &point)
 Calculates the minimum distance of a 3D point from a line which is defined by two 3D points, see [4]. More...
 

Detailed Description

Math related to geometric calculations.

Function Documentation

bool arl::math::areCoplanar ( const std::vector< KDL::Vector > &  point,
double  epsilon = 1e-6 
)

Checks if a set of 3D points are cooplannar.

Epsilon = 0 means zero tolerance to errors. Epsilon = 1 means that an arbitrary number of points will be considered as coplanar.

Parameters
pointThe set of points to be tested
epsilonA param which determines the error tolerance
Returns
True if they are coplaner. False otherwise
Deprecated:
Use arl::math::areCoplanar(const std::vector<Eigen::Vector3d>& point, double epsilon = 1e-6) instead
bool arl::math::areCoplanar ( const std::vector< Eigen::Vector3d > &  point,
double  epsilon = 1e-6 
)

Checks if a set of 3D points are cooplannar.

Epsilon = 0 means zero tolerance to errors. Epsilon = 1 means that an arbitrary number of points will be considered as coplanar.

Parameters
pointThe set of points to be tested
epsilonA param which determines the error tolerance
Returns
True if they are coplaner. False otherwise
arma::mat arl::math::getLineSegment ( const arma::vec &  p1,
const arma::vec &  p2,
double  dlambda 
)

Calculates a discrete line segments between two points in the N-dimensional space. The function assumes that the two given points are of the same dimension.

Parameters
p1The first N-dimensional point (start of line segment)
p2The second N-dimensional point (end of line segment)
dlambdaThe step for the discritization of the line segment
Returns
A MxN matrix with M points of the line segment of N dimension.
double arl::math::getMinimumDistanceOfPointFromLine ( const Eigen::Vector3d &  line_point_1,
const Eigen::Vector3d &  line_point_2,
const Eigen::Vector3d &  point 
)

Calculates the minimum distance of a 3D point from a line which is defined by two 3D points, see [4].

Parameters
line_point_1The first point defining the line
line_point_2The second point defining the line
pointThe point for finding the distance
Returns
The minumum distance
bool arl::math::isWithinPolygon ( const arma::vec &  point,
const arma::mat &  polygon 
)

Checks if a point lies within a polygon.

Parameters
pointThe point to check
Thevertices of the polygon. Should be co-planar.
Returns
True if the point lies within the polygon, false otherwise.

Find the normal vector of the plane of the given points

Find the orthonormal basis of the normal vector

Project the point

Project the polygon points

Find the normal vector of the plane of the given points

Find the orthonormal basis of the normal vector

Project the point

Project the polygon points

Here is the call graph for this function:

void arl::math::sortCircularOrder ( const std::vector< KDL::Vector > &  input,
std::vector< KDL::Vector > *  output 
)

Sorts a set of unsorted points in circular ordering.

This method takes the centroid of the points, calculates the vector of each point to the centroid and sort them by using the minimum angle. This method can not guarantee to work with large point clouds with equal minimum angles occur.

Parameters
inputThe set of points to be sorted
outputThe resulted sorted set of points
Deprecated:
Use arl::math::sortCircularOrder(const std::vector<Eigen::Vector3d>& input) instead
std::vector< Eigen::Vector3d > arl::math::sortCircularOrder ( const std::vector< Eigen::Vector3d > &  input)

Sorts a set of unsorted points in circular ordering.

This method takes the centroid of the points, calculates the vector of each point to the centroid and sort them by using the minimum angle. This method can not guarantee to work with large point clouds with equal minimum angles occur.

Parameters
inputThe set of points to be sorted
Returns
The resulted sorted set of points