Trait embedded_graphics::geometry::AngleUnit[][src]

pub trait AngleUnit {
    fn deg(self) -> Angle;
fn rad(self) -> Angle; }
Expand description

AngleUnit trait.

AngleUnit is a trait to convert numbers into angle by appending .deg() or .rad() to the number as if it was a unit.

Examples

Create an Angle from a value using AngleUnit

use embedded_graphics::geometry::AngleUnit;
use core::f32::consts::PI;

// Create an angle using the `AngleUnit` methods
let angle_a = 30.0.deg();
let angle_b = PI.rad();

Required methods

Convert a number (interpreted as degrees) to an Angle.

Convert a number (interpreted as radians) to an Angle.

Implementations on Foreign Types

Implementors