#[repr(C)]pub struct Rot2 { /* private fields */ }
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.
Implementations
sourceimpl 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) -> Rot2
pub fn normalized(self) -> Self
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Rot2
impl<'de> Deserialize<'de> for Rot2
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Rot2
impl Pod for Rot2
impl StructuralPartialEq for Rot2
Auto Trait Implementations
impl RefUnwindSafe for Rot2
impl Send for Rot2
impl Sync for Rot2
impl Unpin for Rot2
impl UnwindSafe for Rot2
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more