* A simple elastic interaction, similar to a spring oscillating back and * forth. * * Default bounciness is 1, which overshoots a little bit once. 0 bounciness * doesn't overshoot at all, and bounciness of N > 1 will overshoot about N * times. * * http://easings.net/#easeInElast
(bounciness: number = 1)
| 169 | * - http://tiny.cc/elastic_b_3 (bounciness = 3) |
| 170 | */ |
| 171 | static elastic(bounciness: number = 1): (t: number) => number { |
| 172 | const p = bounciness * Math.PI; |
| 173 | return (t) => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p); |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * Use with `Animated.parallel()` to create a simple effect where the object |
no outgoing calls
no test coverage detected