Skip to main content

Customizable Optimized Easing Functions for Python

Project description

Easings

Description

Customizable Optimized Library for Easing, Interpolation, Curves and Splines for Python.

Installation

pip install easings

Usage

Ease values between 0 and 1:

import easings

progress = easings.back_in_out(
    progress = 0.5,
    bounce_const = easings.both_back_consts[0.1]
)

print(progress)

Easing values with a start and end value using an Easer

import easings

easer = easings.Easer(4, 12)

value = easer.value(easings.poly_in_out, 0.5, 2)

print(value)

Using a Bezier curve

import numpy as np

import easings

points = np.array([[0, 0], [1, 2], [3, 3], [4, 0]])

curve = easings.curves.Bezier(points)

print(curve.point(0.4))

Using a Catmull-Rom spline

import numpy as np

import easings

points = np.array([[0, 0], [1, 2], [2, 4], [3, 3], [4, 1], [5, 2], [6, 0], [7, -1], [8, 1], [9, 3], [10, 2]])

spline = easings.splines.Catmull(points)

print(spline.point(1.2))

License

CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.

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

easings-4.1.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

easings-4.1.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file easings-4.1.2.tar.gz.

File metadata

  • Download URL: easings-4.1.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for easings-4.1.2.tar.gz
Algorithm Hash digest
SHA256 946049f4611407ee6014709562ecee4287e3ff093a7c11c8302da375162ece4e
MD5 a5d0cb30280c41ef429ccd7ba6aa883a
BLAKE2b-256 517e33ba24b4915b8782b18a1779022ea7d24c82226ca317a6e70805e299159a

See more details on using hashes here.

File details

Details for the file easings-4.1.2-py3-none-any.whl.

File metadata

  • Download URL: easings-4.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for easings-4.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7bdc2c39254bf4c424cbde00a334851112ff0e7811597a9dc6ce8f9bc6349cc4
MD5 93f66beec648e1340081e898d48f454f
BLAKE2b-256 3d5dbd490ae45ed85a415d20bc7b10fdc645d6037f5172bc83c633a4fbad9a0a

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