jagua_rs::geometry::geo_traits

Trait SeparationDistance

Source
pub trait SeparationDistance<T>: Distance<T> {
    // Required methods
    fn separation_distance(&self, other: &T) -> (GeoPosition, fsize);
    fn sq_separation_distance(&self, other: &T) -> (GeoPosition, fsize);
}
Expand description

Trait for geometric primitives that can calculate the minimum distance to separate from another primitive. In case they are already separated, the minimum distance between them is returned

Required Methods§

Source

fn separation_distance(&self, other: &T) -> (GeoPosition, fsize)

In case of a collision between self and other, returns GeoPosition::Interior and the minimum distance to separate the two primitives. Otherwise, returns GeoPosition::Exterior and the minimum distance between the two primitives. (similar to Distance::distance)

Source

fn sq_separation_distance(&self, other: &T) -> (GeoPosition, fsize)

Implementors§