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 Bézier 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-3.1.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

easings-3.1.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for easings-3.1.1.tar.gz
Algorithm Hash digest
SHA256 b88ec1832657230f1216cc242154ddb7e49f4d489917a96e16c121a06ba72d74
MD5 bbed7a47ed707b625507edd1e70556d3
BLAKE2b-256 08c292ce00c5b22ac7f3f4f0b3722e968b654766137437fe7cec95ad77137d3c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for easings-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19118b7c4c8cfaa30afeac79170eeaa1cd4c18e0beeb4c597729e4e90f25882c
MD5 79d9aa5d230df7287c141a835350fc13
BLAKE2b-256 0c79b1a53413fc98c6aabd7004de2710f0495c0433aaf8d65bccc41a31a88ccd

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