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

Fix degrees to radians #268

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Fix degrees to radians #268

merged 1 commit into from
Dec 14, 2023

Conversation

Bigfoot71
Copy link
Contributor

Corrects a small mistake in the comments and in the parameter name, which indicated degrees instead of radian.

Vector2Rotate() takes radians (source):

// Rotate vector by angle
RMAPI Vector2 Vector2Rotate(Vector2 v, float angle)
{
    Vector2 result = { 0 };

    float cosres = cosf(angle);
    float sinres = sinf(angle);

    result.x = v.x*cosres - v.y*sinres;
    result.y = v.x*sinres + v.y*cosres;

    return result;
}

Corrects a small error in the comments and in the parameter name, which indicated degrees instead of radian
@RobLoach RobLoach merged commit ff5bd5b into RobLoach:master Dec 14, 2023
8 checks passed
@Bigfoot71 Bigfoot71 deleted the patch-2 branch December 14, 2023 14:11
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

Successfully merging this pull request may close these issues.

2 participants