Module: Moon::Easing::BackInOut

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

Class Method Summary collapse

Class Method Details

.call(k) ⇒ Object


245
246
247
248
249
250
251
252
# File 'lib/moon/packages/std/animation/easing.rb', line 245

def self.call(k)
  s = 1.70158 * 1.525;
  if ((k *= 2) < 1)
    0.5 * (k * k * ((s + 1) * k - s))
  else
    0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2)
  end
end