package core:math/ease

⌘K
Ctrl+K
or
/

    Types

    Ease ¶

    Ease :: enum int {
    	Linear, 
    	Quadratic_In, 
    	Quadratic_Out, 
    	Quadratic_In_Out, 
    	Cubic_In, 
    	Cubic_Out, 
    	Cubic_In_Out, 
    	Quartic_In, 
    	Quartic_Out, 
    	Quartic_In_Out, 
    	Quintic_In, 
    	Quintic_Out, 
    	Quintic_In_Out, 
    	Sine_In, 
    	Sine_Out, 
    	Sine_In_Out, 
    	Circular_In, 
    	Circular_Out, 
    	Circular_In_Out, 
    	Exponential_In, 
    	Exponential_Out, 
    	Exponential_In_Out, 
    	Elastic_In, 
    	Elastic_Out, 
    	Elastic_In_Out, 
    	Back_In, 
    	Back_Out, 
    	Back_In_Out, 
    	Bounce_In, 
    	Bounce_Out, 
    	Bounce_In_Out, 
    }
    Related Procedures With Parameters

    Flux_Map ¶

    Flux_Map :: struct($T: typeid) {
    	… // See source for fields
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    Flux_Tween ¶

    Flux_Tween :: struct($T: typeid) {
    	… // See source for fields
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    Constants

    This section is empty.

    Variables

    This section is empty.

    Procedures

    back_in ¶

    back_in :: proc "contextless" (p: $T) -> $T {…}
     

    Modeled after the overshooting cubic y = x^3-xsin(xpi)

    back_in_out ¶

    back_in_out :: proc "contextless" (p: $T) -> $T {…}
     

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

    back_out ¶

    back_out :: proc "contextless" (p: $T) -> $T {…}
     

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

    bounce_in ¶

    bounce_in :: proc "contextless" (p: $T) -> $T {…}

    bounce_in_out ¶

    bounce_in_out :: proc "contextless" (p: $T) -> $T {…}

    bounce_out ¶

    bounce_out :: proc "contextless" (p: $T) -> $T {…}

    circular_in ¶

    circular_in :: proc "contextless" (p: $T) -> $T {…}
     

    Modeled after shifted quadrant IV of unit circle

    circular_in_inverse ¶

    circular_in_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    circular_in_out ¶

    circular_in_out :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    circular_in_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    circular_out :: proc "contextless" (p: $T) -> $T {…}
     

    Modeled after shifted quadrant II of unit circle

    circular_out_inverse ¶

    circular_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    cubic_in ¶

    cubic_in :: proc "contextless" (p: $T) -> $T {…}
     

    Modeled after the cubic y = x^3

    cubic_in_inverse ¶

    cubic_in_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    cubic_in_out ¶

    cubic_in_out :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    cubic_in_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    cubic_out :: proc "contextless" (p: $T) -> $T {…}
     

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

    cubic_out_inverse ¶

    cubic_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    ease ¶

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

    ease_inverse ¶

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

    elastic_in ¶

    elastic_in :: proc "contextless" (p: $T) -> $T {…}
     

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

    elastic_in_out ¶

    elastic_in_out :: proc "contextless" (p: $T) -> $T {…}
     

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

    elastic_out ¶

    elastic_out :: proc "contextless" (p: $T) -> $T {…}
     

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

    exponential_in ¶

    exponential_in :: proc "contextless" (p: $T) -> $T {…}
     

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

    exponential_in_inverse ¶

    exponential_in_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    exponential_in_out ¶

    exponential_in_out :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    exponential_in_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    exponential_out :: proc "contextless" (p: $T) -> $T {…}
     

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

    exponential_out_inverse ¶

    exponential_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    flux_clear ¶

    flux_clear :: proc(flux: ^Flux_Map($T)) {…}
     

    clear map content, stops all animations

    flux_destroy ¶

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

    delete map content

    flux_init ¶

    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 ¶

    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 ¶

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

    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_init ¶

    flux_tween_init :: proc(tween: ^Flux_Tween($T), duration: time.Duration) {…}
     

    init internal properties

    flux_tween_time_left ¶

    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 ¶

    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 ¶

    quadratic_in :: proc "contextless" (p: $T) -> $T {…}
     

    Modeled after the parabola y = x^2

    quadratic_in_inverse ¶

    quadratic_in_inverse :: proc "contextless" (p: $T) -> $T {…}
     

    Inverse of quadratic_in x = sqrt(y)

    quadratic_in_out ¶

    quadratic_in_out :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    quadratic_in_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    quadratic_out ¶

    quadratic_out :: proc "contextless" (p: $T) -> $T {…}
     

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

    quadratic_out_inverse ¶

    quadratic_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    quartic_in ¶

    quartic_in :: proc "contextless" (p: $T) -> $T {…}
     

    Modeled after the quartic x^4

    quartic_in_inverse ¶

    quartic_in_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    quartic_in_out ¶

    quartic_in_out :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    quartic_in_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    quartic_out :: proc "contextless" (p: $T) -> $T {…}
     

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

    quartic_out_inverse ¶

    quartic_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    quintic_in ¶

    quintic_in :: proc "contextless" (p: $T) -> $T {…}
     

    Modeled after the quintic y = x^5

    quintic_in_inverse ¶

    quintic_in_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    quintic_in_out ¶

    quintic_in_out :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    quintic_in_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

    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 ¶

    quintic_out :: proc "contextless" (p: $T) -> $T {…}
     

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

    quintic_out_inverse ¶

    quintic_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    sine_in ¶

    sine_in :: proc "contextless" (p: $T) -> $T {…}
     

    Modeled after quarter-cycle of sine wave

    sine_in_inverse ¶

    sine_in_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    sine_in_out ¶

    sine_in_out :: proc "contextless" (p: $T) -> $T {…}
     

    Modeled after half sine wave

    sine_in_out_inverse ¶

    sine_in_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    sine_out ¶

    sine_out :: proc "contextless" (p: $T) -> $T {…}
     

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

    sine_out_inverse ¶

    sine_out_inverse :: proc "contextless" (p: $T) -> $T {…}
     

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

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2025-11 (vendor "odin") Windows_amd64 @ 2025-11-16 21:12:41.711697700 +0000 UTC