pub trait FrechetDistance<T, Rhs = Self> {
// Required method
fn frechet_distance(&self, rhs: &Rhs) -> T;
}👎Deprecated since 0.30.0: Please use the
Euclidean.frechet_distance method from the geo::line_measures::FrechetDistance trait insteadExpand description
Determine the similarity between two LineStrings using the Frechet distance.
Based on Computing Discrete Frechet Distance by T. Eiter and H. Mannila.
Required Methods§
Sourcefn frechet_distance(&self, rhs: &Rhs) -> T
👎Deprecated since 0.30.0: Please use the Euclidean.frechet_distance method from the geo::line_measures::FrechetDistance trait instead
fn frechet_distance(&self, rhs: &Rhs) -> T
Euclidean.frechet_distance method from the geo::line_measures::FrechetDistance trait insteadDetermine the similarity between two LineStrings using the Frechet distance.
§Examples
use geo::FrechetDistance;
use geo::line_string;
let line_string_a = line_string![
(x: 1., y: 1.),
(x: 2., y: 1.),
(x: 2., y: 2.),
(x: 3., y: 3.)
];
let line_string_b = line_string![
(x: 2., y: 2.),
(x: 0., y: 1.),
(x: 2., y: 4.),
(x: 3., y: 4.)
];
let distance = line_string_a.frechet_distance(&line_string_b);
assert_eq!(2., distance);