Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The implementation of rotate2d is clockwise and does not match the spec #2154

Open
rockmao1 opened this issue Dec 23, 2024 · 0 comments
Open

Comments

@rockmao1
Copy link

The implementation code of rotate2d is as follows:
void mx_rotate_vector2(vec2 _in, float amount, out vec2 result)
{
float rotationRadians = radians(amount);
float sa = sin(rotationRadians);
float ca = cos(rotationRadians);
result = vec2(ca*_in.x + sa*_in.y, -sa*_in.x + ca*_in.y);
}

the rotate is clockwise, bug specs are as follows:
the amount to rotate, specified in degrees, with positive values rotating the
incoming vector counterclockwise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant