[−][src]Struct acap::cos::AngularDistance
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]
fn clone(&self) -> AngularDistance<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy> Copy for AngularDistance<T>
[src]
impl<T: Debug> Debug for AngularDistance<T>
[src]
impl Distance for AngularDistance<f32>
[src]
impl Distance for AngularDistance<f64>
[src]
impl From<AngularDistance<f32>> for f32
[src]
fn from(value: AngularDistance<f32>) -> f32
[src]
impl From<AngularDistance<f64>> for f64
[src]
fn from(value: AngularDistance<f64>) -> f64
[src]
impl<T: PartialEq> PartialEq<AngularDistance<T>> for AngularDistance<T>
[src]
fn eq(&self, other: &AngularDistance<T>) -> bool
[src]
fn ne(&self, other: &AngularDistance<T>) -> bool
[src]
impl PartialEq<AngularDistance<f32>> for f32
[src]
fn eq(&self, other: &AngularDistance<f32>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<AngularDistance<f64>> for f64
[src]
fn eq(&self, other: &AngularDistance<f64>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[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]
fn partial_cmp(&self, other: &AngularDistance<T>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<AngularDistance<f32>> for f32
[src]
fn partial_cmp(&self, other: &AngularDistance<f32>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<AngularDistance<f64>> for f64
[src]
fn partial_cmp(&self, other: &AngularDistance<f64>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<f32> for AngularDistance<f32>
[src]
fn partial_cmp(&self, other: &f32) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<f64> for AngularDistance<f64>
[src]
fn partial_cmp(&self, other: &f64) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[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.
fn try_from(value: f32) -> Result<Self, Self::Error>
[src]
impl TryFrom<f64> for AngularDistance<f64>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for AngularDistance<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for AngularDistance<T> where
T: Send,
T: Send,
impl<T> Sync for AngularDistance<T> where
T: Sync,
T: Sync,
impl<T> Unpin for AngularDistance<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for AngularDistance<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Distance for T where
T: Value,
[src]
T: Value,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,