5 releases

Uses old Rust 2015

0.2.1 Nov 1, 2018
0.2.0 Jun 7, 2018
0.1.2 May 23, 2017
0.1.1 May 23, 2017
0.1.0 Mar 22, 2017

#771 in Rust patterns

Download history 46/week @ 2022-08-15 318/week @ 2022-08-22 51/week @ 2022-08-29 59/week @ 2022-09-05 37/week @ 2022-09-12 37/week @ 2022-09-19 39/week @ 2022-09-26 92/week @ 2022-10-03 47/week @ 2022-10-10 39/week @ 2022-10-17 60/week @ 2022-10-24 74/week @ 2022-10-31 71/week @ 2022-11-07 58/week @ 2022-11-14 27/week @ 2022-11-21 34/week @ 2022-11-28

190 downloads per month
Used in ggez-goodies

MIT/Apache

175KB
264 lines

ezing

Simple easing functions for Rust

Build Status Documentation Version License

[quad, cubic, quart, quint, sine, circ, expo, elastic, back, bounce] x [in, out, inout]

All functions have the signature fn<F: Float>(F) -> F (letting you use f32, f64, or any other type that implements num_traits's Float). Input should range from 0.0 to 1.0, and output is generally in the 0.0 to 1.0 range (except for elastic and back, which return values slightly outside). 0.0 always maps to 0.0, and 1.0 always maps to 1.0. Use 'em to lerp or something:

let current_pos = lerp(ezing::cubic_inout(t), start, end);

Dependencies