Skip to main content

frechet_decide_certified

Function frechet_decide_certified 

Source
pub fn frechet_decide_certified(
    a: &[DVec3],
    b: &[DVec3],
    eps: f64,
) -> Result<FrechetDecision, FrechetError>
Expand description

A certified decision for whether the continuous Fréchet distance between a and b is at most eps, unlike frechet_at_most (cheaper, but its module docs say plainly it is not certified).

§Design

The decision is monotone non-decreasing in eps, and every distance or foot value it reads is within a conservative bound margin of the true value. If the computed free space already permits a monotone path at the smaller leash eps - margin, the true free space at eps – a superset, since a true distance is at most margin above its computed value – permits it too, so the answer is certainly FrechetDecision::AtMost. Symmetrically, if even the computed free space at the larger leash eps + margin – a superset of the true free space at eps – fails to permit a path, the true one certainly does not, so the answer is certainly FrechetDecision::MoreThan. Otherwise the true distance is provably within margin of eps and the decision is FrechetDecision::Undecided.

§Errors

An empty polyline, a non-finite coordinate, or a negative or non-finite eps.