Easing
Auto-generated from
src/stdlib/easing.mcrs— do not edit manually.
API
- ease_linear
- ease_in_quad
- ease_out_quad
- ease_in_out_quad
- ease_in_cubic
- ease_out_cubic
- ease_in_out_cubic
- ease_in_quart
- ease_out_quart
- ease_in_sine
- ease_out_sine
- ease_in_out_sine
- ease_in_expo
- ease_out_expo
- ease_in_back
- ease_out_back
- ease_in_out_back
- ease_out_bounce
- ease_in_bounce
- ease_in_out_bounce
- ease_smooth
- ease_smoother
ease_linear v1.0.0
Linear easing — no acceleration or deceleration.
fn ease_linear(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: t (identity function)
Example
let v: int = ease_linear(5000) // result: 5000 (50%)ease_in_quad v1.0.0
Quadratic ease-in — slow start, fast end.
fn ease_in_quad(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: t² / 10000
Example
let v: int = ease_in_quad(5000) // result: 2500 (25%)ease_out_quad v1.0.0
Quadratic ease-out — fast start, slow end.
fn ease_out_quad(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: 1 - (1-t)²
Example
let v: int = ease_out_quad(5000) // result: 7500 (75%)ease_in_out_quad v1.0.0
Quadratic ease-in-out — slow start and end, fast middle.
fn ease_in_out_quad(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: 2t² for t < 0.5, else 1 - 2*(1-t)²
Example
let v: int = ease_in_out_quad(2500) // result: 1250 (12.5%)ease_in_cubic v1.0.0
Cubic ease-in — slow start, accelerates to fast end (stronger than quadratic).
fn ease_in_cubic(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: t³
Example
let v: int = ease_in_cubic(5000) // result: 1250 (12.5%)ease_out_cubic v1.0.0
Cubic ease-out — fast start, decelerates to slow end.
fn ease_out_cubic(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: 1 - (1-t)³
Example
let v: int = ease_out_cubic(5000) // result: 8750 (87.5%)ease_in_out_cubic v1.0.0
Cubic ease-in-out — slow start and end, fast middle (stronger than quadratic).
fn ease_in_out_cubic(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: 4t³ for t < 0.5, else 1 - 4*(1-t)³
Example
let v: int = ease_in_out_cubic(5000) // result: 5000 (50%)ease_in_quart v1.0.0
Quartic ease-in — very slow start, very fast end (t⁴).
fn ease_in_quart(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: t⁴
Example
let v: int = ease_in_quart(5000) // result: 625 (6.25%)ease_out_quart v1.0.0
Quartic ease-out — very fast start, very slow end (1 - (1-t)⁴).
fn ease_out_quart(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: 1 - (1-t)⁴
Example
let v: int = ease_out_quart(5000) // result: 9375 (93.75%)ease_in_sine v1.0.0
Sinusoidal ease-in — starts slow, accelerates (approximated with polynomial).
fn ease_in_sine(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: Approximate 1 - cos(t*π/2)
Example
let v: int = ease_in_sine(5000) // ≈ 2929 (sin curve at 50%)ease_out_sine v1.0.0
Sinusoidal ease-out — fast start, decelerates gently (approximated).
fn ease_out_sine(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: Approximate sin(t*π/2)
Example
let v: int = ease_out_sine(5000) // ≈ 7071ease_in_out_sine v1.0.0
Sinusoidal ease-in-out — smooth start and end via sine wave.
fn ease_in_out_sine(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: Approximate -(cos(π*t) - 1) / 2
Example
let v: int = ease_in_out_sine(5000) // result: 5000 (symmetrical)ease_in_expo v1.0.0
Exponential ease-in — nearly zero at start, explosive at end.
fn ease_in_expo(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: Approximate 2^(10t-10) (uses cubic proxy)
Example
let v: int = ease_in_expo(8000) // very small until close to the endease_out_expo v1.0.0
Exponential ease-out — explosive start, slows to near-zero at end.
fn ease_out_expo(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: 1 - ease_in_expo(1 - t)
Example
let v: int = ease_out_expo(2000) // large value even earlyease_in_back v1.0.0
Back ease-in — slight pullback before accelerating forward (overshoot anticipation).
fn ease_in_back(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: t³*(c3) - t²*(c1) where c1 ≈ 1.70158 (may briefly go below 0)
Example
let v: int = ease_in_back(2000) // negative briefly, then risesease_out_back v1.0.0
Back ease-out — overshoots target then settles back.
fn ease_out_back(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: Mirrored ease_in_back (may briefly exceed 10000)
Example
let v: int = ease_out_back(8000) // overshoots near the endease_in_out_back v1.0.0
Back ease-in-out — pullback on entry, overshoot on exit.
fn ease_in_out_back(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: Combined back ease, symmetric around t=5000
Example
let v: int = ease_in_out_back(5000) // result: 5000 (midpoint)ease_out_bounce v1.0.0
Bounce ease-out — simulates a ball dropping and bouncing at the end.
fn ease_out_bounce(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: Piecewise bounce curve, always in [0, 10000]
Example
let v: int = ease_out_bounce(8000) // bouncing near the endease_in_bounce v1.0.0
Bounce ease-in — bounces at the start before settling into forward motion.
fn ease_in_bounce(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: Mirrored ease_out_bounce
Example
let v: int = ease_in_bounce(2000) // bouncing at the startease_in_out_bounce v1.0.0
Bounce ease-in-out — bounce on both entry and exit.
fn ease_in_out_bounce(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: Symmetric bounce easing
Example
let v: int = ease_in_out_bounce(5000) // result: 5000 (midpoint)ease_smooth v1.0.0
Smoothstep easing — cubic Hermite curve (3t² - 2t³), smooth start and end.
fn ease_smooth(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: 3t² - 2t³ (Ken Perlin's smooth interpolation)
Example
let v: int = ease_smooth(5000) // result: 5000 (symmetric)ease_smoother v1.0.0
Smootherstep easing — quintic curve (6t⁵ - 15t⁴ + 10t³), zero first and second derivatives at endpoints.
fn ease_smoother(t: int): intParameters
| Parameter | Description |
|---|---|
t | Progress ×10000, range [0, 10000] |
Returns: 6t⁵ - 15t⁴ + 10t³ (Ken Perlin's improved noise smoothstep)
Example
let v: int = ease_smoother(5000) // result: 5000 (symmetric)