Module: Tween::Bounce::Out

Defined in:
lib/tween.rb

Class Method Summary collapse

Class Method Details

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



114
115
116
117
118
119
120
121
122
123
124
# File 'lib/tween.rb', line 114

def self.ease(t, st, ch, d)
  if (t /= d) < (1/2.75)
    ch * (7.5625 * t * t) + st
  elsif t < (2 / 2.75)
    ch * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75) + st
  elsif t < (2.5 / 2.75)
    ch * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375) + st
  else
    ch * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375) + st
  end
end