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第三方库


热门话题
Spring引导应用程序中的java循环视图路径异常   java在PreferenceActivity中显示ProgressDialog   java RESTEasy如何将基本身份验证设置为ClientRequest   使用MongoDB进行java漏斗分析?   java JUnit系统日期   java创建一个集合,每个类有一个对象   java如何在子模块项目中测试Springbean   java Websocket服务器Android   javaitext:如何在新页面上重复表单元格内容?   java一旦spring mvc样板项目建立起来,python/RoR的开发速度会更快吗?   java为什么Maven Tycho不能在工具链中找到正确的JDK。xml?   Java Selenium获取用于单击的元素   java如何使用嵌套的if语句而不是系统阻止程序在blueprint类中运行。出口(0);?   java模板聚合匹配和投影一个没有id的字段   java您的内容必须有一个id属性为“安卓”的TabHost。安卓应用程序的R.id.tabhost错误   JavaEclipseLink 1.2和BatchFetch   java如何更改HttpClient中的超时值?   java在toString方法中将对象转换为特定数据类型   java正在跳过运行for循环