Skip to content

Instantly share code, notes, and snippets.

@marioecg
Last active February 20, 2021 12:27
Show Gist options
  • Save marioecg/51c311c679af788b7eb351232cab88dc to your computer and use it in GitHub Desktop.
Save marioecg/51c311c679af788b7eb351232cab88dc to your computer and use it in GitHub Desktop.
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