use kalast::toolbox::geometry::cart_to_sph;
use kalast::{SphericalCoordinates, TAU, V3X};

#[test]
fn conversion_from_cartesians_to_sphericals() {
    let vector_cartesian = V3X::from_column_slice(&[1., 0., 0., 0., 1., 0.]);
    let vector_spherical: SphericalCoordinates<f64> = cart_to_sph(&vector_cartesian);
    let mut it = vector_spherical.iter();
    assert_eq!(*it.next().unwrap(), 0.);
    assert_eq!(*it.next().unwrap(), 0.);
    assert_eq!(*it.next().unwrap(), 1.0);
    assert_eq!(*it.next().unwrap(), TAU / 4.);
    assert_eq!(*it.next().unwrap(), 0.0);
    assert_eq!(*it.next().unwrap(), 1.0);
}
