Skip to main content

Module distance

Module distance 

Source
Expand description

User-facing distance / distance_with / comparable_distance entry points.

Mirrors the three free-function overloads Boost.Geometry users reach for:

  • boost::geometry::distance(g1, g2) — strategy-less, picks the default strategy for the coordinate-system pair. See boost/geometry/algorithms/distance.hpp and the dispatch plumbing in boost/geometry/algorithms/detail/distance/interface.hpp.
  • boost::geometry::distance(g1, g2, strategy) — explicit-strategy companion, same file.
  • boost::geometry::comparable_distance(g1, g2) — the “skip the sqrt” form, from boost/geometry/algorithms/comparable_distance.hpp.

The strategy trait, default-strategy projection, and reverse-dispatch wrapper all live in geometry-strategy::distance (T21/T22). T23 is the thin layer that turns them into ordinary Rust functions.

Functions§

comparable_distance
Comparable distance — equivalent ordering, cheaper math.
comparable_distance_with
Comparable distance using an explicitly supplied strategy.
distance
Distance between two geometries using the default strategy for their coordinate-system pair.
distance_with
Distance between two geometries using an explicit strategy.