/// Convert the quaternion to a 3 x 3 rotation matrix
Convert the quaternion to a 3 x 3 rotation matrix
Convert the quaternion to a 3 x 3 rotation matrix
fn from(quat: Quaternion<S>) -> Matrix3<S> {
        let x2 = quat.v.x + quat.v.x;
        let y2 = quat.v.y + quat.v.y;
        let z2 = quat.v.z + quat.v.z;
        let xx2 = x2 * quat.v.x;
        let xy2 = x2 * quat.v.y;
        let xz2 = x2 * quat.v.z;
        let yy2 = y2 * quat.v.y;
        let yz2 = y2 * quat.v.z;
        let zz2 = z2 * quat.v.z;
        let sy2 = y2 * quat.s;
        let sz2 = z2 * quat.s;
        let sx2 = x2 * quat.s;
        Matrix3::new(S::one() - yy2 - zz2, xy2 + sz2, xz2 - sy2,
                     xy2 - sz2, S::one() - xx2 - zz2, yz2 + sx2,
                     xz2 + sy2, yz2 - sx2, S::one() - xx2 - yy2)
    }
fn from ( quat : Quaternion < S > ) -> Matrix3 < S > { let x2 = quat . v . x + quat . v . x ; let y2 = quat . v . y + quat . v . y ; let z2 = quat . v . z + quat . v . z ; let xx2 = x2 * quat . v . x ; let xy2 = x2 * quat . v . y ; let xz2 = x2 * quat . v . z ; let yy2 = y2 * quat . v . y ; let yz2 = y2 * quat . v . z ; let zz2 = z2 * quat . v . z ; let sy2 = y2 * quat . s ; let sz2 = z2 * quat . s ; let sx2 = x2 * quat . s ; Matrix3 :: new ( S :: one ( ) - yy2 - zz2 , xy2 + sz2 , xz2 - sy2 , xy2 - sz2 , S :: one ( ) - xx2 - zz2 , yz2 + sx2 , xz2 + sy2 , yz2 - sx2 , S :: one ( ) - xx2 - yy2 ) }
Convert the quaternion to a 3 x 3 rotation matrix
Convert the quaternion to a 3 x 3 rotation matrix
quat
Quaternion<S>