pub trait FrechetDistance<T, Rhs = Self> {
    // Required method
    fn frechet_distance(&self, rhs: &Rhs) -> T;
}
Expand 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§

source

fn frechet_distance(&self, rhs: &Rhs) -> T

Determine 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);

Implementors§