Skip to main content

Customizable Optimized Easing Functions for Python

Project description

Easings

Description

Customizable Optimized Easing Functions 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.0.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.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: easings-3.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8cbbefd6c00f3eec54d69997968ed4ad93080043b963a58ebd9f33d731e998e6
MD5 5d61ae5e333f5bb7dd533a1d006bde07
BLAKE2b-256 53a46ed821825d7d7943ceaa3cf8d895e2f1d69ad6be6c5e52355a04fb6d062e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: easings-3.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99ef2c492606b233faef68d8ee65a91d242a860f2b1235d8cd7db0bfe49f7a59
MD5 5552b5df35d677cf9e47dca22eb398d2
BLAKE2b-256 22db87c389d401b9059d218b6a7ccc6dcaf1bba4e62089627bf9aceffd9c21cc

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