# package core:math/easeSource

⌘K
Ctrl+K
or
/

## Overview

easing procedures and flux easing used for animations

## Index

Types (3)
Constants (0)

This section is empty.

Variables (0)

This section is empty.

Procedure Groups (0)

This section is empty.

## Types

### Ease ¶Source

```Ease :: enum int {
Linear,
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,
}```

### Flux_Map ¶Source

`Flux_Map :: struct(\$T: typeid) {}`

### Flux_Tween ¶Source

`Flux_Tween :: struct(\$T: typeid) {}`

## Constants

This section is empty.

## Variables

This section is empty.

## Procedures

### back_in ¶Source

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

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

### back_in_out ¶Source

`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 ¶Source

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

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

### bounce_in ¶Source

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

### bounce_in_out ¶Source

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

### bounce_out ¶Source

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

### circular_in ¶Source

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

Modeled after shifted quadrant IV of unit circle

### circular_in_out ¶Source

`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_out ¶Source

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

Modeled after shifted quadrant II of unit circle

### cubic_in ¶Source

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

Modeled after the cubic y = x^3

### cubic_in_out ¶Source

`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_out ¶Source

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

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

### ease ¶Source

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

### elastic_in ¶Source

`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 ¶Source

`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 ¶Source

`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 ¶Source

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

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

### exponential_in_out ¶Source

`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_out ¶Source

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

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

### flux_clear ¶Source

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

clear map content, stops all animations

### flux_destroy ¶Source

`flux_destroy :: proc(flux: Flux_Map(\$T)) {…}`

delete map content

### flux_init ¶Source

`flux_init :: proc(\$T: typeid, value_capacity: int = 8) -> Flux_Map(\$T=typeid) {…}`

init flux map to a float type and a wanted cap

### flux_stop ¶Source

`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

```flux_to :: proc(
flux:     ^Flux_Map(\$T),
value:    ^\$T,
goal:     \$T,
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 ¶Source

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

init internal properties

### flux_tween_time_left ¶Source

`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 doesnt 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 :: proc "contextless" (p: \$T) -> \$T {…}`

Modeled after the parabola y = x^2

`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_out :: proc "contextless" (p: \$T) -> \$T {…}`

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

### quartic_in ¶Source

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

Modeled after the quartic x^4

### quartic_in_out ¶Source

`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_out ¶Source

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

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

### quintic_in ¶Source

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

Modeled after the quintic y = x^5

### quintic_in_out ¶Source

`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_out ¶Source

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

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

### sine_in ¶Source

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

Modeled after quarter-cycle of sine wave

### sine_in_out ¶Source

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

Modeled after half sine wave

### sine_out ¶Source

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

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

## Procedure Groups

This section is empty.

## Generation Information

Generated with `odin version dev-2023-10 (vendor "odin") Windows_amd64 @ 2023-10-03 21:09:46.457033800 +0000 UTC`