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

#1615 in Algorithms

Download history 504/week @ 2024-07-21 419/week @ 2024-07-28 474/week @ 2024-08-04 388/week @ 2024-08-11 580/week @ 2024-08-18 313/week @ 2024-08-25 243/week @ 2024-09-01 272/week @ 2024-09-08 228/week @ 2024-09-15 438/week @ 2024-09-22 523/week @ 2024-09-29 436/week @ 2024-10-06 764/week @ 2024-10-13 585/week @ 2024-10-20 717/week @ 2024-10-27 699/week @ 2024-11-03

2,811 downloads per month
Used in 3 crates (2 directly)

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