pub trait AngleUnit {
    // Required methods
    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§

source

fn deg(self) -> Angle

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

source

fn rad(self) -> Angle

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

Implementations on Foreign Types§

source§

impl AngleUnit for f32

source§

fn deg(self) -> Angle

source§

fn rad(self) -> Angle

Implementors§