\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.10.2 - dD Spatial Searching
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
CGAL::Euclidean_distance< Traits > Class Template Reference

#include <CGAL/Euclidean_distance.h>

Definition

The class Euclidean_distance provides an implementation of the concept OrthogonalDistance, with the Euclidean distance ( \( l_2\) metric).

To optimize distance computations squared distances are used.

Template Parameters
Traitsmust be a model of the concept SearchTraits, for example Search_traits_2<Simple_cartesian<double> >.
Is Model Of:
OrthogonalDistance
See Also
OrthogonalDistance
CGAL::Weighted_Minkowski_distance<Traits>
Examples:
Spatial_searching/searching_sphere_orthogonally.cpp, Spatial_searching/splitter_worst_cases.cpp, and Spatial_searching/using_fair_splitting_rule.cpp.

Types

typedef Traits::Dimension D
 Dimension Tag.
 
typedef Traits::FT FT
 Number type.
 
typedef Traits::Point_d Point_d
 Point type.
 
typedef Point_d Query_item
 Query item type.
 

Creation

 Euclidean_distance (Traits t=Traits())
 Default constructor.
 

Operations

FT transformed_distance (Query_item q, Point_d p) const
 Returns the squared Euclidean distance between q and p.
 
FT min_distance_to_rectangle (Query_item q, Kd_tree_rectangle< FT, D > r) const
 Returns the squared Euclidean distance between q and the point on the boundary of r closest to q.
 
FT min_distance_to_rectangle (Query_item q, Kd_tree_rectangle< FT, D > r, vector< FT > &dists)
 Returns the squared Euclidean distance between q and the point on the boundary of r closest to q. More...
 
FT max_distance_to_rectangle (Query_item q, Kd_tree_rectangle< FT, D > r) const
 Returns the squared Euclidean distance, where \( d\) denotes the distance between q and the point on the boundary of r farthest to q.
 
FT max_distance_to_rectangle (Query_item q, Kd_tree_rectangle< FT, D > r, vector< FT > &dists)
 Returns the squared Euclidean distance, where \( d\) denotes the distance between q and the point on the boundary of r farthest to q. More...
 
FT new_distance (FT dist, FT old_off, FT new_off, int cutting_dimension) const
 Updates the squared dist incrementally and returns the updated squared distance.
 
FT transformed_distance (FT d) const
 Returns \( d^2\).
 
FT inverse_of_transformed_distance (FT d) const
 Returns \( d^{1/2}\).
 

Member Function Documentation

template<typename Traits >
FT CGAL::Euclidean_distance< Traits >::max_distance_to_rectangle ( Query_item  q,
Kd_tree_rectangle< FT, D r,
vector< FT > &  dists 
)

Returns the squared Euclidean distance, where \( d\) denotes the distance between q and the point on the boundary of r farthest to q.

Stores the distances in each dimension in dists.

template<typename Traits >
FT CGAL::Euclidean_distance< Traits >::min_distance_to_rectangle ( Query_item  q,
Kd_tree_rectangle< FT, D r,
vector< FT > &  dists 
)

Returns the squared Euclidean distance between q and the point on the boundary of r closest to q.

Stores the distances in each dimension in dists.