MCPcopy Create free account
hub / github.com/LaVache-FR/AnimationUtil / ease

Method ease

fr/lavache/anime/Easing.java:269–281  ·  view source on GitHub ↗
(float t, float b, float c, float d)

Source from the content-addressed store, hash-verified

267 }
268
269 public float ease(float t, float b, float c, float d) {
270 float a = getAmplitude();
271 float p = getPeriod();
272 if (t == 0) return b;
273 if ((t /= d) == 1) return b + c;
274 if (p == 0) p = d * .3f;
275 float s = 0;
276 if (a < Math.abs(c)) {
277 a = c;
278 s = p / 4;
279 } else s = p / (float) (2 * Math.PI) * (float) Math.asin(c / a);
280 return -(a * (float) Math.pow(2, 10 * (t -= 1)) * (float) Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
281 }
282 }
283
284 /**

Callers

nothing calls this directly

Calls 2

getAmplitudeMethod · 0.80
getPeriodMethod · 0.80

Tested by

no test coverage detected