Trait rust_sc2::distance::Distance[][src]

pub trait Distance: Into<Point2> {
    fn distance_squared<P: Into<Point2>>(self, other: P) -> f32 { ... }
fn distance<P: Into<Point2>>(self, other: P) -> f32 { ... }
fn is_closer<P: Into<Point2>>(self, distance: f32, other: P) -> bool { ... }
fn is_further<P: Into<Point2>>(self, distance: f32, other: P) -> bool { ... } }
Expand description

Basic trait for comparing distance.

Provided methods

fn distance_squared<P: Into<Point2>>(self, other: P) -> f32[src]

Calculates squared euclidean distance from self to other.

fn distance<P: Into<Point2>>(self, other: P) -> f32[src]

Calculates euclidean distance from self to other.

fn is_closer<P: Into<Point2>>(self, distance: f32, other: P) -> bool[src]

Checks if distance between self and other is less than given distance.

fn is_further<P: Into<Point2>>(self, distance: f32, other: P) -> bool[src]

Checks if distance between self and other is greater than given distance.

Implementors

impl<T: Into<Point2>> Distance for T[src]