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