simple_easing2/
circ.rs

1/// <https://easings.net/#easeInCirc>
2#[must_use]
3#[inline(always)]
4pub fn circ_in(t: f32) -> f32 {
5    1.0 - t.mul_add(-t, 1.0).sqrt()
6}
7
8/// <https://easings.net/#easeOutCirc>
9#[must_use]
10#[inline(always)]
11pub fn circ_out(t: f32) -> f32 {
12    (t - 1.0).mul_add(-(t - 1.0), 1.0).sqrt()
13}
14
15/// <https://easings.net/#easeInOutCirc>
16#[must_use]
17#[inline(always)]
18pub fn circ_in_out(t: f32) -> f32 {
19    if t < 0.5 {
20        (1.0 - (2.0 * t).mul_add(-(2.0 * t), 1.0).sqrt()) / 2.0
21    } else {
22        ((-2.0f32)
23            .mul_add(t, 2.0)
24            .mul_add(-(-2.0f32).mul_add(t, 2.0), 1.0)
25            .sqrt()
26            + 1.0)
27            / 2.0
28    }
29}