Module: Moon::Easing::QuadraticInOut

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

Class Method Summary collapse

Class Method Details

.call(k) ⇒ Object


23
24
25
26
27
28
29
# File 'lib/moon/packages/std/animation/easing.rb', line 23

def self.call(k)
  if (k *= 2) < 1
    0.5 * k * k
  else
    -0.5 * ((k-=1) * (k - 2) - 1)
  end
end