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]

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);

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

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

Formats the value using the given formatter.

impl<T: Default> Default for Radians<T>
[src]

Returns the "default value" for a type. Read more

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

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

This method tests for !=.

impl Add for Radians<f64>
[src]

The resulting type after applying the + operator

The method for the + operator

impl Sub for Radians<f64>
[src]

The resulting type after applying the - operator

The method for the - operator