michaelfairley / ezing

Easing functions for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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);

About

Easing functions for Rust

License:Apache License 2.0


Languages

Language:Rust 100.0%