# 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/

튕기는 고무줄.
- 원본은 a = 0.1, p = 0.4 로 시작하지만 a < 1 이면 a = 1, s = p / 4 로 바꾸므로 늘 아래 값이다.

예제: 끝을 넘고 처음 아래로 내려가는 값

```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): 시작에서 떨다가 나아간다.
  - `progress` f64: 진행률. (0 ~ 1)
  - returns f64: 보간 비율. (0 에서 0, 1 에서 1, 사이에서는 0 ~ 1 밖으로 넘치며 떤다)
- `pub fn ease_out(progress: f64) -> f64` (method, since 0.4.0): 끝을 넘었다가 떨며 멈춘다.
  - `progress` f64: 진행률. (0 ~ 1)
  - returns f64: 보간 비율. (0 에서 0, 1 에서 1, 사이에서는 0 ~ 1 밖으로 넘치며 떤다)
- `pub fn ease_in_out(progress: f64) -> f64` (method, since 0.4.0): 시작과 끝에서 떤다.
  - `progress` f64: 진행률. (0 ~ 1)
  - returns f64: 보간 비율. (0 에서 0, 1 에서 1, 사이에서는 0 ~ 1 밖으로 넘치며 떤다)
