Struct nalgebra::Unit [] [src]

pub struct Unit<T> {
    // some fields omitted
}

A wrapper that ensures the undelying algebraic entity has a unit norm.

Use .as_ref() or .unwrap() to obtain the undelying value by-reference or by-move.

Methods

impl<T: Norm> Unit<T>
[src]

Normalize the given value and return it wrapped on a Unit structure.

Attempts to normalize the given value and return it wrapped on a Unit structure.

Returns None if the norm was smaller or equal to min_norm.

Normalize the given value and return it wrapped on a Unit structure and its norm.

Normalize the given value and return it wrapped on a Unit structure and its norm.

Returns None if the norm was smaller or equal to min_norm.

Normalizes this value again. This is useful when repeated computations might cause a drift in the norm because of float inaccuracies.

Returns the norm before re-normalization (should be close to 1.0).

impl<T> Unit<T>
[src]

Wraps the given value, assuming it is already normalized.

This function is not safe because v is not verified to be actually normalized.

Retrieves the underlying value.

Trait Implementations

impl<T: Copy> Copy for Unit<T>
[src]

impl<T: Debug> Debug for Unit<T>
[src]

Formats the value using the given formatter.

impl<T: Hash> Hash for Unit<T>
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl<T: Clone> Clone for Unit<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Decodable> Decodable for Unit<T>
[src]

impl<T: Encodable> Encodable for Unit<T>
[src]

impl<T: PartialEq> PartialEq for Unit<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: Eq> Eq for Unit<T>
[src]

impl<T> AsRef<T> for Unit<T>
[src]

Performs the conversion.