vec2 rotate vec2 point float angle vec2 rotated_point rotated_point po

1
2
3
4
5
6
vec2 rotate(vec2 point, float angle){
vec2 rotated_point;
rotated_point.x = point.x * cos(angle) - point.y * sin(angle);
rotated_point.y = point.x * sin(angle) + point.y * cos(angle);
return rotated_point;
}