How do I add trig functions like sine cosine and tangent to my JavaScript calculator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How do I add trig functions like sine cosine and tangent to my JavaScript calculator

i am making a scientific calculator and I want to add trig functions to it

1st Jul 2017, 11:37 PM
Michael.d3v
Michael.d3v - avatar
3 Answers
+ 5
this may help you with the formulas you need: https://www.mathsisfun.com/algebra/trigonometry.html
1st Jul 2017, 11:46 PM
jay
jay - avatar
+ 4
use Math.sin(), Math.cos() or Math.tan(). they accept arguments in radians btw so Math.sin(Math.PI/2) will return 1
2nd Jul 2017, 1:57 AM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 3
and maybe this code can help you https://code.sololearn.com/Wb1TouYrn4qa/?ref=app
2nd Jul 2017, 12:18 AM
Raz
Raz - avatar