Enum angular::Angle [] [src]

pub enum Angle<T = f64> {
    Radians(T),
    Degrees(T),
}

An angle.

Might be a value in degrees or in radians.

Variants

Methods

impl<T: NumCast> Angle<T>
[src]

Yield the value encoded in radians.

Yield the value encoded in degrees.

An angle of 45°.

An angle of 90° (right angle).

An angle of 180° (straight).

An angle of 360° (perigon).

impl<T: Copy + Num + NumCast + PartialOrd> Angle<T>
[src]

Create a new angle by normalizing the value into the range of [0, 2π) rad.

impl<T: Float> Angle<T>
[src]

Computes the minimal unsigned distance between two normalized angles. Returns an angle in the range of [0, π] rad.

let distance = Degrees(345.0).min_dist(Degrees(15.0));
assert!((distance.in_degrees() - 30.0) < 1.0e-10);

impl<T: Signed> Angle<T>
[src]

Compute the absolute angle.

impl<T: Float + NumCast> Angle<T>
[src]

Compute the sine of the angle.

Compute the cosine of the angle.

Compute the tangent of the angle.

Simultaneously compute the sine and cosine of the number, x. Return (sin(x), cos(x)).

Trait Implementations

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

impl<T: Clone> Clone for Angle<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Formats the value using the given formatter.

impl<T: Zero + Copy + NumCast> Zero for Angle<T>
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl<T: PartialEq + Copy + NumCast> PartialEq for Angle<T>
[src]

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

This method tests for !=.

impl<T: Add + Copy + NumCast> Add for Angle<T>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<T: Sub + Copy + NumCast> Sub for Angle<T>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<T: Mul> Mul<T> for Angle<T>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<T: Div> Div<T> for Angle<T>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<T: Neg> Neg for Angle<T>
[src]

The resulting type after applying the - operator

The method for the unary - operator

impl<T: Display> Display for Angle<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Send> Send for Angle<T>
[src]