tan()

The tan() method is used to calculate the tangent value of the given number (number - see syntax), in the brackets. The returned value is a number which represents the tangent of the given number. As with all mathematical methods, it is used with the Math object.

syntax:

Math.tan(number)

EXAMPLE

var tanNumber = 78 + 56;

document.write("The tangent of the addition of 78 and 56 is : " + Math.tan(tanNumber) )

The example first creates a new variable, called tanNumber, which holds the product of the division of 78 and 56, which represents the number being worked with. The document.write statement then writes some descriptive text, with the tan() method being invoked upon the contents of tanNumber. The output should look like the following:



The tangent of the addition of 78 and 56 is : -1.9100251751317298