A Clojure(script) library to calculate the discrete Fréchet distance of two polygonal curves as stated by Eiter and Mannilla. The curves may be N-dimensional and need not be the same length.
Simply create 2D vectors with the points that describe the curves.
In order to compute the frechet distance you need to provide a metric function
to compute the distance between any point on the curves. The euclidean
function
is also part of the library for convenience.
(ns example.core
(:require [carocad.frechet :as frechet]))
(frechet/distance [[1 2] [3 4]]
[[5 6] [7 8] [9 0]]
frechet/euclidean)
;; #:carocad.frechet{:distance 7.211102550927978, :coupling ([0 0] [1 1] [1 2])}
For more information please check the documentation in CljDoc.
Copyright © 2015 Camilo Roca
Distributed under the LGPL v3.