Skip to main content

comparable_distance

Function comparable_distance 

Source
pub fn comparable_distance<A, B>(
    a: &A,
    b: &B,
) -> <<DefaultDistanceStrategy<A, B> as DistanceStrategy<A, B>>::Comparable as DistanceStrategy<A, B>>::Out
Expand description

Comparable distance — equivalent ordering, cheaper math.

Mirrors boost::geometry::comparable_distance(g1, g2) from boost/geometry/algorithms/comparable_distance.hpp. The result preserves the ordering of distance but skips work the ordering does not need (e.g. the final sqrt for Pythagoras). The comparable companion of the default strategy is selected via DistanceStrategy::Comparable, the Rust analogue of Boost’s boost::geometry::strategy::distance::services::comparable_type<…>::type.