Skip to main content
added 196 characters in body
Source Link

If I'm not mistaken Math.tan(x) does not take aangles as degrees, but rather radians. If you want to supply angles as degrees, try the following code sample:

function getTanDeg(deg) {
   var rad = deg * Math.PI/180;
   return Math.tan(rad);
}

HereSource - Mozilla Developer Network is the documentation.

If I'm not mistaken Math.tan(x) does not take a degrees, but rather radians.

Here is the documentation.

If I'm not mistaken Math.tan(x) does not take angles as degrees, but rather radians. If you want to supply angles as degrees, try the following code sample:

function getTanDeg(deg) {
   var rad = deg * Math.PI/180;
   return Math.tan(rad);
}

Source - Mozilla Developer Network

Source Link

If I'm not mistaken Math.tan(x) does not take a degrees, but rather radians.

Here is the documentation.