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

Number stdlib Libary: Add following functions and values #1017

Open
13 of 24 tasks
spotandjake opened this issue Nov 2, 2021 · 2 comments
Open
13 of 24 tasks

Number stdlib Libary: Add following functions and values #1017

spotandjake opened this issue Nov 2, 2021 · 2 comments
Labels

Comments

@spotandjake
Copy link
Member

spotandjake commented Nov 2, 2021

Add The Following Functions to the number Libary.

  • Number.sin()
  • Number.cos()
  • Number.tan()
  • Number.asin()
  • Number.acos()
  • Number.atan()
  • Number.atan2()
  • Number.log()
  • Number.log2()
  • Number.log10()
  • Number.factorial()
  • Number.pow()
  • Number.sign()
  • Number.parseInt()
  • Number.parseFloat()
  • Number.toFixed()
  • Number.lerp()
  • Number.map()
  • Number.toRadian: (degree: Number) => Number
  • Number.toDegree: (radian: Number) => Number
  • Number.exp()
  • Number.exp2()
  • Number.exp10()
    Along with the following values
  • Number.PI
    And probably confirm that sin, cos, tan all would work on radians and maybe think about having a degrees to radian conversion along with a radians to degrees.
@cician
Copy link
Contributor

cician commented Feb 6, 2022

I'd also add:

For logarithms it's useful to have three variants for most common bases: log2, log10 and log for the natural logarithm. Same for exp.

Trigonometric functions should definitely take radians and conversion functions would be nice.

@spotandjake
Copy link
Member Author

#1373 has been closed as the new plan is to use The range type I am linking it because it still contains some useful stuff related to documenting the map, clamp and lerp functions.

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

No branches or pull requests

3 participants