Function cavalier_contours::core::math::angle_is_between_eps
source · pub fn angle_is_between_eps<T>(
test_angle: T,
start_angle: T,
end_angle: T,
epsilon: T
) -> boolwhere
T: Real,
Expand description
Tests if test_angle
is between a start_angle
and end_angle
.
Test assumes counter clockwise start_angle
to end_angle
, and is inclusive using epsilon
.
See angle_is_between function to use default fuzzy epsilon.
§Examples
use std::f64::consts::PI;
assert!(angle_is_between_eps(PI / 2.0, 0.0, PI, 1e-5));
assert!(angle_is_between_eps(0.0, 0.0, PI, 1e-5));
assert!(angle_is_between_eps(PI, 0.0, PI, 1e-5));
// note: always calculated as going counter clockwise
// going from PI to PI / 2 counter clockwise sweeps 0.0
assert!(angle_is_between_eps(0.0, PI, PI / 2.0, 1e-5));