convert_to_cartesian works on arrays, added flip_angles function