Пример #1
0
    def easeInOut(t, b, c, d, aa, bb):
        s = 1.70158
        p = 0
        a = c
        if t == 0:
            return b

        t /= d/2
        if t == 2:
            return b + c

        if not p:
            p = d * (.3 * 1.5)

        if a < abs(c):
            a = c
            s = p/4
        else:
            s = p/(2*Math.PI) * Math.asin(c/a)


        if t < 1:
            t -= 1
            return -a/2 *Math.pow(2, 10*t) * Math.sin((t*d - s)*(2*Math.PI) / p) + b

        t -= 1
        return a * Math.pow(2, -10*t) * Math.sin((t*d - s)*(2*Math.PI) / p) * .5 + c + b
Пример #2
0
    def easeOut(t, b, c, d, aa, bb):
        s = 1.70158
        p = 0
        a = c
        if t == 0:
            return b

        t /= d
        if t == 1:
            return b + c

        if not p:
            p = d * .3

        if a < abs(c):
            a = c
            s = p/4
        else:
            s = p/(2*Math.PI) * Math.asin(c/a)

        return a * Math.pow(2, -10*t) * Math.sin((t*d-s)*(2*Math.PI) / p) + c + b
Пример #3
0
 def easeInOut(t, b, c, d, aa, bb):
     t /= d/2
     if t < 1:
         return c/2 * Math.pow(2, 10 * (t - 1)) + b
     t -= 1
     return c/2 * (-Math.pow(2, -10 * t) + 2) + b
Пример #4
0
 def easeOut(t, b, c, d, aa, bb):
     return c * (-Math.pow(2, -10 * t/d) + 1) + b
Пример #5
0
 def easeIn(t, b, c, d, aa, bb):
     return c * Math.pow(2, 10 * (t/d - 1)) + b