[][src]Trait alga::linear::EuclideanSpace

pub trait EuclideanSpace: AffineSpace<Translation = Self::Coordinates> + ClosedMul<Self::Real> + ClosedDiv<Self::Real> + Neg<Output = Self> {
    type Coordinates: FiniteDimInnerSpace<Real = Self::Real> + Add<Self::Coordinates, Output = Self::Coordinates> + AddAssign<Self::Coordinates> + Sub<Self::Coordinates, Output = Self::Coordinates> + SubAssign<Self::Coordinates> + Mul<Self::Real, Output = Self::Coordinates> + MulAssign<Self::Real> + Div<Self::Real, Output = Self::Coordinates> + DivAssign<Self::Real> + Neg<Output = Self::Coordinates>;
    type Real: Real;
    fn origin() -> Self;

    fn scale_by(&self, s: Self::Real) -> Self { ... }
fn coordinates(&self) -> Self::Coordinates { ... }
fn from_coordinates(coords: Self::Coordinates) -> Self { ... }
fn distance_squared(&self, b: &Self) -> Self::Real { ... }
fn distance(&self, b: &Self) -> Self::Real { ... } }

The finite-dimensional affine space based on the field of reals.

Associated Types

type Coordinates: FiniteDimInnerSpace<Real = Self::Real> + Add<Self::Coordinates, Output = Self::Coordinates> + AddAssign<Self::Coordinates> + Sub<Self::Coordinates, Output = Self::Coordinates> + SubAssign<Self::Coordinates> + Mul<Self::Real, Output = Self::Coordinates> + MulAssign<Self::Real> + Div<Self::Real, Output = Self::Coordinates> + DivAssign<Self::Real> + Neg<Output = Self::Coordinates>

The underlying finite vector space.

type Real: Real

The underlying reals.

Loading content...

Required methods

fn origin() -> Self

The preferred origin of this euclidean space.

Theoretically, an euclidean space has no clearly defined origin. Though it is almost always useful to have some reference point to express all the others as translations of it.

Loading content...

Provided methods

fn scale_by(&self, s: Self::Real) -> Self

Multiplies the distance of this point to Self::origin() by s.

Same as self * s.

fn coordinates(&self) -> Self::Coordinates

The coordinates of this point, i.e., the translation from the origin.

fn from_coordinates(coords: Self::Coordinates) -> Self

Builds a point from its coordinates relative to the origin.

fn distance_squared(&self, b: &Self) -> Self::Real

The distance between two points.

fn distance(&self, b: &Self) -> Self::Real

The distance between two points.

Loading content...

Implementors

Loading content...