#[repr(transparent)]pub struct Angle<T>(pub T);
geom
only.Expand description
A generic angle.
It’s unit-agnostic over radians or degrees, and respects directionality.
When T
is an integer primitive the angle is considered to be always
normalized. By virtue of the range from [0..T::MAX]
representing a full
positive (counterclockwise) turn. And in the case of signed primitives,
the range from [0..T::MIN]
represents a full negative (clockwise) turn.
For floating-point primitives the range from -1 to 1 (non-inclusive) represents the normalized full turn, and anything beyond that are non-normalied angles.
§Features
It will be implemented for primitive floating point types when either the
std
or _float_f[32|64]
features are enabled.
And it will implemented for primitive integer types when its corresponding
feature capability is enabled (e.g. _int_i32
).
§Methods
Methods are implemented the same for each main angle representation, using:
- Floating-point: E.g.: methods for
f32
. - Signed integers. E.g: methods for
i32
. - Unsigned integers. E.g.: methods for
u32
.
§Methods for f32
Tuple Fields§
§0: T
Implementations§
Source§impl Angle<i8>
§Methods for angles represented using i8
.
impl Angle<i8>
§Methods for angles represented using i8
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_i8
only.
pub const fn new_full() -> Self
_int_i8
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_i8
only.
pub const fn new_right() -> Self
_int_i8
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_i8
only.
pub const fn new_straight() -> Self
_int_i8
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: f32) -> Self
Available on crate feature _int_i8
and (crate features std
or _float_f32
) only.
pub fn from_rad(radians: f32) -> Self
_int_i8
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: f32) -> Self
Available on crate feature _int_i8
and (crate features std
or _float_f32
) only.
pub fn from_deg(degrees: f32) -> Self
_int_i8
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: f32, custom_unit: f32) -> Self
Available on crate feature _int_i8
and (crate features std
or _float_f32
) only.
pub fn from_custom(value: f32, custom_unit: f32) -> Self
_int_i8
and (crate features std
or _float_f32
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f32 ⓘ
Available on crate feature _int_i8
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> f32 ⓘ
_int_i8
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f32 ⓘ
Available on crate feature _int_i8
only.
pub const fn to_deg(self) -> f32 ⓘ
_int_i8
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
Available on crate feature _int_i8
only.
pub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
_int_i8
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_i8
only.
pub const fn is_normalized(self) -> bool
_int_i8
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_i8
only.
pub const fn normalize(self) -> Self
_int_i8
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_i8
only.
pub fn set_normalized(&mut self)
_int_i8
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_i8
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_i8
only.Returns true
if the angle has the given direction
.
Source§impl Angle<i8>
§Methods for angles represented using i8
, signed.
impl Angle<i8>
§Methods for angles represented using i8
, signed.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_i8
only.
pub const fn direction(self) -> AngleDirection
_int_i8
only.Returns the angle direction.
The direction will be Undefined
if the angle kind is Full
.
Sourcepub const fn with_direction(self, direction: AngleDirection) -> Self
Available on crate feature _int_i8
only.
pub const fn with_direction(self, direction: AngleDirection) -> Self
_int_i8
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub fn set_direction(&mut self, direction: AngleDirection)
Available on crate feature _int_i8
only.
pub fn set_direction(&mut self, direction: AngleDirection)
_int_i8
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_i8
only.
pub const fn invert_direction(self) -> Self
_int_i8
only.Returns a version of the angle with inverted direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_i8
only.
pub const fn negative(self) -> Self
_int_i8
only.Returns the negative version of the angle.
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_i8
only.
pub fn set_negative(&mut self)
_int_i8
only.Sets the angle as negative.
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_i8
only.
pub const fn positive(self) -> Self
_int_i8
only.Returns the positive version of the angle.
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_i8
only.
pub fn set_positive(&mut self)
_int_i8
only.Sets the angle as positive.
Source§impl Angle<i16>
§Methods for angles represented using i16
.
impl Angle<i16>
§Methods for angles represented using i16
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_i16
only.
pub const fn new_full() -> Self
_int_i16
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_i16
only.
pub const fn new_right() -> Self
_int_i16
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_i16
only.
pub const fn new_straight() -> Self
_int_i16
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: f32) -> Self
Available on crate feature _int_i16
and (crate features std
or _float_f32
) only.
pub fn from_rad(radians: f32) -> Self
_int_i16
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: f32) -> Self
Available on crate feature _int_i16
and (crate features std
or _float_f32
) only.
pub fn from_deg(degrees: f32) -> Self
_int_i16
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: f32, custom_unit: f32) -> Self
Available on crate feature _int_i16
and (crate features std
or _float_f32
) only.
pub fn from_custom(value: f32, custom_unit: f32) -> Self
_int_i16
and (crate features std
or _float_f32
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f32 ⓘ
Available on crate feature _int_i16
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> f32 ⓘ
_int_i16
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f32 ⓘ
Available on crate feature _int_i16
only.
pub const fn to_deg(self) -> f32 ⓘ
_int_i16
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
Available on crate feature _int_i16
only.
pub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
_int_i16
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_i16
only.
pub const fn is_normalized(self) -> bool
_int_i16
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_i16
only.
pub const fn normalize(self) -> Self
_int_i16
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_i16
only.
pub fn set_normalized(&mut self)
_int_i16
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_i16
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_i16
only.Returns true
if the angle has the given direction
.
Source§impl Angle<i16>
§Methods for angles represented using i16
, signed.
impl Angle<i16>
§Methods for angles represented using i16
, signed.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_i16
only.
pub const fn direction(self) -> AngleDirection
_int_i16
only.Returns the angle direction.
The direction will be Undefined
if the angle kind is Full
.
Sourcepub const fn with_direction(self, direction: AngleDirection) -> Self
Available on crate feature _int_i16
only.
pub const fn with_direction(self, direction: AngleDirection) -> Self
_int_i16
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub fn set_direction(&mut self, direction: AngleDirection)
Available on crate feature _int_i16
only.
pub fn set_direction(&mut self, direction: AngleDirection)
_int_i16
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_i16
only.
pub const fn invert_direction(self) -> Self
_int_i16
only.Returns a version of the angle with inverted direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_i16
only.
pub const fn negative(self) -> Self
_int_i16
only.Returns the negative version of the angle.
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_i16
only.
pub fn set_negative(&mut self)
_int_i16
only.Sets the angle as negative.
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_i16
only.
pub const fn positive(self) -> Self
_int_i16
only.Returns the positive version of the angle.
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_i16
only.
pub fn set_positive(&mut self)
_int_i16
only.Sets the angle as positive.
Source§impl Angle<i32>
§Methods for angles represented using i32
.
impl Angle<i32>
§Methods for angles represented using i32
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_i32
only.
pub const fn new_full() -> Self
_int_i32
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_i32
only.
pub const fn new_right() -> Self
_int_i32
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_i32
only.
pub const fn new_straight() -> Self
_int_i32
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: f32) -> Self
Available on crate feature _int_i32
and (crate features std
or _float_f32
) only.
pub fn from_rad(radians: f32) -> Self
_int_i32
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: f32) -> Self
Available on crate feature _int_i32
and (crate features std
or _float_f32
) only.
pub fn from_deg(degrees: f32) -> Self
_int_i32
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: f32, custom_unit: f32) -> Self
Available on crate feature _int_i32
and (crate features std
or _float_f32
) only.
pub fn from_custom(value: f32, custom_unit: f32) -> Self
_int_i32
and (crate features std
or _float_f32
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f32 ⓘ
Available on crate feature _int_i32
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> f32 ⓘ
_int_i32
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f32 ⓘ
Available on crate feature _int_i32
only.
pub const fn to_deg(self) -> f32 ⓘ
_int_i32
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
Available on crate feature _int_i32
only.
pub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
_int_i32
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_i32
only.
pub const fn is_normalized(self) -> bool
_int_i32
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_i32
only.
pub const fn normalize(self) -> Self
_int_i32
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_i32
only.
pub fn set_normalized(&mut self)
_int_i32
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_i32
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_i32
only.Returns true
if the angle has the given direction
.
Source§impl Angle<i32>
§Methods for angles represented using i32
, signed.
impl Angle<i32>
§Methods for angles represented using i32
, signed.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_i32
only.
pub const fn direction(self) -> AngleDirection
_int_i32
only.Returns the angle direction.
The direction will be Undefined
if the angle kind is Full
.
Sourcepub const fn with_direction(self, direction: AngleDirection) -> Self
Available on crate feature _int_i32
only.
pub const fn with_direction(self, direction: AngleDirection) -> Self
_int_i32
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub fn set_direction(&mut self, direction: AngleDirection)
Available on crate feature _int_i32
only.
pub fn set_direction(&mut self, direction: AngleDirection)
_int_i32
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_i32
only.
pub const fn invert_direction(self) -> Self
_int_i32
only.Returns a version of the angle with inverted direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_i32
only.
pub const fn negative(self) -> Self
_int_i32
only.Returns the negative version of the angle.
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_i32
only.
pub fn set_negative(&mut self)
_int_i32
only.Sets the angle as negative.
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_i32
only.
pub const fn positive(self) -> Self
_int_i32
only.Returns the positive version of the angle.
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_i32
only.
pub fn set_positive(&mut self)
_int_i32
only.Sets the angle as positive.
Source§impl Angle<i64>
§Methods for angles represented using i64
.
impl Angle<i64>
§Methods for angles represented using i64
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_i64
only.
pub const fn new_full() -> Self
_int_i64
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_i64
only.
pub const fn new_right() -> Self
_int_i64
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_i64
only.
pub const fn new_straight() -> Self
_int_i64
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: f64) -> Self
Available on crate feature _int_i64
and (crate features std
or _float_f64
) only.
pub fn from_rad(radians: f64) -> Self
_int_i64
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: f64) -> Self
Available on crate feature _int_i64
and (crate features std
or _float_f64
) only.
pub fn from_deg(degrees: f64) -> Self
_int_i64
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: f64, custom_unit: f64) -> Self
Available on crate feature _int_i64
and (crate features std
or _float_f64
) only.
pub fn from_custom(value: f64, custom_unit: f64) -> Self
_int_i64
and (crate features std
or _float_f64
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f64 ⓘ
Available on crate feature _int_i64
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> f64 ⓘ
_int_i64
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f64 ⓘ
Available on crate feature _int_i64
only.
pub const fn to_deg(self) -> f64 ⓘ
_int_i64
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f64) -> f64 ⓘ
Available on crate feature _int_i64
only.
pub const fn to_custom(self, custom_unit: f64) -> f64 ⓘ
_int_i64
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_i64
only.
pub const fn is_normalized(self) -> bool
_int_i64
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_i64
only.
pub const fn normalize(self) -> Self
_int_i64
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_i64
only.
pub fn set_normalized(&mut self)
_int_i64
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_i64
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_i64
only.Returns true
if the angle has the given direction
.
Source§impl Angle<i64>
§Methods for angles represented using i64
, signed.
impl Angle<i64>
§Methods for angles represented using i64
, signed.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_i64
only.
pub const fn direction(self) -> AngleDirection
_int_i64
only.Returns the angle direction.
The direction will be Undefined
if the angle kind is Full
.
Sourcepub const fn with_direction(self, direction: AngleDirection) -> Self
Available on crate feature _int_i64
only.
pub const fn with_direction(self, direction: AngleDirection) -> Self
_int_i64
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub fn set_direction(&mut self, direction: AngleDirection)
Available on crate feature _int_i64
only.
pub fn set_direction(&mut self, direction: AngleDirection)
_int_i64
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_i64
only.
pub const fn invert_direction(self) -> Self
_int_i64
only.Returns a version of the angle with inverted direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_i64
only.
pub const fn negative(self) -> Self
_int_i64
only.Returns the negative version of the angle.
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_i64
only.
pub fn set_negative(&mut self)
_int_i64
only.Sets the angle as negative.
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_i64
only.
pub const fn positive(self) -> Self
_int_i64
only.Returns the positive version of the angle.
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_i64
only.
pub fn set_positive(&mut self)
_int_i64
only.Sets the angle as positive.
Source§impl Angle<i128>
§Methods for angles represented using i128
.
impl Angle<i128>
§Methods for angles represented using i128
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_i128
only.
pub const fn new_full() -> Self
_int_i128
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_i128
only.
pub const fn new_right() -> Self
_int_i128
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_i128
only.
pub const fn new_straight() -> Self
_int_i128
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: f64) -> Self
Available on crate feature _int_i128
and (crate features std
or _float_f64
) only.
pub fn from_rad(radians: f64) -> Self
_int_i128
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: f64) -> Self
Available on crate feature _int_i128
and (crate features std
or _float_f64
) only.
pub fn from_deg(degrees: f64) -> Self
_int_i128
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: f64, custom_unit: f64) -> Self
Available on crate feature _int_i128
and (crate features std
or _float_f64
) only.
pub fn from_custom(value: f64, custom_unit: f64) -> Self
_int_i128
and (crate features std
or _float_f64
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f64 ⓘ
Available on crate feature _int_i128
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> f64 ⓘ
_int_i128
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f64 ⓘ
Available on crate feature _int_i128
only.
pub const fn to_deg(self) -> f64 ⓘ
_int_i128
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f64) -> f64 ⓘ
Available on crate feature _int_i128
only.
pub const fn to_custom(self, custom_unit: f64) -> f64 ⓘ
_int_i128
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_i128
only.
pub const fn is_normalized(self) -> bool
_int_i128
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_i128
only.
pub const fn normalize(self) -> Self
_int_i128
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_i128
only.
pub fn set_normalized(&mut self)
_int_i128
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_i128
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_i128
only.Returns true
if the angle has the given direction
.
Source§impl Angle<i128>
§Methods for angles represented using i128
, signed.
impl Angle<i128>
§Methods for angles represented using i128
, signed.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_i128
only.
pub const fn direction(self) -> AngleDirection
_int_i128
only.Returns the angle direction.
The direction will be Undefined
if the angle kind is Full
.
Sourcepub const fn with_direction(self, direction: AngleDirection) -> Self
Available on crate feature _int_i128
only.
pub const fn with_direction(self, direction: AngleDirection) -> Self
_int_i128
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub fn set_direction(&mut self, direction: AngleDirection)
Available on crate feature _int_i128
only.
pub fn set_direction(&mut self, direction: AngleDirection)
_int_i128
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_i128
only.
pub const fn invert_direction(self) -> Self
_int_i128
only.Returns a version of the angle with inverted direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_i128
only.
pub const fn negative(self) -> Self
_int_i128
only.Returns the negative version of the angle.
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_i128
only.
pub fn set_negative(&mut self)
_int_i128
only.Sets the angle as negative.
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_i128
only.
pub const fn positive(self) -> Self
_int_i128
only.Returns the positive version of the angle.
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_i128
only.
pub fn set_positive(&mut self)
_int_i128
only.Sets the angle as positive.
Source§impl Angle<isize>
§Methods for angles represented using isize
.
impl Angle<isize>
§Methods for angles represented using isize
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_isize
only.
pub const fn new_full() -> Self
_int_isize
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_isize
only.
pub const fn new_right() -> Self
_int_isize
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_isize
only.
pub const fn new_straight() -> Self
_int_isize
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: fsize) -> Self
Available on crate feature _int_isize
and (crate features std
or _float_f64
) only.
pub fn from_rad(radians: fsize) -> Self
_int_isize
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: fsize) -> Self
Available on crate feature _int_isize
and (crate features std
or _float_f64
) only.
pub fn from_deg(degrees: fsize) -> Self
_int_isize
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: fsize, custom_unit: fsize) -> Self
Available on crate feature _int_isize
and (crate features std
or _float_f64
) only.
pub fn from_custom(value: fsize, custom_unit: fsize) -> Self
_int_isize
and (crate features std
or _float_f64
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> fsize
Available on crate feature _int_isize
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> fsize
_int_isize
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> fsize
Available on crate feature _int_isize
only.
pub const fn to_deg(self) -> fsize
_int_isize
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: fsize) -> fsize
Available on crate feature _int_isize
only.
pub const fn to_custom(self, custom_unit: fsize) -> fsize
_int_isize
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_isize
only.
pub const fn is_normalized(self) -> bool
_int_isize
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_isize
only.
pub const fn normalize(self) -> Self
_int_isize
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_isize
only.
pub fn set_normalized(&mut self)
_int_isize
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_isize
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_isize
only.Returns true
if the angle has the given direction
.
Source§impl Angle<isize>
§Methods for angles represented using isize
, signed.
impl Angle<isize>
§Methods for angles represented using isize
, signed.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_isize
only.
pub const fn direction(self) -> AngleDirection
_int_isize
only.Returns the angle direction.
The direction will be Undefined
if the angle kind is Full
.
Sourcepub const fn with_direction(self, direction: AngleDirection) -> Self
Available on crate feature _int_isize
only.
pub const fn with_direction(self, direction: AngleDirection) -> Self
_int_isize
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub fn set_direction(&mut self, direction: AngleDirection)
Available on crate feature _int_isize
only.
pub fn set_direction(&mut self, direction: AngleDirection)
_int_isize
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_isize
only.
pub const fn invert_direction(self) -> Self
_int_isize
only.Returns a version of the angle with inverted direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_isize
only.
pub const fn negative(self) -> Self
_int_isize
only.Returns the negative version of the angle.
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_isize
only.
pub fn set_negative(&mut self)
_int_isize
only.Sets the angle as negative.
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_isize
only.
pub const fn positive(self) -> Self
_int_isize
only.Returns the positive version of the angle.
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_isize
only.
pub fn set_positive(&mut self)
_int_isize
only.Sets the angle as positive.
Source§impl Angle<u8>
§Methods for angles represented using u8
.
impl Angle<u8>
§Methods for angles represented using u8
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_u8
only.
pub const fn new_full() -> Self
_int_u8
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_u8
only.
pub const fn new_right() -> Self
_int_u8
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_u8
only.
pub const fn new_straight() -> Self
_int_u8
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: f32) -> Self
Available on crate feature _int_u8
and (crate features std
or _float_f32
) only.
pub fn from_rad(radians: f32) -> Self
_int_u8
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: f32) -> Self
Available on crate feature _int_u8
and (crate features std
or _float_f32
) only.
pub fn from_deg(degrees: f32) -> Self
_int_u8
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: f32, custom_unit: f32) -> Self
Available on crate feature _int_u8
and (crate features std
or _float_f32
) only.
pub fn from_custom(value: f32, custom_unit: f32) -> Self
_int_u8
and (crate features std
or _float_f32
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f32 ⓘ
Available on crate feature _int_u8
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> f32 ⓘ
_int_u8
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f32 ⓘ
Available on crate feature _int_u8
only.
pub const fn to_deg(self) -> f32 ⓘ
_int_u8
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
Available on crate feature _int_u8
only.
pub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
_int_u8
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_u8
only.
pub const fn is_normalized(self) -> bool
_int_u8
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_u8
only.
pub const fn normalize(self) -> Self
_int_u8
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_u8
only.
pub fn set_normalized(&mut self)
_int_u8
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_u8
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_u8
only.Returns true
if the angle has the given direction
.
Source§impl Angle<u8>
§Methods for angles represented using u8
, unsigned.
impl Angle<u8>
§Methods for angles represented using u8
, unsigned.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_u8
only.
pub const fn direction(self) -> AngleDirection
_int_u8
only.Returns the angle direction.
For unsigned integers the direction is always CounterClockwise
.
Sourcepub const fn with_direction(self, _direction: AngleDirection) -> Self
Available on crate feature _int_u8
only.
pub const fn with_direction(self, _direction: AngleDirection) -> Self
_int_u8
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn set_direction(self, _direction: AngleDirection)
Available on crate feature _int_u8
only.
pub const fn set_direction(self, _direction: AngleDirection)
_int_u8
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_u8
only.
pub const fn invert_direction(self) -> Self
_int_u8
only.Returns a version of the angle with inverted direction (no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_u8
only.
pub const fn negative(self) -> Self
_int_u8
only.Returns the negative version of the angle (no-op for unsigned).
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_u8
only.
pub fn set_negative(&mut self)
_int_u8
only.Sets the angle as negative (no-op for unsigned).
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_u8
only.
pub const fn positive(self) -> Self
_int_u8
only.Returns the positive version of the angle (no-op for unsigned).
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_u8
only.
pub fn set_positive(&mut self)
_int_u8
only.Sets the angle as positive (no-op for unsigned).
Source§impl Angle<u16>
§Methods for angles represented using u16
.
impl Angle<u16>
§Methods for angles represented using u16
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_u16
only.
pub const fn new_full() -> Self
_int_u16
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_u16
only.
pub const fn new_right() -> Self
_int_u16
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_u16
only.
pub const fn new_straight() -> Self
_int_u16
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: f32) -> Self
Available on crate feature _int_u16
and (crate features std
or _float_f32
) only.
pub fn from_rad(radians: f32) -> Self
_int_u16
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: f32) -> Self
Available on crate feature _int_u16
and (crate features std
or _float_f32
) only.
pub fn from_deg(degrees: f32) -> Self
_int_u16
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: f32, custom_unit: f32) -> Self
Available on crate feature _int_u16
and (crate features std
or _float_f32
) only.
pub fn from_custom(value: f32, custom_unit: f32) -> Self
_int_u16
and (crate features std
or _float_f32
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f32 ⓘ
Available on crate feature _int_u16
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> f32 ⓘ
_int_u16
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f32 ⓘ
Available on crate feature _int_u16
only.
pub const fn to_deg(self) -> f32 ⓘ
_int_u16
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
Available on crate feature _int_u16
only.
pub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
_int_u16
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_u16
only.
pub const fn is_normalized(self) -> bool
_int_u16
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_u16
only.
pub const fn normalize(self) -> Self
_int_u16
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_u16
only.
pub fn set_normalized(&mut self)
_int_u16
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_u16
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_u16
only.Returns true
if the angle has the given direction
.
Source§impl Angle<u16>
§Methods for angles represented using u16
, unsigned.
impl Angle<u16>
§Methods for angles represented using u16
, unsigned.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_u16
only.
pub const fn direction(self) -> AngleDirection
_int_u16
only.Returns the angle direction.
For unsigned integers the direction is always CounterClockwise
.
Sourcepub const fn with_direction(self, _direction: AngleDirection) -> Self
Available on crate feature _int_u16
only.
pub const fn with_direction(self, _direction: AngleDirection) -> Self
_int_u16
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn set_direction(self, _direction: AngleDirection)
Available on crate feature _int_u16
only.
pub const fn set_direction(self, _direction: AngleDirection)
_int_u16
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_u16
only.
pub const fn invert_direction(self) -> Self
_int_u16
only.Returns a version of the angle with inverted direction (no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_u16
only.
pub const fn negative(self) -> Self
_int_u16
only.Returns the negative version of the angle (no-op for unsigned).
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_u16
only.
pub fn set_negative(&mut self)
_int_u16
only.Sets the angle as negative (no-op for unsigned).
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_u16
only.
pub const fn positive(self) -> Self
_int_u16
only.Returns the positive version of the angle (no-op for unsigned).
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_u16
only.
pub fn set_positive(&mut self)
_int_u16
only.Sets the angle as positive (no-op for unsigned).
Source§impl Angle<u32>
§Methods for angles represented using u32
.
impl Angle<u32>
§Methods for angles represented using u32
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_u32
only.
pub const fn new_full() -> Self
_int_u32
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_u32
only.
pub const fn new_right() -> Self
_int_u32
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_u32
only.
pub const fn new_straight() -> Self
_int_u32
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: f32) -> Self
Available on crate feature _int_u32
and (crate features std
or _float_f32
) only.
pub fn from_rad(radians: f32) -> Self
_int_u32
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: f32) -> Self
Available on crate feature _int_u32
and (crate features std
or _float_f32
) only.
pub fn from_deg(degrees: f32) -> Self
_int_u32
and (crate features std
or _float_f32
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: f32, custom_unit: f32) -> Self
Available on crate feature _int_u32
and (crate features std
or _float_f32
) only.
pub fn from_custom(value: f32, custom_unit: f32) -> Self
_int_u32
and (crate features std
or _float_f32
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f32 ⓘ
Available on crate feature _int_u32
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> f32 ⓘ
_int_u32
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f32 ⓘ
Available on crate feature _int_u32
only.
pub const fn to_deg(self) -> f32 ⓘ
_int_u32
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
Available on crate feature _int_u32
only.
pub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
_int_u32
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_u32
only.
pub const fn is_normalized(self) -> bool
_int_u32
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_u32
only.
pub const fn normalize(self) -> Self
_int_u32
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_u32
only.
pub fn set_normalized(&mut self)
_int_u32
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_u32
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_u32
only.Returns true
if the angle has the given direction
.
Source§impl Angle<u32>
§Methods for angles represented using u32
, unsigned.
impl Angle<u32>
§Methods for angles represented using u32
, unsigned.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_u32
only.
pub const fn direction(self) -> AngleDirection
_int_u32
only.Returns the angle direction.
For unsigned integers the direction is always CounterClockwise
.
Sourcepub const fn with_direction(self, _direction: AngleDirection) -> Self
Available on crate feature _int_u32
only.
pub const fn with_direction(self, _direction: AngleDirection) -> Self
_int_u32
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn set_direction(self, _direction: AngleDirection)
Available on crate feature _int_u32
only.
pub const fn set_direction(self, _direction: AngleDirection)
_int_u32
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_u32
only.
pub const fn invert_direction(self) -> Self
_int_u32
only.Returns a version of the angle with inverted direction (no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_u32
only.
pub const fn negative(self) -> Self
_int_u32
only.Returns the negative version of the angle (no-op for unsigned).
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_u32
only.
pub fn set_negative(&mut self)
_int_u32
only.Sets the angle as negative (no-op for unsigned).
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_u32
only.
pub const fn positive(self) -> Self
_int_u32
only.Returns the positive version of the angle (no-op for unsigned).
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_u32
only.
pub fn set_positive(&mut self)
_int_u32
only.Sets the angle as positive (no-op for unsigned).
Source§impl Angle<u64>
§Methods for angles represented using u64
.
impl Angle<u64>
§Methods for angles represented using u64
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_u64
only.
pub const fn new_full() -> Self
_int_u64
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_u64
only.
pub const fn new_right() -> Self
_int_u64
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_u64
only.
pub const fn new_straight() -> Self
_int_u64
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: f64) -> Self
Available on crate feature _int_u64
and (crate features std
or _float_f64
) only.
pub fn from_rad(radians: f64) -> Self
_int_u64
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: f64) -> Self
Available on crate feature _int_u64
and (crate features std
or _float_f64
) only.
pub fn from_deg(degrees: f64) -> Self
_int_u64
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: f64, custom_unit: f64) -> Self
Available on crate feature _int_u64
and (crate features std
or _float_f64
) only.
pub fn from_custom(value: f64, custom_unit: f64) -> Self
_int_u64
and (crate features std
or _float_f64
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f64 ⓘ
Available on crate feature _int_u64
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> f64 ⓘ
_int_u64
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f64 ⓘ
Available on crate feature _int_u64
only.
pub const fn to_deg(self) -> f64 ⓘ
_int_u64
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f64) -> f64 ⓘ
Available on crate feature _int_u64
only.
pub const fn to_custom(self, custom_unit: f64) -> f64 ⓘ
_int_u64
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_u64
only.
pub const fn is_normalized(self) -> bool
_int_u64
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_u64
only.
pub const fn normalize(self) -> Self
_int_u64
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_u64
only.
pub fn set_normalized(&mut self)
_int_u64
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_u64
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_u64
only.Returns true
if the angle has the given direction
.
Source§impl Angle<u64>
§Methods for angles represented using u64
, unsigned.
impl Angle<u64>
§Methods for angles represented using u64
, unsigned.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_u64
only.
pub const fn direction(self) -> AngleDirection
_int_u64
only.Returns the angle direction.
For unsigned integers the direction is always CounterClockwise
.
Sourcepub const fn with_direction(self, _direction: AngleDirection) -> Self
Available on crate feature _int_u64
only.
pub const fn with_direction(self, _direction: AngleDirection) -> Self
_int_u64
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn set_direction(self, _direction: AngleDirection)
Available on crate feature _int_u64
only.
pub const fn set_direction(self, _direction: AngleDirection)
_int_u64
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_u64
only.
pub const fn invert_direction(self) -> Self
_int_u64
only.Returns a version of the angle with inverted direction (no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_u64
only.
pub const fn negative(self) -> Self
_int_u64
only.Returns the negative version of the angle (no-op for unsigned).
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_u64
only.
pub fn set_negative(&mut self)
_int_u64
only.Sets the angle as negative (no-op for unsigned).
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_u64
only.
pub const fn positive(self) -> Self
_int_u64
only.Returns the positive version of the angle (no-op for unsigned).
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_u64
only.
pub fn set_positive(&mut self)
_int_u64
only.Sets the angle as positive (no-op for unsigned).
Source§impl Angle<u128>
§Methods for angles represented using u128
.
impl Angle<u128>
§Methods for angles represented using u128
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_u128
only.
pub const fn new_full() -> Self
_int_u128
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_u128
only.
pub const fn new_right() -> Self
_int_u128
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_u128
only.
pub const fn new_straight() -> Self
_int_u128
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: f64) -> Self
Available on crate feature _int_u128
and (crate features std
or _float_f64
) only.
pub fn from_rad(radians: f64) -> Self
_int_u128
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: f64) -> Self
Available on crate feature _int_u128
and (crate features std
or _float_f64
) only.
pub fn from_deg(degrees: f64) -> Self
_int_u128
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: f64, custom_unit: f64) -> Self
Available on crate feature _int_u128
and (crate features std
or _float_f64
) only.
pub fn from_custom(value: f64, custom_unit: f64) -> Self
_int_u128
and (crate features std
or _float_f64
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f64 ⓘ
Available on crate feature _int_u128
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> f64 ⓘ
_int_u128
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f64 ⓘ
Available on crate feature _int_u128
only.
pub const fn to_deg(self) -> f64 ⓘ
_int_u128
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f64) -> f64 ⓘ
Available on crate feature _int_u128
only.
pub const fn to_custom(self, custom_unit: f64) -> f64 ⓘ
_int_u128
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_u128
only.
pub const fn is_normalized(self) -> bool
_int_u128
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_u128
only.
pub const fn normalize(self) -> Self
_int_u128
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_u128
only.
pub fn set_normalized(&mut self)
_int_u128
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_u128
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_u128
only.Returns true
if the angle has the given direction
.
Source§impl Angle<u128>
§Methods for angles represented using u128
, unsigned.
impl Angle<u128>
§Methods for angles represented using u128
, unsigned.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_u128
only.
pub const fn direction(self) -> AngleDirection
_int_u128
only.Returns the angle direction.
For unsigned integers the direction is always CounterClockwise
.
Sourcepub const fn with_direction(self, _direction: AngleDirection) -> Self
Available on crate feature _int_u128
only.
pub const fn with_direction(self, _direction: AngleDirection) -> Self
_int_u128
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn set_direction(self, _direction: AngleDirection)
Available on crate feature _int_u128
only.
pub const fn set_direction(self, _direction: AngleDirection)
_int_u128
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_u128
only.
pub const fn invert_direction(self) -> Self
_int_u128
only.Returns a version of the angle with inverted direction (no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_u128
only.
pub const fn negative(self) -> Self
_int_u128
only.Returns the negative version of the angle (no-op for unsigned).
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_u128
only.
pub fn set_negative(&mut self)
_int_u128
only.Sets the angle as negative (no-op for unsigned).
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_u128
only.
pub const fn positive(self) -> Self
_int_u128
only.Returns the positive version of the angle (no-op for unsigned).
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_u128
only.
pub fn set_positive(&mut self)
_int_u128
only.Sets the angle as positive (no-op for unsigned).
Source§impl Angle<usize>
§Methods for angles represented using usize
.
impl Angle<usize>
§Methods for angles represented using usize
.
Sourcepub const fn new_full() -> Self
Available on crate feature _int_usize
only.
pub const fn new_full() -> Self
_int_usize
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _int_usize
only.
pub const fn new_right() -> Self
_int_usize
only.Creates a normalized right positive angle at 90 degrees.
Sourcepub const fn new_straight() -> Self
Available on crate feature _int_usize
only.
pub const fn new_straight() -> Self
_int_usize
only.Creates a normalized straight positive angle at 180 degrees.
Sourcepub fn from_rad(radians: fsize) -> Self
Available on crate feature _int_usize
and (crate features std
or _float_f64
) only.
pub fn from_rad(radians: fsize) -> Self
_int_usize
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point radians
value.
Sourcepub fn from_deg(degrees: fsize) -> Self
Available on crate feature _int_usize
and (crate features std
or _float_f64
) only.
pub fn from_deg(degrees: fsize) -> Self
_int_usize
and (crate features std
or _float_f64
) only.Creates a new angle from a floating-point degrees
value.
Sourcepub fn from_custom(value: fsize, custom_unit: fsize) -> Self
Available on crate feature _int_usize
and (crate features std
or _float_f64
) only.
pub fn from_custom(value: fsize, custom_unit: fsize) -> Self
_int_usize
and (crate features std
or _float_f64
) only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> fsize
Available on crate feature _int_usize
and (crate feature std
or _float··
) only.
pub const fn to_rad(self) -> fsize
_int_usize
and (crate feature std
or _float··
) only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> fsize
Available on crate feature _int_usize
only.
pub const fn to_deg(self) -> fsize
_int_usize
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: fsize) -> fsize
Available on crate feature _int_usize
only.
pub const fn to_custom(self, custom_unit: fsize) -> fsize
_int_usize
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate feature _int_usize
only.
pub const fn is_normalized(self) -> bool
_int_usize
only.Always returns true
since integer representations are always normalized.
Sourcepub const fn normalize(self) -> Self
Available on crate feature _int_usize
only.
pub const fn normalize(self) -> Self
_int_usize
only.Returns the angle normalized (no-op for integer representation).
Sourcepub fn set_normalized(&mut self)
Available on crate feature _int_usize
only.
pub fn set_normalized(&mut self)
_int_usize
only.Sets the angle normalized (no-op for integer representation).
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _int_usize
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_int_usize
only.Returns true
if the angle has the given direction
.
Source§impl Angle<usize>
§Methods for angles represented using usize
, unsigned.
impl Angle<usize>
§Methods for angles represented using usize
, unsigned.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _int_usize
only.
pub const fn direction(self) -> AngleDirection
_int_usize
only.Returns the angle direction.
For unsigned integers the direction is always CounterClockwise
.
Sourcepub const fn with_direction(self, _direction: AngleDirection) -> Self
Available on crate feature _int_usize
only.
pub const fn with_direction(self, _direction: AngleDirection) -> Self
_int_usize
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn set_direction(self, _direction: AngleDirection)
Available on crate feature _int_usize
only.
pub const fn set_direction(self, _direction: AngleDirection)
_int_usize
only.Returns a version of the angle with the given direction
(no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _int_usize
only.
pub const fn invert_direction(self) -> Self
_int_usize
only.Returns a version of the angle with inverted direction (no-op for unsigned).
Unsigned integers can only have CounterClockwise
direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _int_usize
only.
pub const fn negative(self) -> Self
_int_usize
only.Returns the negative version of the angle (no-op for unsigned).
Sourcepub fn set_negative(&mut self)
Available on crate feature _int_usize
only.
pub fn set_negative(&mut self)
_int_usize
only.Sets the angle as negative (no-op for unsigned).
Sourcepub const fn positive(self) -> Self
Available on crate feature _int_usize
only.
pub const fn positive(self) -> Self
_int_usize
only.Returns the positive version of the angle (no-op for unsigned).
Sourcepub fn set_positive(&mut self)
Available on crate feature _int_usize
only.
pub fn set_positive(&mut self)
_int_usize
only.Sets the angle as positive (no-op for unsigned).
Source§impl Angle<f32>
§Methods for angles represented using f32
.
impl Angle<f32>
§Methods for angles represented using f32
.
Sourcepub const fn new_full() -> Self
Available on crate feature _float_f32
only.
pub const fn new_full() -> Self
_float_f32
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _float_f32
only.
pub const fn new_right() -> Self
_float_f32
only.Creates a normalized right positive angle at 90 degrees (0.25).
Sourcepub const fn new_straight() -> Self
Available on crate feature _float_f32
only.
pub const fn new_straight() -> Self
_float_f32
only.Creates a normalized straight positive angle at 180 degrees (0.5).
Sourcepub const fn from_rad(radians: f32) -> Self
Available on crate feature _float_f32
only.
pub const fn from_rad(radians: f32) -> Self
_float_f32
only.Creates a new angle from a radians
value.
Sourcepub const fn from_deg(degrees: f32) -> Self
Available on crate feature _float_f32
only.
pub const fn from_deg(degrees: f32) -> Self
_float_f32
only.Creates a new angle from a degrees
value.
Sourcepub const fn from_custom(value: f32, custom_unit: f32) -> Self
Available on crate feature _float_f32
only.
pub const fn from_custom(value: f32, custom_unit: f32) -> Self
_float_f32
only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f32 ⓘ
Available on crate feature _float_f32
only.
pub const fn to_rad(self) -> f32 ⓘ
_float_f32
only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f32 ⓘ
Available on crate feature _float_f32
only.
pub const fn to_deg(self) -> f32 ⓘ
_float_f32
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
Available on crate feature _float_f32
only.
pub const fn to_custom(self, custom_unit: f32) -> f32 ⓘ
_float_f32
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate features _float_f32
and _cmp_f32
only.
pub const fn is_normalized(self) -> bool
_float_f32
and _cmp_f32
only.Returns true
if the angle is between -1 and 1 (non-inclusive).
Sourcepub fn normalize(self) -> Self
Available on crate feature _float_f32
only.
pub fn normalize(self) -> Self
_float_f32
only.Returns the angle normalized to the non-inclusive range -1 to 1.
Sourcepub fn set_normalized(&mut self)
Available on crate feature _float_f32
only.
pub fn set_normalized(&mut self)
_float_f32
only.Sets the angle normalized to the non-inclusive range -1 to 1.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _float_f32
only.
pub const fn direction(self) -> AngleDirection
_float_f32
only.Returns the angle direction.
Since the floating-point representation always maintains the sign the direction can’t be undefined.
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _float_f32
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_float_f32
only.Returns true
if the angle has the given direction
.
Since the floating-point representation always maintains the sign
the direction can’t be undefined, and it will return false
in that case.
Sourcepub const fn with_direction(self, direction: AngleDirection) -> Self
Available on crate feature _float_f32
only.
pub const fn with_direction(self, direction: AngleDirection) -> Self
_float_f32
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub const fn set_direction(&mut self, direction: AngleDirection)
Available on crate feature _float_f32
only.
pub const fn set_direction(&mut self, direction: AngleDirection)
_float_f32
only.Sets the angle to the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _float_f32
only.
pub const fn invert_direction(self) -> Self
_float_f32
only.Returns a version of the angle with inverted direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _float_f32
only.
pub const fn negative(self) -> Self
_float_f32
only.Returns the negative version of the angle.
Sourcepub const fn set_negative(&mut self)
Available on crate feature _float_f32
only.
pub const fn set_negative(&mut self)
_float_f32
only.Sets the angle as negative.
Sourcepub const fn positive(self) -> Self
Available on crate feature _float_f32
only.
pub const fn positive(self) -> Self
_float_f32
only.Returns the positive version of the angle.
Sourcepub const fn set_positive(&mut self)
Available on crate feature _float_f32
only.
pub const fn set_positive(&mut self)
_float_f32
only.Sets the angle as positive.
Sourcepub fn kind(self) -> AngleKind
Available on crate features _float_f32
and _cmp_f32
only.
pub fn kind(self) -> AngleKind
_float_f32
and _cmp_f32
only.Returns the kind of the normalized angle.
Sourcepub fn kind_approx(self, tolerance: f32) -> AngleKind
Available on crate feature _float_f32
only.
pub fn kind_approx(self, tolerance: f32) -> AngleKind
_float_f32
only.Returns the kind of the angle using a custom tolerance for approximate matching.
Sourcepub fn is_kind(self, kind: AngleKind) -> bool
Available on crate features _float_f32
and _cmp_f32
only.
pub fn is_kind(self, kind: AngleKind) -> bool
_float_f32
and _cmp_f32
only.Returns true
if the angle is of the given kind
.
Sourcepub fn is_kind_approx(self, kind: AngleKind, tolerance: f32) -> bool
Available on crate feature _float_f32
only.
pub fn is_kind_approx(self, kind: AngleKind, tolerance: f32) -> bool
_float_f32
only.Returns true
if the angle is of the given kind
using a custom tolerance.
Source§impl Angle<f64>
§Methods for angles represented using f64
.
impl Angle<f64>
§Methods for angles represented using f64
.
Sourcepub const fn new_full() -> Self
Available on crate feature _float_f64
only.
pub const fn new_full() -> Self
_float_f64
only.Creates a normalized full positive angle at 0 degrees.
Sourcepub const fn new_right() -> Self
Available on crate feature _float_f64
only.
pub const fn new_right() -> Self
_float_f64
only.Creates a normalized right positive angle at 90 degrees (0.25).
Sourcepub const fn new_straight() -> Self
Available on crate feature _float_f64
only.
pub const fn new_straight() -> Self
_float_f64
only.Creates a normalized straight positive angle at 180 degrees (0.5).
Sourcepub const fn from_rad(radians: f64) -> Self
Available on crate feature _float_f64
only.
pub const fn from_rad(radians: f64) -> Self
_float_f64
only.Creates a new angle from a radians
value.
Sourcepub const fn from_deg(degrees: f64) -> Self
Available on crate feature _float_f64
only.
pub const fn from_deg(degrees: f64) -> Self
_float_f64
only.Creates a new angle from a degrees
value.
Sourcepub const fn from_custom(value: f64, custom_unit: f64) -> Self
Available on crate feature _float_f64
only.
pub const fn from_custom(value: f64, custom_unit: f64) -> Self
_float_f64
only.Creates a new angle from a value
in a custom_unit
which represents a full turn.
Sourcepub const fn to_rad(self) -> f64 ⓘ
Available on crate feature _float_f64
only.
pub const fn to_rad(self) -> f64 ⓘ
_float_f64
only.Converts the angle to radians.
Sourcepub const fn to_deg(self) -> f64 ⓘ
Available on crate feature _float_f64
only.
pub const fn to_deg(self) -> f64 ⓘ
_float_f64
only.Converts the angle to degrees.
Sourcepub const fn to_custom(self, custom_unit: f64) -> f64 ⓘ
Available on crate feature _float_f64
only.
pub const fn to_custom(self, custom_unit: f64) -> f64 ⓘ
_float_f64
only.Converts the angle to a custom_unit
which represents a full turn.
Sourcepub const fn is_normalized(self) -> bool
Available on crate features _float_f64
and _cmp_f64
only.
pub const fn is_normalized(self) -> bool
_float_f64
and _cmp_f64
only.Returns true
if the angle is between -1 and 1 (non-inclusive).
Sourcepub fn normalize(self) -> Self
Available on crate feature _float_f64
only.
pub fn normalize(self) -> Self
_float_f64
only.Returns the angle normalized to the non-inclusive range -1 to 1.
Sourcepub fn set_normalized(&mut self)
Available on crate feature _float_f64
only.
pub fn set_normalized(&mut self)
_float_f64
only.Sets the angle normalized to the non-inclusive range -1 to 1.
Sourcepub const fn direction(self) -> AngleDirection
Available on crate feature _float_f64
only.
pub const fn direction(self) -> AngleDirection
_float_f64
only.Returns the angle direction.
Since the floating-point representation always maintains the sign the direction can’t be undefined.
Sourcepub const fn has_direction(self, direction: AngleDirection) -> bool
Available on crate feature _float_f64
only.
pub const fn has_direction(self, direction: AngleDirection) -> bool
_float_f64
only.Returns true
if the angle has the given direction
.
Since the floating-point representation always maintains the sign
the direction can’t be undefined, and it will return false
in that case.
Sourcepub const fn with_direction(self, direction: AngleDirection) -> Self
Available on crate feature _float_f64
only.
pub const fn with_direction(self, direction: AngleDirection) -> Self
_float_f64
only.Returns a version of the angle with the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub const fn set_direction(&mut self, direction: AngleDirection)
Available on crate feature _float_f64
only.
pub const fn set_direction(&mut self, direction: AngleDirection)
_float_f64
only.Sets the angle to the given direction
.
An Undefined
direction will be interpreted as counter-clockwise (positive).
Sourcepub const fn invert_direction(self) -> Self
Available on crate feature _float_f64
only.
pub const fn invert_direction(self) -> Self
_float_f64
only.Returns a version of the angle with inverted direction.
Sourcepub const fn negative(self) -> Self
Available on crate feature _float_f64
only.
pub const fn negative(self) -> Self
_float_f64
only.Returns the negative version of the angle.
Sourcepub const fn set_negative(&mut self)
Available on crate feature _float_f64
only.
pub const fn set_negative(&mut self)
_float_f64
only.Sets the angle as negative.
Sourcepub const fn positive(self) -> Self
Available on crate feature _float_f64
only.
pub const fn positive(self) -> Self
_float_f64
only.Returns the positive version of the angle.
Sourcepub const fn set_positive(&mut self)
Available on crate feature _float_f64
only.
pub const fn set_positive(&mut self)
_float_f64
only.Sets the angle as positive.
Sourcepub fn kind(self) -> AngleKind
Available on crate features _float_f64
and _cmp_f64
only.
pub fn kind(self) -> AngleKind
_float_f64
and _cmp_f64
only.Returns the kind of the normalized angle.
Sourcepub fn kind_approx(self, tolerance: f64) -> AngleKind
Available on crate feature _float_f64
only.
pub fn kind_approx(self, tolerance: f64) -> AngleKind
_float_f64
only.Returns the kind of the angle using a custom tolerance for approximate matching.
Sourcepub fn is_kind(self, kind: AngleKind) -> bool
Available on crate features _float_f64
and _cmp_f64
only.
pub fn is_kind(self, kind: AngleKind) -> bool
_float_f64
and _cmp_f64
only.Returns true
if the angle is of the given kind
.
Sourcepub fn is_kind_approx(self, kind: AngleKind, tolerance: f64) -> bool
Available on crate feature _float_f64
only.
pub fn is_kind_approx(self, kind: AngleKind, tolerance: f64) -> bool
_float_f64
only.Returns true
if the angle is of the given kind
using a custom tolerance.
Trait Implementations§
Source§impl<T: ConstDefault> ConstDefault for Angle<T>
impl<T: ConstDefault> ConstDefault for Angle<T>
Source§impl<T: Ord> Ord for Angle<T>
impl<T: Ord> Ord for Angle<T>
Source§impl<T: PartialOrd> PartialOrd for Angle<T>
impl<T: PartialOrd> PartialOrd for Angle<T>
impl<T: Copy> Copy for Angle<T>
impl<T: Eq> Eq for Angle<T>
Auto Trait Implementations§
impl<T> Freeze for Angle<T>where
T: Freeze,
impl<T> RefUnwindSafe for Angle<T>where
T: RefUnwindSafe,
impl<T> Send for Angle<T>where
T: Send,
impl<T> Sync for Angle<T>where
T: Sync,
impl<T> Unpin for Angle<T>where
T: Unpin,
impl<T> UnwindSafe for Angle<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize ⓘ
fn byte_align(&self) -> usize ⓘ
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of_val(&self) -> usize ⓘ
fn mem_align_of_val(&self) -> usize ⓘ
Source§fn mem_size_of_val(&self) -> usize ⓘ
fn mem_size_of_val(&self) -> usize ⓘ
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.