Last active
February 20, 2021 12:27
-
-
Save marioecg/51c311c679af788b7eb351232cab88dc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
mat2 rotation2d(float angle) { | |
float s = sin(angle); | |
float c = cos(angle); | |
return mat2( | |
c, -s, | |
s, c | |
); | |
} | |
vec2 rotate(vec2 v, float angle) { | |
return rotation2d(angle) * v; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment