Created
January 3, 2019 15:06
-
-
Save companje/7960baf9246ff46461401d84fccf8914 to your computer and use it in GitHub Desktop.
interpolate 2D angles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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