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
35
36
37
38
39
40
41
42
43
44
//! # interpolated
//!
//! Generic, smooth value interpolation and easing functions for Rust.
//!
//! This crate provides the `Interpolated<T>` type for animating values of any
//! arithmetic type over time using customizable easing functions.
//!
//! ## Usage
//!
//! Add to your `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! interpolated = "0.1.0"
//! ```
//!
//! Import and use in code:
//!
//! ```rust
//! use interpolated::{Interpolated, linear};
//! use std::time::Duration;
//!
//! let mut value = Interpolated::new(0.0f32);
//! value.set_duration(Duration::from_secs_f32(1.0));
//! value.transition = linear;
//! value.set(10.0);
//! // In an update loop:
//! let current = value.value();
//! println!("Current: {}", current);
//! ```
pub use ;
pub use Interpolated;