Skip to content

Instantly share code, notes, and snippets.

@fernoe1
Created March 21, 2026 14:01
Show Gist options
  • Select an option

  • Save fernoe1/5b4fa6e1a339275f8b84659da09595b1 to your computer and use it in GitHub Desktop.

Select an option

Save fernoe1/5b4fa6e1a339275f8b84659da09595b1 to your computer and use it in GitHub Desktop.
vec2 rotate(vec2 v, float a) {
float s = sin(a);
float c = cos(a);
return vec2(
c * v.x - s * v.y,
s * v.x + c * v.y
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment