😲JavaScript has a bad mistake😲 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

😲JavaScript has a bad mistake😲

These days.I make calculator ,but when I tried to use Math.sin(90) ,It hasn't been 1 . Even cos and tan 😞but I need to use sine or cos ect.... Inside my workings, what can I do? The wrong from JavaScript or from my phone or from me. Although everybody knows about to sin 90 = 1 cos 60 = 0.5 In JavaScript another thing. Please If you have the answer tell me and If you know how can I use sin and cos into my calculator by JavaScript. Thank you 🌹🌹🌹

29th Jan 2019, 3:02 PM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar
5 Answers
+ 11
You have to provide the parameter in radians, not degrees. Try: Math.sin(Math.PI)
29th Jan 2019, 3:13 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 4
Yes, I would try (Math.PI/2.0) for 90 and (Math.PI/3.0) for 60.
29th Jan 2019, 6:57 PM
Sonic
Sonic - avatar
+ 4
You need to convert the arguments to radians.
14th Feb 2019, 1:57 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
You won't get answer until deleting other 3 same questions.
29th Jan 2019, 3:07 PM
Maneren
Maneren - avatar
+ 1
Good.
31st Jan 2019, 1:02 AM
Otávio
Otávio - avatar