Trait acgmath::InnerSpace [] [src]

pub trait InnerSpace: VectorSpace where
    Self::Scalar: BaseFloat,
    Self: MetricSpace<Metric = Self::Scalar>,
    Self: ApproxEq<Epsilon = Self::Scalar>, 
{ fn dot(self, other: Self) -> Self::Scalar; fn is_perpendicular(self, other: Self) -> bool { ... } fn magnitude2(self) -> Self::Scalar { ... } fn magnitude(self) -> Self::Scalar { ... } fn angle(self, other: Self) -> Rad<Self::Scalar> { ... } fn normalize(self) -> Self { ... } fn normalize_to(self, magnitude: Self::Scalar) -> Self { ... } fn lerp(self, other: Self, amount: Self::Scalar) -> Self { ... } }

Vectors that also have a dot (or inner) product.

The dot product allows for the definition of other useful operations, like finding the magnitude of a vector or normalizing it.

Examples include vectors and quaternions.

Required Methods

Vector dot (or inner) product.

Provided Methods

Returns true if the vector is perpendicular (at right angles) to the other vector.

Returns the squared magnitude.

This does not perform an expensive square root operation like in InnerSpace::magnitude method, and so can be used to compare magnitudes more efficiently.

The distance from the tail to the tip of the vector.

Returns the angle between two vectors in radians.

Returns a vector with the same direction, but with a magnitude of 1.

Returns a vector with the same direction and a given magnitude.

Returns the result of linearly interpolating the magnitude of the vector towards the magnitude of other by the specified amount.

Implementors