Struct geom::angle::Angle [−][src]
pub struct Angle(f64);
An angle, stored in radians.
Implementations
impl Angle
[src]
impl Angle
[src]pub const ZERO: Angle
[src]
pub fn new_rads(rads: f64) -> Angle
[src]
Create an angle in radians.
pub fn degrees(degs: f64) -> Angle
[src]
Create an angle in degrees.
pub fn opposite(self) -> Angle
[src]
Invert the direction of this angle.
pub(crate) fn invert_y(self) -> Angle
[src]
pub fn rotate_degs(self, degrees: f64) -> Angle
[src]
Rotates this angle by some degrees.
pub fn normalized_radians(self) -> f64
[src]
Returns [0, 2pi)
pub fn normalized_degrees(self) -> f64
[src]
Returns [0, 360)
pub fn simple_shortest_rotation_towards(self, other: Angle) -> f64
[src]
Returns [-180, 180]
pub fn shortest_rotation_towards(self, other: Angle) -> Angle
[src]
Logically this returns [-180, 180], but keep in mind when we print this angle, it’ll normalize to be [0, 360].
pub fn approx_eq(self, other: Angle, within_degrees: f64) -> bool
[src]
True if this angle is within some degrees of another, accounting for rotation
pub fn reorient(self) -> Angle
[src]
I don’t know how to describe what this does. Use for rotating labels in map-space and making sure the text is never upside-down.
pub fn average(input: Vec<Angle>) -> Angle
[src]
Calculates the average of some angles.
Trait Implementations
impl<'de> Deserialize<'de> for Angle
[src]
impl<'de> Deserialize<'de> for Angle
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialOrd<Angle> for Angle
[src]
impl PartialOrd<Angle> for Angle
[src]impl Copy for Angle
[src]
impl StructuralPartialEq for Angle
[src]
Auto Trait Implementations
impl RefUnwindSafe for Angle
impl Send for Angle
impl Sync for Angle
impl Unpin for Angle
impl UnwindSafe for Angle
Blanket Implementations
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,