use nalgebra::{Matrix3, Vector3};

/// Calculates skew-symmetric matrix
///
/// # Example
/// ```
/// use nalgebra::{Matrix3, Vector3};
/// use navitools::skew_symmetric;
///
/// let omega = Vector3::new(1.0, 2.0, 3.0);
/// let omega_x = skew_symmetric(&omega);
/// let ans = Matrix3::new(
///    0.0, -3.0,  2.0,
///    3.0,  0.0, -1.0,
///   -2.0,  1.0,  0.0,
/// );
/// assert!(omega_x == ans);
/// ```
pub fn skew_symmetric(a: &Vector3<f64>) -> Matrix3<f64> {
    Matrix3::new(0.0, -a.z, a.y, a.z, 0.0, -a.x, -a.y, a.x, 0.0)
}
