Skip to content

cf_circle_in_out

Category: math
GitHub: cute_math.h


Returns the circle ease of a float from 0.0f to 1.0f.

float cf_circle_in_out(float x) { if (x < 0.5f) return 0.5f * (1.0f - CF_SQRTF(1.0f - 4.0f * (x * x))); else return 0.5f * (CF_SQRTF(-((2.0f * x) - 3.0f) * ((2.0f * x) - 1.0f)) + 1.0f); }

Remarks

Here is a great link to visualize each easing function.

cf_circle_in
cf_circle_out