use approx::assert_abs_diff_eq;
use crate::interpolate::Interpolate;
use crate::types::Rotation;
// gtest: Rotation.Calculations
#[test]
fn calculations() {
let rot = Rotation::new(42.0);
assert_eq!(rot, Rotation::new(42.0 + 360.0));
let rot2 = Rotation::new(-42.0);
assert_eq!(rot2, Rotation::new(360.0 - 42.0));
// mln::util::Interpolator<mln::style::Rotation> i; i(rot, rot2, 0.5)
assert_abs_diff_eq!(rot.interpolate(&rot2, 0.5).angle(), 0.0, epsilon = 0.00001);
}