pub struct Rotation3D { /* private fields */ }Implementations§
Source§impl Rotation3D
impl Rotation3D
Sourcepub fn unit() -> Rotation3D
pub fn unit() -> Rotation3D
This creates the unit rotation, which does not rotate anything.
§Example:
use bb_geometry::vector3d::Vector3D;
use bb_geometry::rotation3d::Rotation3D;
let r = Rotation3D::unit();
let v = Vector3D::random_vector();
assert!(r.act_on(&v).almost_equals(&v));Sourcepub fn from_euler_angles(psi: f64, theta: f64, phi: f64) -> Rotation3D
pub fn from_euler_angles(psi: f64, theta: f64, phi: f64) -> Rotation3D
This method creates a 3d rotation using a specific parameterisation in terms of Euler angles.
§Examples:
use std::f64::consts::PI;
use bb_geometry::rotation3d::Rotation3D;
use bb_geometry::vector3d::*;
let r = Rotation3D::from_euler_angles(0.0, PI/2.0, 0.0);
assert!(&r.act_on(&X).almost_equals(&Z.revert()));
assert!(&r.act_on(&Y).almost_equals(&Y));
assert!(&r.act_on(&Z).almost_equals(&X));pub fn inverse(&self) -> Rotation3D
pub fn transpose(&self) -> Rotation3D
pub fn act_on(&self, v: &Vector3D) -> Vector3D
pub fn generate_random_rotations(n: usize) -> Vec<Rotation3D>
pub fn components(&self) -> [[f64; 3]; 3]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rotation3D
impl RefUnwindSafe for Rotation3D
impl Send for Rotation3D
impl Sync for Rotation3D
impl Unpin for Rotation3D
impl UnwindSafe for Rotation3D
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