#[repr(C)]pub struct Rot2 {
s: f32,
c: f32,
}
Expand description
Represents a rotation in the 2D plane.
A rotation of ๐/4 = 90ยฐ rotates the X axis to the Y axis.
Normally a Rot2
is normalized (unit-length).
If not, it will also scale vectors.
Fieldsยง
ยงs: f32
angle.sin()
c: f32
angle.cos()
Implementationsยง
sourceยงimpl Rot2
impl Rot2
sourcepub fn from_angle(angle: f32) -> Self
pub fn from_angle(angle: f32) -> Self
Angle is clockwise in radians. A ๐/4 = 90ยฐ rotation means rotating the X axis to the Y axis.
pub fn angle(self) -> f32
pub fn length_squared(self) -> f32
pub fn is_finite(self) -> bool
pub fn inverse(self) -> Self
pub fn normalized(self) -> Self
Trait Implementationsยง
sourceยงimpl PartialEq for Rot2
impl PartialEq for Rot2
impl Copy for Rot2
impl Pod for Rot2
impl StructuralPartialEq for Rot2
Auto Trait Implementationsยง
impl Freeze for Rot2
impl RefUnwindSafe for Rot2
impl Send for Rot2
impl Sync for Rot2
impl Unpin for Rot2
impl UnwindSafe for Rot2
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<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
ยงtype Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.sourceยงfn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.