[−][src]Struct geom::angle::Angle
An angle, stored in radians.
Implementations
impl Angle
[src]
pub const ZERO: Angle
[src]
pub(crate) fn new_rads(rads: f64) -> Angle
[src]
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 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.
Trait Implementations
impl Add<Angle> for Angle
[src]
type Output = Angle
The resulting type after applying the +
operator.
fn add(self, other: Angle) -> Angle
[src]
impl Clone for Angle
[src]
impl Copy for Angle
[src]
impl Debug 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 Display for Angle
[src]
impl Div<f64> for Angle
[src]
type Output = Angle
The resulting type after applying the /
operator.
fn div(self, scalar: f64) -> Angle
[src]
impl Neg for Angle
[src]
impl PartialEq<Angle> for Angle
[src]
impl PartialOrd<Angle> for Angle
[src]
fn partial_cmp(&self, other: &Angle) -> Option<Ordering>
[src]
fn lt(&self, other: &Angle) -> bool
[src]
fn le(&self, other: &Angle) -> bool
[src]
fn gt(&self, other: &Angle) -> bool
[src]
fn ge(&self, other: &Angle) -> bool
[src]
impl Serialize for Angle
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Angle
[src]
impl Sum<Angle> 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,