1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
//! This library implements Robert Penner's easing functions. //! Easing functions calculate rate of change of a property over time. //! //! A little website [easings.net](http://easings.net) can help visualising //! functions. Another can help you understanding Easing functions in details //! [upshots.org/jsas-understanding-easing](http://upshots.org/actionscript/jsas-understanding-easing). //! //! - **`t`** is the current time (or position) of the tween. //! This can be seconds or frames, steps, seconds, ms, whatever //! as long as the unit is the same as is used for the total time. //! - **`b`** is the beginning value of the property. //! - **`c`** is the change between the beginning and destination value of the property. //! - **`d`** is the total time of the tween. //! //! #example //! //! ``` //! use easer::functions::*; //! let mut y: [f64; 100] = [0.0; 100]; //! for i in 0..100 { //! y[i] = i as f64; //! } //! println!("Before {:?}", &y[..]); //! y.iter_mut().map(|a| *a = Back::ease_in(*a, 0.0, 100.0, 100.0)).count(); //! println!("After {:?}", &y[..]); //! //! ``` extern crate num_traits; pub mod functions; #[cfg(test)] #[macro_use] extern crate approx;