(float t, float b, float c, float d)
| 321 | } |
| 322 | |
| 323 | public float ease(float t, float b, float c, float d) { |
| 324 | float a = getAmplitude(); |
| 325 | float p = getPeriod(); |
| 326 | if (t == 0) return b; |
| 327 | if ((t /= d / 2) == 2) return b + c; |
| 328 | if (p == 0) p = d * (.3f * 1.5f); |
| 329 | float s = 0; |
| 330 | if (a < Math.abs(c)) { |
| 331 | a = c; |
| 332 | s = p / 4f; |
| 333 | } else s = p / (float) (2 * Math.PI) * (float) Math.asin(c / a); |
| 334 | if (t < 1) |
| 335 | return -.5f * (a * (float) Math.pow(2, 10 * (t -= 1)) * (float) Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; |
| 336 | return a * (float) Math.pow(2, -10 * (t -= 1)) * (float) Math.sin((t * d - s) * (2 * Math.PI) / p) * .5f + c + b; |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | /** |
nothing calls this directly
no test coverage detected