#[repr(C)]pub struct Angle<F>(/* private fields */);
Expand description
A type for representing an angle, without needing to remember if it is denominated in Radians, Degrees, or otherwise.
Implementations§
Source§impl<F: FullFloat> Angle<F>
impl<F: FullFloat> Angle<F>
Sourcepub fn new_radians(radians: F) -> Angle<F>
pub fn new_radians(radians: F) -> Angle<F>
Create an angle from radians
Sourcepub fn from_radians(radians: F) -> Angle<F>
pub fn from_radians(radians: F) -> Angle<F>
Create an angle from radians
Sourcepub fn as_radians(&self) -> F
pub fn as_radians(&self) -> F
Get the value of the angle as radians
Sourcepub fn new_degrees(degrees: F) -> Angle<F>
pub fn new_degrees(degrees: F) -> Angle<F>
Create an angle from degrees
Sourcepub fn from_degrees(degrees: F) -> Angle<F>
pub fn from_degrees(degrees: F) -> Angle<F>
Create an angle from degrees
Sourcepub fn as_degrees(&self) -> F
pub fn as_degrees(&self) -> F
Get the value of the angle as degrees
Sourcepub fn new_cycles(cycles: F) -> Angle<F>
pub fn new_cycles(cycles: F) -> Angle<F>
Create an angle from cycles (1 cycle is a full circle)
Sourcepub fn from_cycles(cycles: F) -> Angle<F>
pub fn from_cycles(cycles: F) -> Angle<F>
Create an angle from cycles (1 cycle is a full circle)
Trait Implementations§
Source§impl<F: FullFloat> ApproxEq for Angle<F>
impl<F: FullFloat> ApproxEq for Angle<F>
type Flt = F
Source§fn approx_eq(
&self,
other: &Self,
epsilon: <F as ApproxEq>::Flt,
ulps: <<F as ApproxEq>::Flt as Ulps>::U,
) -> bool
fn approx_eq( &self, other: &Self, epsilon: <F as ApproxEq>::Flt, ulps: <<F as ApproxEq>::Flt as Ulps>::U, ) -> bool
This method tests for
self
and other
values to be approximately equal
using two methods: epsilon and ulps. If the values differ by less than the
given epsilon, they will be considered equal. If the values differ by more
than epsilon, but by less than the given ulps, they will also be considered
equal. Otherwise they are unequal. Read moreSource§fn approx_ne(
&self,
other: &Self,
epsilon: Self::Flt,
ulps: <Self::Flt as Ulps>::U,
) -> bool
fn approx_ne( &self, other: &Self, epsilon: Self::Flt, ulps: <Self::Flt as Ulps>::U, ) -> bool
This method tests for
self
and other
values to be not approximately equal
using two methods: epsilon and ulps. If the values differ by less than the
given epsilon, they will be considered equal. If the values differ by more
than epsilon, but by less than the given ulps, they will also be considered
equal. Otherwise they are unequal. Read moreSource§impl<'de, F> Deserialize<'de> for Angle<F>where
F: Deserialize<'de>,
impl<'de, F> Deserialize<'de> for Angle<F>where
F: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<F: Ord> Ord for Angle<F>
impl<F: Ord> Ord for Angle<F>
Source§impl<F: PartialOrd> PartialOrd for Angle<F>
impl<F: PartialOrd> PartialOrd for Angle<F>
impl<F: Copy> Copy for Angle<F>
impl<F: Eq> Eq for Angle<F>
impl<F> StructuralPartialEq for Angle<F>
Auto Trait Implementations§
impl<F> Freeze for Angle<F>where
F: Freeze,
impl<F> RefUnwindSafe for Angle<F>where
F: RefUnwindSafe,
impl<F> Send for Angle<F>where
F: Send,
impl<F> Sync for Angle<F>where
F: Sync,
impl<F> Unpin for Angle<F>where
F: Unpin,
impl<F> UnwindSafe for Angle<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more