Parameters or Arguments
number The range used to calculate the tangent. It is the price of an perspective expressed in radians.
The tan() function returns the tangent of a number.
To convert stages to radians, multiply through 2π/360 or 0.017453293. Math is a placeholder object that incorporates mathematical features and constants of which tan() is one of these functions.
console.log(Math.tan(2)); console.log(Math.tan(0)); console.log(Math.tan(-0.9));
In this example, we have invoked the tan() feature the use of the Math class.
We have written the output of the tan() feature to the web browser console log, for demonstration purposes, to show what the tan() function returns.
The following will be output to the net browser console log:
-2.185039863261519 0 -1.2601582175503392
In this example, the first output to the console log returned -2.185039863261519 which is the tangent of 2
The 2nd output to the console log back 0 which is the tangent of 0
The 1/3 output to the console log returned -1.2601582175503392 which is the tangent of -0.9.