AUTh-ARL Core Stack
0.7
|
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... | |
Math related to geometric calculations.
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.
point | The set of points to be tested |
epsilon | A param which determines the error tolerance |
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.
point | The set of points to be tested |
epsilon | A param which determines the error tolerance |
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.
p1 | The first N-dimensional point (start of line segment) |
p2 | The second N-dimensional point (end of line segment) |
dlambda | The step for the discritization of the line segment |
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].
line_point_1 | The first point defining the line |
line_point_2 | The second point defining the line |
point | The point for finding the distance |
bool arl::math::isWithinPolygon | ( | const arma::vec & | point, |
const arma::mat & | polygon | ||
) |
Checks if a point lies within a polygon.
point | The point to check |
The | vertices of the polygon. Should be co-planar. |
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
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.
input | The set of points to be sorted |
output | The resulted sorted set of points |
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.
input | The set of points to be sorted |