pub trait Rotate<T: RealField> {
// Required method
fn rotate_by_matrix(&mut self, mtx: [[T; 3]; 3]);
// Provided methods
fn rotate(&mut self, axis: [T; 3], theta: T) { ... }
fn rotate_by_vector(&mut self, e: [T; 3])
where T: Zero { ... }
}
Expand description
Rotate a given object by a certain amount. All functions rotate the object using the right-hand-rule.
Required Methods§
sourcefn rotate_by_matrix(&mut self, mtx: [[T; 3]; 3])
fn rotate_by_matrix(&mut self, mtx: [[T; 3]; 3])
Rotate the object using the given column-major rotation matrix.
Provided Methods§
sourcefn rotate(&mut self, axis: [T; 3], theta: T)
fn rotate(&mut self, axis: [T; 3], theta: T)
Rotate the object around the given unit vector u
by the given angle theta
(in radians).
Note that it is assumed that u
is indeed a unit vector, no further normalization should
be performed.
sourcefn rotate_by_vector(&mut self, e: [T; 3])where
T: Zero,
fn rotate_by_vector(&mut self, e: [T; 3])where
T: Zero,
Rotate the object using the given Euler vector (or rotation vector) e
. The direction of
e
specifies the axis of rotation and its magnitude is the angle in radians.