Module: Tween::Quad::InOut

Defined in:
lib/tween.rb

Class Method Summary collapse

Class Method Details

.ease(t, st, ch, d) ⇒ Object



242
243
244
245
246
247
248
# File 'lib/tween.rb', line 242

def self.ease(t, st, ch, d)
  if (t /= d / 2.0) < 1
    ch / 2.0 * t * t + st
  else
    -ch / 2.0 * ((t -= 1) * (t - 2) - 1) + st
  end
end