Skip to main content

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

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)

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

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.

Source Distribution

easing_functions-1.0.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easing_functions-1.0.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file easing_functions-1.0.2.tar.gz.

File metadata

  • Download URL: easing_functions-1.0.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.0

File hashes

Hashes for easing_functions-1.0.2.tar.gz
Algorithm Hash digest
SHA256 efbca89f02c13398e58ff603893952d20fa6947f644ea0c720467899ea28e754
MD5 83711736ab058eea3d35f6259a6256f1
BLAKE2b-256 af2847f1fb86b1ab04d70516558520d470890f73cc77ae1b3059b32d35190abe

See more details on using hashes here.

File details

Details for the file easing_functions-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: easing_functions-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.0

File hashes

Hashes for easing_functions-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6456bae7b41ebb8fe1e3bd9343db9d71fb70fed117a050b77630b9f42eb96d40
MD5 8994dee4ac76d2c28af740fbee52b473
BLAKE2b-256 c30a202793b609afed620ab84fc783b606b9694b7fad21d87409bb53e1259842

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page