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

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

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

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

## Associated Types

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

The underlying finite vector space.

### `type RealField: RealField`

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::RealField) -> 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::RealField`

The distance between two points.

### `fn distance(&self, b: &Self) -> Self::RealField`

The distance between two points.

Loading content...

## Implementors

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)