PHPackages                             smnandre/easing-functions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. smnandre/easing-functions

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

smnandre/easing-functions
=========================

Easing &amp; Timing Functions - Cubic-Bezier, EaseIn, Quad ...

v1.1.0(1y ago)333MITPHPPHP &gt;=8.3CI passing

Since Jan 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/smnandre/easing-functions)[ Packagist](https://packagist.org/packages/smnandre/easing-functions)[ GitHub Sponsors](https://github.com/smnandre)[ RSS](/packages/smnandre-easing-functions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Easing &amp; Timing PHP Functions
=================================

[](#easing--timing-php-functions)

[![Easing Functions](./easing-functions.svg)](./easing-functions.svg)

```
composer require smnandre/easing-functions
```

[![PHP Version](https://camo.githubusercontent.com/b70c5d640e4c5368ff55b55a6cd756d72a500a6e32ab31c74ceea9931026b857/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2543322541307068702d253345253344253230382e332d3737374242342e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://github.com/smnandre/easing-functions/blob/main/composer.json)[![CI](https://github.com/smnandre/easing-functions/actions/workflows/CI.yaml/badge.svg)](https://github.com/smnandre/easing-functions/actions)[![Release](https://camo.githubusercontent.com/84b01a5af858ae1ba5ff8e8978706e913354a4b654c275031644574ccecd8fb0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f736d6e616e6472652f656173696e672d66756e6374696f6e73)](https://github.com/smnandre/easing-functions/releases)[![License](https://camo.githubusercontent.com/51d72866160e33fd7388a791a7d1c339f3c50fdc9f6e2004f409b5118bf74935/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736d6e616e6472652f656173696e672d66756e6374696f6e733f636f6c6f723d636336376666)](https://github.com/smnandre/easing-functions/blob/main/LICENSE)[![Codecov](https://camo.githubusercontent.com/112187908826c4260776faec3ec5e100912fc2f6f9799b4d21d6aa383a019050/68747470733a2f2f636f6465636f762e696f2f67682f736d6e616e6472652f656173696e672d66756e6374696f6e732f67726170682f62616467652e7376673f746f6b656e3d5243385a364634535043)](https://codecov.io/gh/smnandre/easing-functions)

---

**EasingFunctions** is a **PHP library** that provides a collection of easing functions commonly used in animations, transitions, and smooth interpolations.

It includes standard easing equations: quadratic, cubic, quartic, quintic, sine, exponential, circular, elastic, and bounce functions.

Each of them is available in three variations:

- **In**: The motion starts slowly and accelerates.
- **Out**: The motion starts quickly and decelerates.
- **InOut**: A combination of both, accelerating at the start and decelerating at the end.

Easing Functions
----------------

[](#easing-functions)

xInOutInOutCubic[![Ease In Cubic](img/easeInCubic.svg)](img/easeInCubic.svg)
 `easeInCubic`[![Ease Out Cubic](img/easeOutCubic.svg)](img/easeOutCubic.svg)
 `easeOutCubic`[![Ease InOut Cubic](img/easeInOutCubic.svg)](img/easeInOutCubic.svg)
 `easeInOutCubic`Quart[![Ease In Quart](img/easeInQuart.svg)](img/easeInQuart.svg)
 `easeInQuart`[![Ease Out Quart](img/easeOutQuart.svg)](img/easeOutQuart.svg)
 `easeOutQuart`[![Ease InOut Quart](img/easeInOutQuart.svg)](img/easeInOutQuart.svg)
 `easeInOutQuart`Quad[![Ease In Quad](img/easeInQuad.svg)](img/easeInQuad.svg)
 `easeInQuad`[![Ease Out Quad](img/easeOutQuad.svg)](img/easeOutQuad.svg)
 `easeOutQuad`[![Ease InOut Quad](img/easeInOutQuad.svg)](img/easeInOutQuad.svg)
 `easeInOutQuad`Quint[![Ease In Quint](img/easeInQuint.svg)](img/easeInQuint.svg)
 `easeInQuint`[![Ease Out Quint](img/easeOutQuint.svg)](img/easeOutQuint.svg)
 `easeOutQuint`[![Ease InOut Quint](img/easeInOutQuint.svg)](img/easeInOutQuint.svg)
 `easeInOutQuint`Sine[![Ease In Sine](img/easeInSine.svg)](img/easeInSine.svg)
 `easeInSine`[![Ease Out Sine](img/easeOutSine.svg)](img/easeOutSine.svg)
 `easeOutSine`[![Ease InOut Sine](img/easeInOutSine.svg)](img/easeInOutSine.svg)
 `easeInOutSine`Expo[![Ease In Expo](img/easeInExpo.svg)](img/easeInExpo.svg)
 `easeInExpo`[![Ease Out Expo](img/easeOutExpo.svg)](img/easeOutExpo.svg)
 `easeOutExpo`[![Ease InOut Expo](img/easeInOutExpo.svg)](img/easeInOutExpo.svg)
 `easeInOutExpo`Circ[![Ease In Circ](img/easeInCirc.svg)](img/easeInCirc.svg)
 `easeInCirc`[![Ease Out Circ](img/easeOutCirc.svg)](img/easeOutCirc.svg)
 `easeOutCirc`[![Ease InOut Circ](img/easeInOutCirc.svg)](img/easeInOutCirc.svg)
 `easeInOutCirc`Back[![Ease In Back](img/easeInBack.svg)](img/easeInBack.svg)
 `easeInBack`[![Ease Out Back](img/easeOutBack.svg)](img/easeOutBack.svg)
 `easeOutBack`[![Ease InOut Back](img/easeInOutBack.svg)](img/easeInOutBack.svg)
 `easeInOutBack`Bounce[![Ease In Bounce](img/easeInBounce.svg)](img/easeInBounce.svg)
 `easeInBounce`[![Ease Out Bounce](img/easeOutBounce.svg)](img/easeOutBounce.svg)
 `easeOutBounce`[![Ease InOut Bounce](img/easeInOutBounce.svg)](img/easeInOutBounce.svg)
 `easeInOutBounce`Elastic[![Ease In Elastic](img/easeInElastic.svg)](img/easeInElastic.svg)
 `easeInElastic`[![Ease Out Elastic](img/easeOutElastic.svg)](img/easeOutElastic.svg)
 `easeOutElastic`[![Ease InOut Elastic](img/easeInOutElastic.svg)](img/easeInOutElastic.svg)
 `easeInOutElastic`Installation
------------

[](#installation)

```
composer require smnandre/easing-functions
```

Usage
-----

[](#usage)

```
Easing\Functions::easeOutCubic(0);
// 0
Easing\Functions::easeOutCubic(0.5);
// 0.875

$values = array_map(Easing\Functions::easeOutCubic(...), range(0, 1, 0.1));
echo implode(" ", $values);
// 0 0.271 0.488 0.657 0.784 0.875 0.936 0.973 0.992 0.999 1
```

Functions
---------

[](#functions)

### Easing Functions

[](#easing-functions-1)

NameFormulaePreview`easeOutCubic`$1 - pow(1 - x, 3)$[![easeOutCubic PHP](img/easeOutCubic_line.svg)](img/easeOutCubic_line.svg)`easeInOutCubic`$x &amp;lt; 0.5 ? 4 \* pow(x, 3) : 1 - pow(-2 \* x + 2, 3) / 2$[![easeInOutCubic PHP](img/easeInOutCubic_line.svg)](img/easeInOutCubic_line.svg)`easeInQuart`$pow(x, 4)$[![easeInQuart PHP](img/easeInQuart_line.svg)](img/easeInQuart_line.svg)`easeOutQuart`$1 - pow(1 - x, 4)$[![easeOutQuart PHP](img/easeOutQuart_line.svg)](img/easeOutQuart_line.svg)`easeInOutQuart`$x &amp;lt; 0.5 ? 8 \* pow(x, 4) : 1 - pow(-2 \* x + 2, 4) / 2$[![easeInOutQuart PHP](img/easeInOutQuart_line.svg)](img/easeInOutQuart_line.svg)`easeInCubic`$pow(x, 3)$[![easeInCubic PHP](img/easeInCubic_line.svg)](img/easeInCubic_line.svg)`easeInQuad`$x \* x$[![easeInQuad PHP](img/easeInQuad_line.svg)](img/easeInQuad_line.svg)`easeOutQuad`$1 - (1 - x) \* (1 - x)$[![easeOutQuad PHP](img/easeOutQuad_line.svg)](img/easeOutQuad_line.svg)`easeInOutQuad`$x &amp;lt; 0.5 ? 2 \* x \* x : 1 - pow(-2 \* x + 2, 2) / 2$[![easeInOutQuad PHP](img/easeInOutQuad_line.svg)](img/easeInOutQuad_line.svg)`easeInQuint`$pow(x, 5)$[![easeInQuint PHP](img/easeInQuint_line.svg)](img/easeInQuint_line.svg)`easeOutQuint`$1 - pow(1 - x, 5)$[![easeOutQuint PHP](img/easeOutQuint_line.svg)](img/easeOutQuint_line.svg)`easeInOutQuint`$x &amp;lt; 0.5 ? 16 \* pow(x, 5) : 1 - pow(-2 \* x + 2, 5) / 2$[![easeInOutQuint PHP](img/easeInOutQuint_line.svg)](img/easeInOutQuint_line.svg)`easeInSine`$1 - cos((x \* pi()) / 2)$[![easeInSine PHP](img/easeInSine_line.svg)](img/easeInSine_line.svg)`easeOutSine`$sin((x \* pi()) / 2)$[![easeOutSine PHP](img/easeOutSine_line.svg)](img/easeOutSine_line.svg)`easeInOutSine`$-(cos(pi() \* x) - 1) / 2$[![easeInOutSine PHP](img/easeInOutSine_line.svg)](img/easeInOutSine_line.svg)`easeInExpo`$x == 0 ? 0 : pow(2, 10 \* x - 10)$[![easeInExpo PHP](img/easeInExpo_line.svg)](img/easeInExpo_line.svg)`easeOutExpo`$x == 1 ? 1 : 1 - pow(2, -10 \* x)$[![easeOutExpo PHP](img/easeOutExpo_line.svg)](img/easeOutExpo_line.svg)`easeInOutExpo`$x == 0 ? 0 : x == 1 ? 1 : x &amp;lt; 0.5 ? pow(2, 20 \* x - 10) / 2 : (2 - pow(2, -20 \* x + 10)) / 2$[![easeInOutExpo PHP](img/easeInOutExpo_line.svg)](img/easeInOutExpo_line.svg)`easeInCirc`$1 - sqrt(1 - pow(x, 2))$[![easeInCirc PHP](img/easeInCirc_line.svg)](img/easeInCirc_line.svg)`easeOutCirc`$sqrt(1 - pow(x - 1, 2))$[![easeOutCirc PHP](img/easeOutCirc_line.svg)](img/easeOutCirc_line.svg)`easeInOutCirc`$x &amp;lt; 0.5 ? (1 - sqrt(1 - pow(2 \* x, 2))) / 2 : (sqrt(1 - pow(-2 \* x + 2, 2)) + 1) / 2$[![easeInOutCirc PHP](img/easeInOutCirc_line.svg)](img/easeInOutCirc_line.svg)`easeInBack`$2.70158 \* pow(x, 3) - 1.70158 \* pow(x, 2)$[![easeInBack PHP](img/easeInBack_line.svg)](img/easeInBack_line.svg)`easeOutBack`$1 + 2.70158 \* pow(x - 1, 3) + 1.70158 \* pow(x - 1, 2)$[![easeOutBack PHP](img/easeOutBack_line.svg)](img/easeOutBack_line.svg)`easeInOutBack`$x &amp;lt; 0.5 ? (pow(2 \* x, 2) \* ((3.59258 \* 2 \* x) - 2.59258)) / 2 : (pow(2 \* x - 2, 2) \* ((3.59258 \* (x \* 2 - 2)) + 2.59258) + 2) / 2$[![easeInOutBack PHP](img/easeInOutBack_line.svg)](img/easeInOutBack_line.svg)`easeInBounce`$1 - easeOutBounce(1 - x)$[![easeInBounce PHP](img/easeInBounce_line.svg)](img/easeInBounce_line.svg)`easeOutBounce`See `bounceOut` function[![easeOutBounce PHP](img/easeOutBounce_line.svg)](img/easeOutBounce_line.svg)`easeInOutBounce`$x &amp;lt; 0.5 ? (1 - easeOutBounce(1 - 2 \* x)) / 2 : (1 + easeOutBounce(2 \* x - 1)) / 2$[![easeInOutBounce PHP](img/easeInOutBounce_line.svg)](img/easeInOutBounce_line.svg)`easeInElastic`$x == 0 ? 0 : x == 1 ? 1 : -pow(2, 10 \* x - 10) \* sin((x \* 10 - 10.75) \* ((2 \* pi()) / 3))$[![easeInElastic PHP](img/easeInElastic_line.svg)](img/easeInElastic_line.svg)`easeOutElastic`$x == 0 ? 0 : x == 1 ? 1 : pow(2, -10 \* x) \* sin((x \* 10 - 0.75) \* ((2 \* pi()) / 3)) + 1$[![easeOutElastic PHP](img/easeOutElastic_line.svg)](img/easeOutElastic_line.svg)`easeInOutElastic`$x == 0 ? 0 : x == 1 ? 1 : x &amp;lt; 0.5 ? -(pow(2, 20 \* x - 10) \* sin((20 \* x - 11.125) \* ((2 \* pi()) / 4.5))) / 2 : (pow(2, -20 \* x + 10) \* sin((20 \* x - 11.125) \* ((2 \* pi()) / 4.5))) / 2 + 1$[![easeInOutElastic PHP](img/easeInOutElastic_line.svg)](img/easeInOutElastic_line.svg)License
-------

[](#license)

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance43

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Total

2

Last Release

461d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a8951d49b371d210280a58ce48969a07d1f49924810f8a1fab3a9343eb46fdc9?d=identicon)[simonandre](/maintainers/simonandre)

---

Top Contributors

[![smnandre](https://avatars.githubusercontent.com/u/1359581?v=4)](https://github.com/smnandre "smnandre (7 commits)")[![raphael-geffroy](https://avatars.githubusercontent.com/u/81738559?v=4)](https://github.com/raphael-geffroy "raphael-geffroy (1 commits)")[![silasjoisten](https://avatars.githubusercontent.com/u/10114981?v=4)](https://github.com/silasjoisten "silasjoisten (1 commits)")

---

Tags

animationcubic-beziereaseinouteasingeasing-functionsfunctionno-depsphpphp-librarysvgtimingtransitiontransitionanimationfunctionstiminglinearinterpolationeasingcubic-bezierease-inease-outease-in-out

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/smnandre-easing-functions/health.svg)

```
[![Health](https://phpackages.com/badges/smnandre-easing-functions/health.svg)](https://phpackages.com/packages/smnandre-easing-functions)
```

###  Alternatives

[symfony/workflow

Provides tools for managing a workflow or finite state machine

62942.3M170](/packages/symfony-workflow)[yohang/finite

A simple PHP Finite State Machine

1.3k3.5M10](/packages/yohang-finite)[flesler/jquery.scrollto

Lightweight, cross-browser and highly customizable animated scrolling with jQuery

3.7k40.1k](/packages/flesler-jqueryscrollto)[maciejczyzewski/bottomline

A full-on PHP manipulation utility belt that provides support for working with arrays, objects, and iterables; a lodash or underscore equivalent for PHP.

477631.4k10](/packages/maciejczyzewski-bottomline)[ilya/belt

A handful of tools for PHP developers.

71020.8k1](/packages/ilya-belt)[illuminated/helper-functions

Laravel-specific and pure PHP Helper Functions.

107586.6k7](/packages/illuminated-helper-functions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
