pub enum DistanceAlg {
    Pythagoras,
    PythagorasSquared,
    Manhattan,
    Chebyshev,
    Diagonal,
}
Expand description

Enumeration of available 2D Distance algorithms

Variants

Pythagoras

Use the Pythagoras algorithm for determining distance - sqrt(A^2 + B^2)

PythagorasSquared

Us the Pythagoras algorithm for distance, but omitting the square-root for a faster but squared result.

Manhattan

Use Manhattan distance (distance up plus distance along)

Chebyshev

Use Chebyshev distance (like Manhattan, but adds one to each entry)

Diagonal

Use a diagonal distance, the max of the x and y distances

Implementations

Provides a 2D distance between points, using the specified algorithm.

Provides a 3D distance between points, using the specified algorithm.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.