CGAL 5.4 - Weights
Inverse Distance Weight
#include <CGAL/Weights/inverse_distance_weights.h>


This weight is computed as $$w = \frac{1}{d}$$ with notations shown in the figure below.

Here, the distance is computed between the points p and q.

Alternative formulations are explained in Implementation.

Figure 104.1 Notation used for the inverse distance weight.

Alternative Formulations
This weight is a special case of the Shepard Weight.

Template Parameters
 GeomTraits a model of AnalyticWeightTraits_2 for 2D points; a model of AnalyticWeightTraits_3 for 3D points
Precondition
d != 0

## Functions

template<typename GeomTraits >
GeomTraits::FT CGAL::Weights::inverse_distance_weight (const typename GeomTraits::Point_2 &, const typename GeomTraits::Point_2 &p, const typename GeomTraits::Point_2 &, const typename GeomTraits::Point_2 &q, const GeomTraits &traits)
computes the inverse distance weight in 2D using the points p and q, given a traits class traits with geometric objects, predicates, and constructions.

template<typename GeomTraits >
GeomTraits::FT CGAL::Weights::inverse_distance_weight (const typename GeomTraits::Point_3 &, const typename GeomTraits::Point_3 &p, const typename GeomTraits::Point_3 &, const typename GeomTraits::Point_3 &q, const GeomTraits &traits)
computes the inverse distance weight in 3D using the points p and q, given a traits class traits with geometric objects, predicates, and constructions.

template<typename K >
K::FT CGAL::Weights::inverse_distance_weight (const CGAL::Point_2< K > &, const CGAL::Point_2< K > &p, const CGAL::Point_2< K > &, const CGAL::Point_2< K > &q)
computes the inverse distance weight in 2D using the points p and q, which are parameterized by a Kernel K.

template<typename K >
K::FT CGAL::Weights::inverse_distance_weight (const CGAL::Point_3< K > &, const CGAL::Point_3< K > &p, const CGAL::Point_3< K > &, const CGAL::Point_3< K > &q)
computes the inverse distance weight in 3D using the points p and q, which are parameterized by a Kernel K.

template<typename GeomTraits >
GeomTraits::FT CGAL::Weights::inverse_distance_weight (const typename GeomTraits::Point_2 &p, const typename GeomTraits::Point_2 &q, const GeomTraits &traits)
computes the inverse distance weight in 2D using the points p and q, given a traits class traits with geometric objects, predicates, and constructions.

template<typename GeomTraits >
GeomTraits::FT CGAL::Weights::inverse_distance_weight (const typename GeomTraits::Point_3 &p, const typename GeomTraits::Point_3 &q, const GeomTraits &traits)
computes the inverse distance weight in 3D using the points p and q, given a traits class traits with geometric objects, predicates, and constructions.

template<typename K >
K::FT CGAL::Weights::inverse_distance_weight (const CGAL::Point_2< K > &p, const CGAL::Point_2< K > &q)
computes the inverse distance weight in 2D using the points p and q, which are parameterized by a Kernel K.

template<typename K >
K::FT CGAL::Weights::inverse_distance_weight (const CGAL::Point_3< K > &p, const CGAL::Point_3< K > &q)
computes the inverse distance weight in 3D using the points p and q, which are parameterized by a Kernel K.