Skip to content

Instantly share code, notes, and snippets.

@zadeviggers
Created March 19, 2022 08:49
Show Gist options
  • Save zadeviggers/d50bf1fb6c044ce1d3f51a2e83f88f84 to your computer and use it in GitHub Desktop.
Save zadeviggers/d50bf1fb6c044ce1d3f51a2e83f88f84 to your computer and use it in GitHub Desktop.
Ease in-out one-liner function in python
def easeInOutQuad(x: int | float) -> int | float:
return 2 * x * x if x < 0.5 else 1 - pow(-2 * x + 2, 2) / 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment