/// Create a rotation matrix from an angle around an arbitrary axis.
Create a rotation matrix from an angle around an arbitrary axis.
Create a rotation matrix from an angle around an arbitrary axis .
pub fn from_axis_angle(axis: Vector3<S>, angle: Rad<S>) -> Matrix3<S> {
        let (s, c) = Rad::sin_cos(angle);
        let _1subc = S::one() - c;
        Matrix3::new(_1subc * axis.x * axis.x + c,
                     _1subc * axis.x * axis.y + s * axis.z,
                     _1subc * axis.x * axis.z - s * axis.y,
                     _1subc * axis.x * axis.y - s * axis.z,
                     _1subc * axis.y * axis.y + c,
                     _1subc * axis.y * axis.z + s * axis.x,
                     _1subc * axis.x * axis.z + s * axis.y,
                     _1subc * axis.y * axis.z - s * axis.x,
                     _1subc * axis.z * axis.z + c)
    }
pub fn from_axis_angle ( axis : Vector3 < S > , angle : Rad < S > ) -> Matrix3 < S > { let ( s , c ) = Rad :: sin_cos ( angle ) ; let _1subc = S :: one ( ) - c ; Matrix3 :: new ( _1subc * axis . x * axis . x + c , _1subc * axis . x * axis . y + s * axis . z , _1subc * axis . x * axis . z - s * axis . y , _1subc * axis . x * axis . y - s * axis . z , _1subc * axis . y * axis . y + c , _1subc * axis . y * axis . z + s * axis . x , _1subc * axis . x * axis . z + s * axis . y , _1subc * axis . y * axis . z - s * axis . x , _1subc * axis . z * axis . z + c ) }
Create a rotation matrix from an angle around an arbitrary axis.
Create a rotation matrix from an angle around an arbitrary axis .
axis
Vector3<S>
angle
Rad<S>