A collection of the basic easing functions for python
Project description
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
Some Examples:
To use:
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)
# 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.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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
easing_functions-1.0.1.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for easing_functions-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7477aecd495466d69cb0735c05b94e1d0afbbf017fa3c2de36e563234c9ff0fc |
|
MD5 | 68824413635d4868dc94e2458e727470 |
|
BLAKE2b-256 | f566c97acaa0d91a28379f1fca649613d81c4e243385ed83cf3d1748ba2c68c4 |