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

feat(stdlib): Add atan2 to the Number module #2016

Merged
merged 3 commits into from Mar 1, 2024

Conversation

spotandjake
Copy link
Member

This pr adds Number.atan2 which is useful in game development and when working with angles as it is a quick way to compute the angle of a ray from its coordinates.

The implementation is taken from the here with a slight modification to follow c, python and js where x==0 and y==0 results in an output of 0 instead of NaN.

Work for: #1017

Other Documentation:
MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2
Wiki Reference: https://en.wikipedia.org/wiki/Atan2

stdlib/number.gr Outdated Show resolved Hide resolved
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs conflicts resolved

@phated phated added this pull request to the merge queue Mar 1, 2024
Merged via the queue into grain-lang:main with commit 145b783 Mar 1, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants