Skip to content

Instantly share code, notes, and snippets.

@companje
Created January 3, 2019 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save companje/7960baf9246ff46461401d84fccf8914 to your computer and use it in GitHub Desktop.
Save companje/7960baf9246ff46461401d84fccf8914 to your computer and use it in GitHub Desktop.
interpolate 2D angles
//thanks to: https://gist.github.com/shaunlebron/8832585
float angleLerp(float from, float to, float t) {
float diff = (to - from) % TWO_PI;
return from + (2 * diff % TWO_PI - diff) * t;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment