Returns the tangent of a number.
Math
tan(x)
x
The tan method returns a numeric value that represents the tangent of the angle.
tan is a static method of Math. As a result, you always use it as Math.tan(), rather than as a method of a Math object you create.
The following function returns the tangent of the variable x:
If you pass Math.PI/4 to getTan, it returns 0.9999999999999999.