Trait embedded_graphics::geometry::AngleUnit
source · 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();