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

    pub trait Scaling<E: EuclideanSpace>: AffineTransformation<E, NonUniformScaling = Self, Translation = Id, Rotation = Id> + SubsetOf<E::RealField> {
        fn to_real(&self) -> E::RealField { ... }
        fn from_real(r: E::RealField) -> Option<Self> { ... }
        fn powf(&self, n: E::RealField) -> Option<Self> { ... }
        fn scale_between(a: &E::Coordinates, b: &E::Coordinates) -> Option<Self> { ... }
    }

Subgroups of the (signed) uniform scaling group.

## Provided methods

### `fn to_real(&self) -> E::RealField`

Converts this scaling factor to a real. Same as `self.to_superset()`.

### `fn from_real(r: E::RealField) -> Option<Self>`

Attempts to convert a real to an element of this scaling subgroup. Same as `Self::from_superset()`. Returns `None` if no such scaling is possible for this subgroup.

### `fn powf(&self, n: E::RealField) -> Option<Self>`

Raises the scaling to a power. The result must be equivalent to `self.to_superset().powf(n)`. Returns `None` if the result is not representable by `Self`.

### `fn scale_between(a: &E::Coordinates, b: &E::Coordinates) -> Option<Self>`

The scaling required to make `a` have the same norm as `b`, i.e., `|b| = |a| * norm_ratio(a, b)`.

Loading content...

## Implementors

### `impl<E: EuclideanSpace> Scaling<E> for Id`[src]

### `impl<R, E> Scaling<E> for R where
R: RealField + SubsetOf<R>,
E: EuclideanSpace<RealField = R>,
E::Coordinates: ClosedMul<R> + ClosedDiv<R> + ClosedNeg,` [src]

#### `fn to_real(&self) -> E::RealField`[src]

#### `fn from_real(r: E::RealField) -> Option<Self>`[src]

#### `fn powf(&self, n: E::RealField) -> Option<Self>`[src]

#### `fn scale_between(a: &E::Coordinates, b: &E::Coordinates) -> Option<Self>`[src]

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