27 #ifndef MPBLOCKS_KD_TREE_EUCLIDEAN_DISTANCE_HPP_
28 #define MPBLOCKS_KD_TREE_EUCLIDEAN_DISTANCE_HPP_
36 template <
class Traits>
40 return (pa-pb).squaredNorm();
43 template <
class Traits>
50 for (
unsigned int i=0; i < p.rows(); i++)
53 dist2i = h.
minExt[i] - p[i];
54 else if(p[i] > h.
maxExt[i])
55 dist2i = h.
maxExt[i] - p[i];
74 #endif // DEFAULTDISTANCE_H_
Point_t maxExt
maximum extent of hyper-rectangle
Traits::Format_t Format_t
Format_t operator()(const Point_t &pa, const Point_t &pb)
return the euclidean distance between two points
Eigen::Matrix< Format_t, Traits::NDim, 1 > Point_t
double Format_t
number format (i.e. double, float)
Point_t minExt
minimum extent of hyper-rectangle
an NDim dimensional hyperrectangle, represented as a min and max extent