Languages
[Edit]
EN

JavaScript - Math.sin() method example

17 points
Created by:
Blythe-F
650

Math.sin() is a static method that takes only one parameter and returns an approximation of sine mathematical function.

Note: 1.2246467991473532e-16 and -1.133107779529596e-15 should be equal to 0 but they are not because of compuptation precision error.


1. Documentation

Edit
SyntaxMath.sin(number)
Parametersnumber - integer or float number value that represents an angle in radians (primitive value).
Result

number value calculated as sin(x) mathematical function in a range -1 to +1 (primitive value).

If the function can not be calculated it returns NaN.

Descriptionsin is a static method that takes only one parameter and returns an approximation of sin(x) mathematical function.

2. Working with radians

Edit

3. Working with degrees

Edit

4. Reversed console plot example

Edit

5. Canvas plot example

Edit

References

Edit
  1. Sine - Wikipedia

Alternative titles

  1. JavaScript - Math.sin() documentation with examples
  2. js - Math.sin() method documentation with examples
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript - Math documentation (EN)

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join