Module: Tween::Back::InOut

Defined in:
lib/tween.rb

Class Method Summary collapse

Class Method Details

.ease(t, st, ch, d, s = 1.70158) ⇒ Object



158
159
160
161
162
163
164
# File 'lib/tween.rb', line 158

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