easeOutExpo = (t, b, c, d) ->
if t is d then b + c else c * (-Math.pow(2, -10 * t / d) + 1) + b
now = +new Date
step = ->
t = +new Date - now # 現在秒 (現在
b = 0 # 最初の値
c = 100 # 変動する値
d = 2000 # 何秒かけて動くか
v = easeOutExpo(t, b, c, d)
console.log v
setTimeout (-> step()), 1000 / 60 if d > t
step()
※ Cの変化量とは
例えば、x1(座標が10)からx2(座標が100)に移動する場合cは90となる。
つまり変化の総量である。