Struct firefly_rust::graphics::Angle
source · pub struct Angle(/* private fields */);
Expand description
An angle between two vectors.
Used by draw_arc
and draw_sector
.
Implementations§
source§impl Angle
impl Angle
sourcepub const FULL_CIRCLE: Angle = _
pub const FULL_CIRCLE: Angle = _
The 360° angle.
sourcepub const HALF_CIRCLE: Angle = _
pub const HALF_CIRCLE: Angle = _
The 180° angle.
sourcepub const QUARTER_CIRCLE: Angle = _
pub const QUARTER_CIRCLE: Angle = _
The 90° angle.
sourcepub fn from_degrees(d: f32) -> Self
pub fn from_degrees(d: f32) -> Self
An angle in degrees where 360.0 is the full circle.
sourcepub fn from_radians(r: f32) -> Self
pub fn from_radians(r: f32) -> Self
sourcepub fn normalize(self) -> Self
pub fn normalize(self) -> Self
Normalize the angle to less than one full rotation (in the range 0°..360°).
sourcepub fn to_degrees(self) -> f32
pub fn to_degrees(self) -> f32
Get the angle value in degrees where 360.0 is the full circle..
sourcepub fn to_radians(self) -> f32
pub fn to_radians(self) -> f32
Trait Implementations§
source§impl AddAssign for Angle
impl AddAssign for Angle
source§fn add_assign(&mut self, other: Angle)
fn add_assign(&mut self, other: Angle)
Performs the
+=
operation. Read moresource§impl PartialEq for Angle
impl PartialEq for Angle
source§impl PartialOrd for Angle
impl PartialOrd for Angle
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl SubAssign for Angle
impl SubAssign for Angle
source§fn sub_assign(&mut self, other: Angle)
fn sub_assign(&mut self, other: Angle)
Performs the
-=
operation. Read moreimpl Copy for Angle
impl StructuralPartialEq for Angle
Auto Trait Implementations§
impl Freeze for Angle
impl RefUnwindSafe for Angle
impl Send for Angle
impl Sync for Angle
impl Unpin for Angle
impl UnwindSafe for Angle
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.