Easing procedures used for animations. Inverse easing procedures These are the mathematical inverses of the corresponding easing functions, allowing you to reverse the transformation: if y = ease_fn(x), then x = ease_fn_inverse(y) + some_imprecision Flux easing used for animations

Collection Info

View Source
Collection
core
Path
math/ease
Entries
64

Source Files

Types

3

Procedures

61

back_in #

Source
@(require_results)
back_in :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the overshooting cubic y = x^3-x*sin(x*pi)

back_in_out #

Source
@(require_results)
back_in_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the piecewise overshooting cubic function: y = (1/2)*((2x)^3-(2x)*sin(2*x*pi)) ; [0, 0.5) y = (1/2)*(1-((1-x)^3-(1-x)*sin((1-x)*pi))+1) ; [0.5, 1]

back_out #

Source
@(require_results)
back_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after overshooting cubic y = 1-((1-x)^3-(1-x)*sin((1-x)*pi))

bounce_in #

Source
@(require_results)
bounce_in :: proc "contextless" (p: $T) -> $$deferred_return {…}

bounce_in_out #

Source
@(require_results)
bounce_in_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

bounce_out #

Source
@(require_results)
bounce_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

circular_in #

Source
@(require_results)
circular_in :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after shifted quadrant IV of unit circle

circular_in_inverse #

Source
@(require_results)
circular_in_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of circular_in x = sqrt(2y - y²)

circular_in_out #

Source
@(require_results)
circular_in_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the piecewise circular function y = (1/2)(1 - sqrt(1 - 4x^2)) ; [0, 0.5) y = (1/2)(sqrt(-(2x - 3)*(2x - 1)) + 1) ; [0.5, 1]

circular_in_out_inverse #

Source
@(require_results)
circular_in_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of circular_in_out x = sqrt(1 - (1-2y)²) / 2 ; [0, 0.5) x = 1 - sqrt(1 - (2y-1)²) / 2 ; [0.5, 1]

circular_out #

Source
@(require_results)
circular_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after shifted quadrant II of unit circle

circular_out_inverse #

Source
@(require_results)
circular_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of circular_out x = 1 - sqrt(1 - y²)

cubic_in #

Source
@(require_results)
cubic_in :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the cubic y = x^3

cubic_in_inverse #

Source
@(require_results)
cubic_in_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of cubic_in x = y^(1/3)

cubic_in_out #

Source
@(require_results)
cubic_in_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the piecewise cubic y = (1/2)((2x)^3) ; [0, 0.5) y = (1/2)((2x-2)^3 + 2) ; [0.5, 1]

cubic_in_out_inverse #

Source
@(require_results)
cubic_in_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of cubic_in_out x = (y/4)^(1/3) ; [0, 0.5) x = ((y-1)*2)^(1/3)/2 + 1 ; [0.5, 1]

cubic_out #

Source
@(require_results)
cubic_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the cubic y = (x - 1)^3 + 1

cubic_out_inverse #

Source
@(require_results)
cubic_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of cubic_out x = (y - 1)^(1/3) + 1

ease #

Source
@(require_results)
ease :: proc "contextless" (type: Ease, p: $T) -> $$deferred_return {…}

ease_inverse #

Source
@(require_results)
ease_inverse :: proc "contextless" (type: Ease, p: $T) -> $$deferred_return {…}

elastic_in #

Source
@(require_results)
elastic_in :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the damped sine wave y = sin(13pi/2*x)*pow(2, 10 * (x - 1))

elastic_in_out #

Source
@(require_results)
elastic_in_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the piecewise exponentially-damped sine wave: y = (1/2)*sin(13pi/2*(2*x))*pow(2, 10 * ((2*x) - 1)) ; [0,0.5) y = (1/2)*(sin(-13pi/2*((2x-1)+1))*pow(2,-10(2*x-1)) + 2) ; [0.5, 1]

elastic_out #

Source
@(require_results)
elastic_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the damped sine wave y = sin(-13pi/2*(x + 1))*pow(2, -10x) + 1

exponential_in #

Source
@(require_results)
exponential_in :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the exponential function y = 2^(10(x - 1))

exponential_in_inverse #

Source
@(require_results)
exponential_in_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of exponential_in x = log₂(y) / 10 + 1

exponential_in_out #

Source
@(require_results)
exponential_in_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the piecewise exponential y = (1/2)2^(10(2x - 1)) ; [0,0.5) y = -(1/2)*2^(-10(2x - 1))) + 1 ; [0.5,1]

exponential_in_out_inverse #

Source
@(require_results)
exponential_in_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of exponential_in_out x = (log₂(2y) + 10) / 20 ; [0, 0.5) x = (10 - log₂(2(1-y))) / 20 ; [0.5, 1]

exponential_out #

Source
@(require_results)
exponential_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the exponential function y = -2^(-10x) + 1

exponential_out_inverse #

Source
@(require_results)
exponential_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of exponential_out x = -log₂(1 - y) / 10

flux_destroy #

