Skip to main content

A collection of the basic easing functions for python

Project description


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 :

pip install easing-functions

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)
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))


Some Examples:

Cubic Ease Bounce Ease Back Ease

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for easing-functions, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size easing_functions-1.0.4-py3-none-any.whl (15.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size easing_functions-1.0.4.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page