[][src]Struct acap::cos::AngularDistance

pub struct AngularDistance<T>(_);

An angular distance.

This type stores the cosine of the angle, to avoid computing the expensive trancendental acos() function until absolutely necessary.

let zero = AngularDistance::from_cos(1.0);
let pi_2 = AngularDistance::from_cos(0.0);
let pi = AngularDistance::from_cos(-1.0);
assert!(zero < pi_2 && pi_2 < pi);

Implementations

impl<T: Real + Value> AngularDistance<T>[src]

pub fn from_cos(value: T) -> Self[src]

Creates an AngularDistance from the cosine of an angle.

pub fn cos(self) -> T[src]

Get the cosine of this angle.

Trait Implementations

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

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

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

impl Distance for AngularDistance<f32>[src]

type Value = f32

The type of actual numerical distances.

impl Distance for AngularDistance<f64>[src]

type Value = f64

The type of actual numerical distances.

impl From<AngularDistance<f32>> for f32[src]

impl From<AngularDistance<f64>> for f64[src]

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

impl PartialEq<AngularDistance<f32>> for f32[src]

impl PartialEq<AngularDistance<f64>> for f64[src]

impl PartialEq<f32> for AngularDistance<f32>[src]

impl PartialEq<f64> for AngularDistance<f64>[src]

impl<T: PartialOrd> PartialOrd<AngularDistance<T>> for AngularDistance<T>[src]

impl PartialOrd<AngularDistance<f32>> for f32[src]

impl PartialOrd<AngularDistance<f64>> for f64[src]

impl PartialOrd<f32> for AngularDistance<f32>[src]

impl PartialOrd<f64> for AngularDistance<f64>[src]

impl<T> StructuralPartialEq for AngularDistance<T>[src]

impl TryFrom<f32> for AngularDistance<f32>[src]

type Error = InvalidAngleError

The type returned in the event of a conversion error.

impl TryFrom<f64> for AngularDistance<f64>[src]

type Error = InvalidAngleError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<T> RefUnwindSafe for AngularDistance<T> where
    T: RefUnwindSafe

impl<T> Send for AngularDistance<T> where
    T: Send

impl<T> Sync for AngularDistance<T> where
    T: Sync

impl<T> Unpin for AngularDistance<T> where
    T: Unpin

impl<T> UnwindSafe for AngularDistance<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Distance for T where
    T: Value
[src]

type Value = T

The type of actual numerical distances.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.