Struct euclid::Rotation2D [−][src]
#[repr(C)]pub struct Rotation2D<T, Src, Dst> { pub angle: T, // some fields omitted }
Expand description
A transform that can represent rotations in 2d, represented as an angle in radians.
Fields
angle: T
Angle in radians
Implementations
impl<T, Src, Dst> Rotation2D<T, Src, Dst>
[src]
impl<T, Src, Dst> Rotation2D<T, Src, Dst>
[src]impl<T: Copy, Src, Dst> Rotation2D<T, Src, Dst>
[src]
impl<T: Copy, Src, Dst> Rotation2D<T, Src, Dst>
[src]pub fn cast_unit<Src2, Dst2>(&self) -> Rotation2D<T, Src2, Dst2>
[src]
pub fn cast_unit<Src2, Dst2>(&self) -> Rotation2D<T, Src2, Dst2>
[src]Cast the unit, preserving the numeric value.
Example
enum Local {} enum World {} enum Local2 {} enum World2 {} let to_world: Rotation2D<_, Local, World> = Rotation2D::radians(42); assert_eq!(to_world.angle, to_world.cast_unit::<Local2, World2>().angle);
pub fn to_untyped(&self) -> Rotation2D<T, UnknownUnit, UnknownUnit>
[src]
pub fn to_untyped(&self) -> Rotation2D<T, UnknownUnit, UnknownUnit>
[src]Drop the units, preserving only the numeric value.
Example
enum Local {} enum World {} let to_world: Rotation2D<_, Local, World> = Rotation2D::radians(42); assert_eq!(to_world.angle, to_world.to_untyped().angle);
pub fn from_untyped(r: &Rotation2D<T, UnknownUnit, UnknownUnit>) -> Self
[src]
pub fn from_untyped(r: &Rotation2D<T, UnknownUnit, UnknownUnit>) -> Self
[src]Tag a unitless value with units.
Example
use euclid::UnknownUnit; enum Local {} enum World {} let rot: Rotation2D<_, UnknownUnit, UnknownUnit> = Rotation2D::radians(42); assert_eq!(rot.angle, Rotation2D::<_, Local, World>::from_untyped(&rot).angle);
impl<T, Src, Dst> Rotation2D<T, Src, Dst> where
T: Copy,
[src]
impl<T, Src, Dst> Rotation2D<T, Src, Dst> where
T: Copy,
[src]impl<T: Float, Src, Dst> Rotation2D<T, Src, Dst>
[src]
impl<T: Float, Src, Dst> Rotation2D<T, Src, Dst>
[src]pub fn to_3d(&self) -> Rotation3D<T, Src, Dst>
[src]
pub fn to_3d(&self) -> Rotation3D<T, Src, Dst>
[src]Creates a 3d rotation (around the z axis) from this 2d rotation.
pub fn inverse(&self) -> Rotation2D<T, Dst, Src>
[src]
pub fn inverse(&self) -> Rotation2D<T, Dst, Src>
[src]Returns the inverse of this rotation.
pub fn then<NewSrc>(
&self,
other: &Rotation2D<T, NewSrc, Src>
) -> Rotation2D<T, NewSrc, Dst>
[src]
pub fn then<NewSrc>(
&self,
other: &Rotation2D<T, NewSrc, Src>
) -> Rotation2D<T, NewSrc, Dst>
[src]Returns a rotation representing the other rotation followed by this rotation.
pub fn transform_point(&self, point: Point2D<T, Src>) -> Point2D<T, Dst>
[src]
pub fn transform_point(&self, point: Point2D<T, Src>) -> Point2D<T, Dst>
[src]Returns the given 2d point transformed by this rotation.
The input point must be use the unit Src, and the returned point has the unit Dst.
pub fn transform_vector(&self, vector: Vector2D<T, Src>) -> Vector2D<T, Dst>
[src]
pub fn transform_vector(&self, vector: Vector2D<T, Src>) -> Vector2D<T, Dst>
[src]Returns the given 2d vector transformed by this rotation.
The input point must be use the unit Src, and the returned point has the unit Dst.
impl<T, Src, Dst> Rotation2D<T, Src, Dst> where
T: Copy + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Zero + Trig,
[src]
impl<T, Src, Dst> Rotation2D<T, Src, Dst> where
T: Copy + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Zero + Trig,
[src]pub fn to_transform(&self) -> Transform2D<T, Src, Dst>
[src]
pub fn to_transform(&self) -> Transform2D<T, Src, Dst>
[src]Returns the matrix representation of this rotation.
Trait Implementations
impl<T: Clone, Src, Dst> Clone for Rotation2D<T, Src, Dst>
[src]
impl<T: Clone, Src, Dst> Clone for Rotation2D<T, Src, Dst>
[src]impl<T, Src, Dst> Hash for Rotation2D<T, Src, Dst> where
T: Hash,
[src]
impl<T, Src, Dst> Hash for Rotation2D<T, Src, Dst> where
T: Hash,
[src]impl<T, Src, Dst> PartialEq<Rotation2D<T, Src, Dst>> for Rotation2D<T, Src, Dst> where
T: PartialEq,
[src]
impl<T, Src, Dst> PartialEq<Rotation2D<T, Src, Dst>> for Rotation2D<T, Src, Dst> where
T: PartialEq,
[src]impl<T: Copy, Src, Dst> Copy for Rotation2D<T, Src, Dst>
[src]
impl<T, Src, Dst> Eq for Rotation2D<T, Src, Dst> where
T: Eq,
[src]
T: Eq,
Auto Trait Implementations
impl<T, Src, Dst> RefUnwindSafe for Rotation2D<T, Src, Dst> where
Dst: RefUnwindSafe,
Src: RefUnwindSafe,
T: RefUnwindSafe,
Dst: RefUnwindSafe,
Src: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Src, Dst> Send for Rotation2D<T, Src, Dst> where
Dst: Send,
Src: Send,
T: Send,
Dst: Send,
Src: Send,
T: Send,
impl<T, Src, Dst> Sync for Rotation2D<T, Src, Dst> where
Dst: Sync,
Src: Sync,
T: Sync,
Dst: Sync,
Src: Sync,
T: Sync,
impl<T, Src, Dst> Unpin for Rotation2D<T, Src, Dst> where
Dst: Unpin,
Src: Unpin,
T: Unpin,
Dst: Unpin,
Src: Unpin,
T: Unpin,
impl<T, Src, Dst> UnwindSafe for Rotation2D<T, Src, Dst> where
Dst: UnwindSafe,
Src: UnwindSafe,
T: UnwindSafe,
Dst: UnwindSafe,
Src: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more