Class

CGAL::Euclidean_distance<Traits>

Definition

The class Euclidean_distance<Traits> provides an implementation of the concept OrthogonalDistance, with the Euclidean distance (l2 metric). To optimize distance computations squared distances are used.

#include <CGAL/Euclidean_distance.h>

Parameters

Expects for the first template argument a model of the concept SearchTraits, for example CGAL::Search_traits_2<CGAL::Cartesian<double> >.

Is Model for the Concepts

OrthogonalDistance

Types

Traits::FT FT; Number type.

Traits::Point_d Point_d; Point type.

Point_d Query_item; Query item type.

Creation

Euclidean_distance<Traits> ed ( Traits t=Traits());
Default constructor.

Operations

FT ed.transformed_distance ( Query_item q, Point_d p) const
Returns the squared Euclidean distance between q and p.

FT ed.min_distance_to_rectangle ( Query_item q, Kd_tree_rectangle<FT> r) const
Returns the squared Euclidean distance between q and the point on the boundary of r closest to q.

FT ed.max_distance_to_rectangle ( Query_item q, Kd_tree_rectangle<FT> 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 ed.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 ed.transformed_distance ( FT d) const
Returns d2.

FT ed.inverse_of_transformed_distance ( FT d) const
Returns d1/2.

See Also

OrthogonalDistance
CGAL::Weighted_Minkowski_distance<Traits>