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

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

Springy rubber band.
- The original starts with a = 0.1, p = 0.4, but since a < 1 changes it to a = 1, s = p / 4, it always uses the values below.

Example: Values that overshoot the end and dip below the start

```rust
use vanilla::easing_function::elastic;

assert_eq!(elastic::ease_out(0.0), 0.0);
assert_eq!(elastic::ease_out(1.0), 1.0);
assert!((elastic::ease_out(0.2) - 1.25).abs() < 1e-5);
assert!((elastic::ease_in(0.8) + 0.25).abs() < 1e-5);
```

## Functions and constants

- `pub fn ease_in(progress: f64) -> f64` (method, since 0.4.0): Wobbles at the start, then moves forward.
  - `progress` f64: Progress. (0 ~ 1)
  - returns f64: Interpolation ratio. (0 at 0, 1 at 1, in between it wobbles overshooting outside 0 ~ 1)
- `pub fn ease_out(progress: f64) -> f64` (method, since 0.4.0): Overshoots the end, then wobbles to a stop.
  - `progress` f64: Progress. (0 ~ 1)
  - returns f64: Interpolation ratio. (0 at 0, 1 at 1, in between it wobbles overshooting outside 0 ~ 1)
- `pub fn ease_in_out(progress: f64) -> f64` (method, since 0.4.0): Wobbles at the start and the end.
  - `progress` f64: Progress. (0 ~ 1)
  - returns f64: Interpolation ratio. (0 at 0, 1 at 1, in between it wobbles overshooting outside 0 ~ 1)
