python的基本宽松函数集合

easing-functions的Python项目详细描述


放松功能

penner为python编写的宽松函数的集合

该系列包括以下Ease In/Ease Out和Ease InOut:

Quadratic (Quad), Cubic, Quartic, Quintic, Sine, Circular, Exponential, Elastic, Back, Bounce, Linear

要安装:

pip install easing-functions

使用:

fromeasing_functionsimport*# For a duration 10 you will get the relevant output from start to enda=QuadEaseInOut(start=0,end=3,duration=10)k=a.ease(4)# 4 is a number between 0 and the duration you specified#k is the returned value from start to end (0 to 3)# example plots:importnumpyasnpimportmatplotlib.pyplotasplta=BounceEaseInOut(start=3,end=1,duration=1)b=BounceEaseIn(start=0,end=1)c=BounceEaseOut(start=0,end=1)x=np.arange(0,1,0.001)y0=list(map(a.ease,x))y1=list(map(b.ease,x))y2=list(map(c.ease,x))plt.plot(x,y0)plt.plot(x,y1)plt.plot(x,y2)

一些示例:

Cubic EaseBounce EaseBack Ease

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
安卓在Java中将字符串连接到“集合”   java在自己的模块上为每个模块运行spring boot单元测试   java如何在不调用join或get的情况下将Collection<CompletableFuture<X>>转换为CompletableFuture<Collection<X>>?   java折叠工具栏布局在滚动时不折叠   java JPA组合主键/外键映射   java如何使用Apache Velocity模板生成自动关闭的XML元素(如果值为null或空)   Java在2D数组中存储输入文件中的数字   java JPA:如何建模映射<String,设置<Object>>(嵌套集合)   用于使用Java查找字符串的windows MapReduce   java将多个方法组合成一个通用方法   java Micronaut嵌套Json输入验证   java在方法中使用类变量   jar构建Java应用程序   JDBC上的java缓存数据   java Play 2.5。x没有绑定到此线程的EntityManager   java密码。getBlockSize()返回128位,即使使用256位密钥也是如此   java如何在Android上显示可用通知声音列表   Java JNI调用的数组开销   java在创建映射和基于特定键获取值时执行HashMap、LinkedHashMap和ConcurrentHashMap的成本