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§
Sourcefn separation_distance(&self, other: &T) -> (GeoPosition, fsize)
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)
Sourcefn sq_separation_distance(&self, other: &T) -> (GeoPosition, fsize)
fn sq_separation_distance(&self, other: &T) -> (GeoPosition, fsize)
Squared version of SeparationDistance::separation_distance