The continuous Fréchet distance
There are several ways to compute it; pick one by what you need.
| You need | Use | How it works |
|---|---|---|
| The exact distance, with no tolerance | frechet_c_compute_exact(P, Q) | The exact distance |
| The distance to a chosen precision (10⁻¹⁰ relative by default), fast | frechet_c_compute_bisect(P, Q) | The distance by bisection |
Only whether the distance is at most r, exactly | frechet_c_decide_exact(P, Q, r) | The decision procedure |
| An approximation within a given factor, with a matching and a certified lower bound | frechet_c_approx(P, Q, approx) | Implemented algorithms |
| The distance to a relative tolerance with a matching that realizes it | frechet_c_compute(P, Q) | Implemented algorithms |
The first two are the recommended ones: the exact distance takes quadratic time and memory in the number of vertices, and the bisection is usually much faster. The older frechet_c_compute can be catastrophically slow on some inputs; use it only when you need the matching. For curves prepared once and queried many times, see Prepared curves. How fast they are, against the other implementations: Performance.