# core/tween/easing_function (vanilla-engine 0.4.0)

> https://vanillapunch.com/docs/vanilla-engine/0.4.0/api/core/tween/easing_function/

Easing function. (the original Tween.easingFunction)
- Takes the progress (0 ~ 1) and returns the interpolation ratio. back, elastic overshoot outside 0 ~ 1.
- The original modifies the argument k in place (k *= 2, --k). Here each changed value is given a name.

Example: Check easing values and apply one to a tween

```rust
use vanilla::{easing_function, Tween, TweenValues};

assert_eq!(easing_function::linear(0.25), 0.25);
assert_eq!(easing_function::quadratic::ease_in(0.5), 0.25);

let tween = Tween::new(TweenValues::new().with("x", 0.0))
	.to(TweenValues::new().with("x", 100.0), 0.5)
	.easing(easing_function::back::ease_out);
assert!(!tween.is_finished());
```

## Functions and constants

- `pub fn linear(progress: f64) -> f64` (method, since 0.3.2): Linear.
  - `progress` f64: Progress. (0 ~ 1)
  - returns f64: Interpolation ratio. (progress as is)
