def bouncey(points, alpha): x = AnimationTransition.out_elastic(alpha) x0, y0, x1, y1 = points h = (y1 - y0) * x # tend to correct height, from 0 w = (x1 - x0) * (2 - x) return ( x0 + w * (1 - alpha * alpha), y0, x0 + w * (1 - alpha * alpha) + w, y0, x0 + w * (1 - alpha * alpha) + w, y0 + h, x0 + w * (1 - alpha * alpha), y0 + h, )
def pop_in(points, alpha): x = AnimationTransition.out_elastic(alpha) x0, y0, x1, y1 = points h = (y1 - y0) * x # tend to correct height, from 0 w = (x1 - x0) * x cx = (x0 + x1) / 2 return ( cx - w * .5, y0, cx + w * .5, y0, cx + w * .5, y0 + h, cx - w * .5, y0 + h, )