https://github.com/semitable/easing-functions
A collection of Penner's easing functions for Python
https://github.com/semitable/easing-functions
animation easing easing-functions functions interpolation library penner penner-easing-functions python
Last synced: 3 months ago
JSON representation
A collection of Penner's easing functions for Python
- Host: GitHub
- URL: https://github.com/semitable/easing-functions
- Owner: semitable
- License: gpl-3.0
- Created: 2017-03-20T20:40:22.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-07-05T08:26:51.000Z (over 3 years ago)
- Last Synced: 2025-09-27T20:13:27.495Z (3 months ago)
- Topics: animation, easing, easing-functions, functions, interpolation, library, penner, penner-easing-functions, python
- Language: Python
- Homepage:
- Size: 85.9 KB
- Stars: 132
- Watchers: 8
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# easing-functions
A collection of Penner's easing functions for Python
The collection includes the following ease in/ease out and ease inout:
```
Quadratic (Quad), Cubic, Quartic, Quintic, Sine, Circular, Exponential, Elastic, Back, Bounce, Linear
```
# To install :
```shell
pip install easing-functions
```
# To use:
```python
from easing_functions import *
# For a duration 10 you will get the relevant output from start to end
a = 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)
k2 = a(4) # the ease object can also be called directly, like a function
# example plots:
import numpy as np
import matplotlib.pyplot as plt
a = 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, x))
y1 = list(map(b, x))
y2 = list(map(c, x))
plt.plot(x,y0)
plt.plot(x,y1)
plt.plot(x,y2)
```
# Some Examples:


