[go: up one dir, main page]

Trait AffineSpace

Source
pub trait AffineSpace:
    Sized
    + Clone
    + PartialEq
    + Sub<Self, Output = Self::Translation>
    + ClosedAdd<Self::Translation> {
    type Translation: VectorSpace;

    // Provided methods
    fn translate_by(&self, t: &Self::Translation) -> Self { ... }
    fn subtract(&self, right: &Self) -> Self::Translation { ... }
}
Expand description

A set points associated with a vector space and a transitive and free additive group action (the translation).

Required Associated Types§

Source

type Translation: VectorSpace

The associated vector space.

Provided Methods§

Source

fn translate_by(&self, t: &Self::Translation) -> Self

Same as *self + *t. Applies the additive group action of this affine space’s associated vector space on self.

Source

fn subtract(&self, right: &Self) -> Self::Translation

Same as *self - *other. Returns the unique element v of the associated vector space such that self = right + v.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§