mln-rs-style 0.0.21

Part of mln-rs, a MapLibre map renderer written in Rust. Depend on mln-rs instead.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
}