Created
March 13, 2018 02:04
-
-
Save aneasystone/8a0d1c2d4e9fe3c0adf350b774056123 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Created by aneasystone on 2018/3/13 | |
import pylab as pl | |
# https://github.com/gdsmith/jquery.easing/blob/master/jquery.easing.js | |
def ease_in_quad(x): | |
return x * x | |
def ease_out_quad(x): | |
return 1 - (1 - x) * (1 - x) | |
def get_tracks(ease_func): | |
ts = [] | |
if ease_func in globals(): | |
ease = globals()[ease_func] | |
for i in range(100): | |
ts.append(ease(i/100.0)) | |
return ts | |
tracks = get_tracks('ease_out_quad') | |
print(tracks) | |
plot2 = pl.plot(range(len(tracks)), tracks, 'r') | |
pl.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment