How to use inverted tan in javascript?

I need to calculate the angle of a triangle using the tan^-1 function. On my calculator, I can do this:

tan^-1(3/4) // 3 and 4 are the lengths of the sides of the triangle

And he gives out 36 degrees. What is the alternative of this function in JavaScript? I tried Math.tan(3/4) , Math.atan(3/4) and all the other tan functions that I saw in the list, but none of them display the result in degrees that I need (36). Thanks.

+5
source share
1 answer

There is no build function for this, since 1 radian = 180/pi degrees you can do the following using Math.atan() and Math.PI

 var degree = Math.atan(3 / 4) * (180 / Math.PI); document.write(degree); 
+5
source

Source: https://habr.com/ru/post/1232530/


All Articles