Module: Moon::Easing::CircularInOut

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

Class Method Summary collapse

Class Method Details

.call(k) ⇒ Object


155
156
157
158
159
160
161
# File 'lib/moon/packages/std/animation/easing.rb', line 155

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