Struct sensehat::Angle[][src]

pub struct Angle { /* fields omitted */ }

The 'Angle' struct can be used to deal with angles in a common way.

Example

use measurements::Angle;

let whole_cake = Angle::from_degrees(360.0);
let pieces = 6.0;
let slice = whole_cake / pieces;
println!("Each slice will be {} degrees", slice.as_degrees());

Methods

impl Angle
[src]

Create a new Angle from a floating point value in degrees

Create a new Angle from a floating point value in radians

Convert this Angle to a floating point value in degrees

Convert this Angle to a floating point value in radians

Calculate the cosine of this angle

Calculate the sine of this angle

Calculate the sine and cosine of this angle

Calculate the tangent of this angle

Calculate the arcsine of a number

Calculate the arccosine of a number

Calculate the arctangent of a number

Trait Implementations

impl Add<Angle> for Angle
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl PartialOrd<Angle> for Angle
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Sub<Angle> for Angle
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Display for Angle
[src]

Formats the value using the given formatter. Read more

impl Clone for Angle
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Angle
[src]

Formats the value using the given formatter. Read more

impl Mul<f64> for Angle
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Angle> for f64
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Copy for Angle
[src]

impl Eq for Angle
[src]

impl PartialEq<Angle> for Angle
[src]

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

This method tests for !=.

impl Measurement for Angle
[src]

Get this quantity in the base units

Create a new quantity from the base units

Return the base unit for this type, as a string. For example "kilograms" Read more

Returns a string containing the most appropriate units for this quantity, and a floating point value representing this quantity in those units. Useful when, for example, a length might be in millimeters if it is very small, or kilometers when it is very large. Read more

Given a list of units and their scale relative to the base unit, select the most appropriate one. Read more

impl Div<Angle> for Angle
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Div<f64> for Angle
[src]

The resulting type after applying the / operator.

Performs the / operation.

Auto Trait Implementations

impl Send for Angle

impl Sync for Angle