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

#1430 in Algorithms

Download history 523/week @ 2023-12-03 583/week @ 2023-12-10 340/week @ 2023-12-17 99/week @ 2023-12-24 270/week @ 2023-12-31 413/week @ 2024-01-07 380/week @ 2024-01-14 338/week @ 2024-01-21 452/week @ 2024-01-28 537/week @ 2024-02-04 413/week @ 2024-02-11 462/week @ 2024-02-18 883/week @ 2024-02-25 720/week @ 2024-03-03 534/week @ 2024-03-10 573/week @ 2024-03-17

2,724 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