Struct pos::units::Radians
[−]
[src]
pub struct Radians<T>(pub T);
Newtype wrapper around a radian value.
It's so easy to forget if you're using radians or degrees.
Methods
impl Radians<f64>
[src]
fn from_degrees(degrees: f64) -> Radians<f64>
Create a new radian value from a degree value.
Examples
use std::f64::consts::PI; use pos::units::Radians; let radians = Radians::from_degrees(180.0); assert_eq!(PI, radians.0);
fn to_degrees(self) -> f64
Converts this radians value to degrees.
Examples
use std::f64::consts::PI; use pos::units::Radians; let degrees = Radians(PI / 2.0).to_degrees(); assert_eq!(90.0, degrees);
Trait Implementations
impl<T: Clone> Clone for Radians<T>
[src]
fn clone(&self) -> Radians<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for Radians<T>
[src]
impl<T: Debug> Debug for Radians<T>
[src]
impl<T: Default> Default for Radians<T>
[src]
impl<T: PartialEq> PartialEq for Radians<T>
[src]
fn eq(&self, __arg_0: &Radians<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Radians<T>) -> bool
This method tests for !=
.
impl Add for Radians<f64>
[src]
type Output = Radians<f64>
The resulting type after applying the +
operator
fn add(self, other: Radians<f64>) -> Radians<f64>
The method for the +
operator