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

builtin: Add maths functions #108

Merged
merged 1 commit into from
Mar 17, 2023
Merged

builtin: Add maths functions #108

merged 1 commit into from
Mar 17, 2023

Conversation

juliaogris
Copy link
Member

Add some essential maths functions. This has been again added on request
to allow for more interesting graphics, especially sin, cos, atan2.

Thanks @fcostin for the suggestion.

@github-actions
Copy link

github-actions bot commented Mar 17, 2023

firebase-deployment: https://evy-lang--108-bf9hzyck.web.app (3f728ca)

Copy link
Contributor

@camh- camh- left a comment

Choose a reason for hiding this comment

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

🍀

print "sqrt 2:" (sqrt 2)
print "sin pi:" (sin pi)
print "cos pi:" (cos pi)
print "atan2 x y:" (atan2 0 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

should be atan2 0 0 not atan2 x y

@@ -0,0 +1,14 @@
pi := 3.141593
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: through experimentation I found that these values:

pi := 3.14159265
e := 2.718281828459045

Make log e print 1 and cos pi print -1. sin pi is still not quite zero though, even when I add a bunch more precision.

Add some essential maths functions. This has been again added on request
to allow for more interesting graphics, especially sin, cos, atan2.
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.

None yet

2 participants