Source
flux_destroy :: proc(flux: Flux_Map($T), allocator := context.allocator, loc := #caller_location) {…}

delete map content

flux_init #

Source
@(require_results)
flux_init :: proc($T: typeid, value_capacity: int = 8, allocator := context.allocator, loc := #caller_location) -> Flux_Map($T=typeid) {…}

init flux map to a float type and a wanted cap

flux_stop #

Source
@(require_results)
flux_stop :: proc(flux: ^Flux_Map($T), key: ^$T) -> bool {…}

stop a specific key inside the map returns true when it successfully removed the key

flux_to #

Source
@(require_results)
flux_to :: proc(
	flux:     ^Flux_Map($T), 
	value:    ^$T, 
	goal:     $T, 
	type:     Ease = .Quadratic_Out, 
	duration: Duration = time.Second, 
	delay:    f64 = 0, 
) -> (tween: $$deferred_return) {…}

append / overwrite existing tween value to parameters rest is initialized in flux_tween_init, inside update return value can be used to set callbacks

flux_tween_time_left #

Source
@(require_results)
flux_tween_time_left :: proc(flux: Flux_Map($T), key: ^$T) -> f64 {…}

returns the amount of time left for the tween animation, if the key exists in the map returns 0 if the tween doesn't exist on the map

flux_update #

Source
flux_update :: proc(flux: ^Flux_Map($T), dt: f64) {…}

update all tweens, wait for their delay if one exists calls callbacks in all stages, when they're filled deletes tween from the map after completion

quadratic_in #

Source
@(require_results)
quadratic_in :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the parabola y = x^2

quadratic_in_inverse #

Source
@(require_results)
quadratic_in_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of quadratic_in x = sqrt(y)

quadratic_in_out #

Source
@(require_results)
quadratic_in_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the piecewise quadratic y = (1/2)((2x)^2) ; [0, 0.5) y = -(1/2)((2x-1)*(2x-3) - 1) ; [0.5, 1]

quadratic_in_out_inverse #

Source
@(require_results)
quadratic_in_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of quadratic_in_out x = sqrt(y/2) ; [0, 0.5) x = 1 - sqrt((1-y)/2) ; [0.5, 1]

quadratic_out #

Source
@(require_results)
quadratic_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the parabola y = -x^2 + 2x

quadratic_out_inverse #

Source
@(require_results)
quadratic_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of quadratic_out x = 1 - sqrt(1 - y)

quartic_in #

Source
@(require_results)
quartic_in :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the quartic x^4

quartic_in_inverse #

Source
@(require_results)
quartic_in_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of quartic_in x = y^(1/4)

quartic_in_out #

Source
@(require_results)
quartic_in_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the piecewise quartic y = (1/2)((2x)^4) ; [0, 0.5) y = -(1/2)((2x-2)^4 - 2) ; [0.5, 1]

quartic_in_out_inverse #

Source
@(require_results)
quartic_in_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of quartic_in_out x = (y/8)^(1/4) ; [0, 0.5) x = 1 - ((1-y)/8)^(1/4) ; [0.5, 1]

quartic_out #

Source
@(require_results)
quartic_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the quartic y = 1 - (x - 1)^4

quartic_out_inverse #

Source
@(require_results)
quartic_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of quartic_out x = 1 - (1 - y)^(1/4)

quintic_in #

Source
@(require_results)
quintic_in :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the quintic y = x^5

quintic_in_inverse #

Source
@(require_results)
quintic_in_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of quintic_in x = y^(1/5)

quintic_in_out #

Source
@(require_results)
quintic_in_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the piecewise quintic y = (1/2)((2x)^5) ; [0, 0.5) y = (1/2)((2x-2)^5 + 2) ; [0.5, 1]

quintic_in_out_inverse #

Source
@(require_results)
quintic_in_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of quintic_in_out x = (y/16)^(1/5) ; [0, 0.5) x = ((y-1)*2)^(1/5)/2 + 1 ; [0.5, 1]

quintic_out #

Source
@(require_results)
quintic_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after the quintic y = (x - 1)^5 + 1

quintic_out_inverse #

Source
@(require_results)
quintic_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of quintic_out x = (y - 1)^(1/5) + 1

sine_in #

Source
@(require_results)
sine_in :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after quarter-cycle of sine wave

sine_in_inverse #

Source
@(require_results)
sine_in_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of sine_in x = asin(y - 1) * 2/π + 1

sine_in_out #

Source
@(require_results)
sine_in_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after half sine wave

sine_in_out_inverse #

Source
@(require_results)
sine_in_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of sine_in_out x = acos(1 - 2y) / π

sine_out #

Source
@(require_results)
sine_out :: proc "contextless" (p: $T) -> $$deferred_return {…}

Modeled after quarter-cycle of sine wave (different phase)

sine_out_inverse #

Source
@(require_results)
sine_out_inverse :: proc "contextless" (p: $T) -> $$deferred_return {…}

Inverse of sine_out x = asin(y) * 2/π