Module: Moon::Easing::BounceOut

Defined in:
lib/moon/packages/std/animation/easing.rb

Class Method Summary collapse

Class Method Details

.call(k) ⇒ Object


256
257
258
259
260
261
262
263
264
265
266
# File 'lib/moon/packages/std/animation/easing.rb', line 256

def self.call(k)
  if k < (1 / 2.75)
    7.5625 * k * k;
  elsif k < (2 / 2.75)
    7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;
  elsif k < (2.5 / 2.75)
    7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;
  else
    7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;
  end
end