[][src]Struct gramit::angle::Angle

#[repr(transparent)]
pub struct Angle { /* fields omitted */ }

An angle struct independent of representation as either degrees or radians.

Methods

impl Angle[src]

pub fn zero() -> Angle[src]

Construct an Angle of zero.

pub fn full_circle() -> Angle[src]

Construct an Angle of 360 degrees (2*PI radians).

pub fn half_circle() -> Angle[src]

Construct an Angle of 180 degrees (PI radians).

pub fn from_radians(radians: f32) -> Angle[src]

Construct an Angle from a value given in radians.

pub fn from_degrees(degrees: f32) -> Angle[src]

Constuct an Angle from a value given in degrees.

pub fn radians(self) -> f32[src]

Get the value of this Angle in radians.

pub fn degrees(self) -> f32[src]

Get the value of this Angle in degrees.

pub fn sin(self) -> f32[src]

Get the sine of this Angle.

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

Get the cosine of this Angle.

pub fn tan(self) -> f32[src]

Get the tangent of this Angle.

pub fn asin(x: f32) -> Option<Angle>[src]

Compute the arc sine of the given value.

For values in the range [-1, 1], produces an Angle in the range [-pi/2, pi/2] (radians). For other values, produces None.

pub fn acos(x: f32) -> Option<Angle>[src]

Compute the arc cosine of the given value.

For values in the range [-1, 1], produces an Angle in the range [0, pi] (radians). For other values, produces None.

pub fn atan(x: f32) -> Angle[src]

Compute the arc tangent of the given value.

pub fn atan2(y: f32, x: f32) -> Angle[src]

Compute the four-quadrant arc tangent of y and x.

pub fn sin_cos(self) -> (f32, f32)[src]

Simultaneously compute the sine and cosine of this Angle. Returns (sin(x), cos(x)).

Trait Implementations

impl ApproxEq<Angle> for Angle[src]

impl Clone for Angle[src]

impl Copy for Angle[src]

impl Default for Angle[src]

fn default() -> Angle[src]

Construct a zero Angle.

impl PartialEq<Angle> for Angle[src]

impl PartialOrd<Angle> for Angle[src]

impl Debug for Angle[src]

impl Div<f32> for Angle[src]

type Output = Angle

The resulting type after applying the / operator.

impl Sub<Angle> for Angle[src]

type Output = Angle

The resulting type after applying the - operator.

impl Add<Angle> for Angle[src]

type Output = Angle

The resulting type after applying the + operator.

impl Mul<f32> for Angle[src]

type Output = Angle

The resulting type after applying the * operator.

impl Mul<Angle> for f32[src]

type Output = Angle

The resulting type after applying the * operator.

impl AddAssign<Angle> for Angle[src]

impl SubAssign<Angle> for Angle[src]

impl MulAssign<f32> for Angle[src]

impl DivAssign<f32> for Angle[src]

impl StructuralPartialEq for Angle[src]

Auto Trait Implementations

impl Send for Angle

impl Sync for Angle

impl Unpin for Angle

impl UnwindSafe for Angle

impl RefUnwindSafe for Angle

Blanket Implementations

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 = !

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.

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

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

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