Crates.io | number_easing |
lib.rs | number_easing |
version | 0.1.1 |
source | src |
created_at | 2017-10-01 23:47:29.123998 |
updated_at | 2018-01-27 14:58:53.639991 |
description | number easing functions |
homepage | https://gitlab.com/nathanfaucett/rs-number_easing |
repository | https://gitlab.com/nathanfaucett/rs-number_easing.git |
max_upload_size | |
id | 34115 |
size | 9,560 |
number easing functions
extern crate number_easing;
use number_easing::{in_out_cubic, in_out_quad};
fn main() {
assert_eq!(in_out_cubic(0, 100, 0), 0);
assert_eq!(in_out_cubic(0, 100, 0.25), 6);
assert_eq!(in_out_cubic(0, 100, 0.5), 50);
assert_eq!(in_out_cubic(0, 100, 0.75), 93);
assert_eq!(in_out_cubic(0, 100, 1.0), 100);
assert_eq!(in_out_quad(0, 100, 0), 0);
assert_eq!(in_out_quad(0, 100, 0.25), 12);
assert_eq!(in_out_quad(0, 100, 0.5), 50);
assert_eq!(in_out_quad(0, 100, 0.75), 87);
assert_eq!(in_out_quad(0, 100, 1.0), 100);
}