Skip to content

Instantly share code, notes, and snippets.

@kosmolot
Created July 19, 2017 15:42
Show Gist options
  • Save kosmolot/5069e040e9623d5138b8db5e7d1aadb9 to your computer and use it in GitHub Desktop.
Save kosmolot/5069e040e9623d5138b8db5e7d1aadb9 to your computer and use it in GitHub Desktop.
cubic_bezier method (Vala)
public float cubic_bezier (float t, float a, float b, float c, float d) {
float u = 1 - t;
float tt = t * t;
float uu = u * u;
float uuu = uu * u;
float ttt = tt * t;
return (uuu * a) + (3 * uu * t * b) + (3 * u * tt * c) + (ttt * d);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment