Module: Moon::Easing::CubicInOut

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

Class Method Summary collapse

Class Method Details

.call(k) ⇒ Object


45
46
47
48
49
50
51
# File 'lib/moon/packages/std/animation/easing.rb', line 45

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