https://github.com/ltmx/csharp-polynomial-easing-functions
C# Ternary, Quintic, Heptic, Nonic, Hendecic, Smoothing Math Functions
https://github.com/ltmx/csharp-polynomial-easing-functions
csharp functions math math-library mathematics quintic smoothing-functions smoothstep unity unity-mathematics unity3d
Last synced: 3 months ago
JSON representation
C# Ternary, Quintic, Heptic, Nonic, Hendecic, Smoothing Math Functions
- Host: GitHub
- URL: https://github.com/ltmx/csharp-polynomial-easing-functions
- Owner: ltmx
- Created: 2020-07-19T16:05:10.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-13T22:37:28.000Z (about 3 years ago)
- Last Synced: 2025-08-07T20:52:32.724Z (10 months ago)
- Topics: csharp, functions, math, math-library, mathematics, quintic, smoothing-functions, smoothstep, unity, unity-mathematics, unity3d
- Language: C#
- Homepage:
- Size: 355 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C# Polynomial Easing Functions
C# cubic (smoothstep), Quintic (degree 5), Heptic (degree 7), Nonic (degree 9), Hendecic (degree 11)
Easing Math Functions

# Code
Functions and their derivatives
```csharp
public static class Easing
{
static float smoothstep(float x) => x * x * (3 - 2 * x);
static float smoothstepD(float x) => 6 * x * (1 - x); // Derivative
static float smoothstep5(float x) => x * x * x * (x * (6 * x - 15) + 10);
static float smoothstep5D(float x) => 30 * x * x * (x * (x - 2) + 1); // Derivative
static float smoothstep7(float x) => x * x * x * x * (x * (x * (-20 * x + 70) - 84) + 35);
static float smootherstep7D(float x) => 140 * x * x * x * (x * (x * (-x + 3) - 3) + 1); // Derivative
static float smoothstep9(float x) => x * x * x * x * x * (x * (x * (x * (70 * x - 315) + 540) - 420) + 126);
static float smoothstep9D(float x) => 630 * x * x * x * x * (x * (x * (x * (x - 4) + 6) - 4) + 1); // Derivative
static float smoothstep11(float x) => x * x * x * x * x * x * (x * (x * (x * (x * (-252 * x + 1386) - 3080) + 3465) - 1980) + 462);
static float smoothstep11D(float x) => 2772 * x * x * x * x * x * (x * (x * (x * (x * (-x + 5) - 10) + 10) - 5) + 1); // Derivative
}
```