sin()

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

syntax:

Math.sin(number)

EXAMPLE

var sinNumber = 78 + 56;

document.write("The sine of the addition of 78 and 56 is : " + Math.sin(sinNumber) )

The example first creates a new variable, called sinNumber, 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 sin() method being invoked upon the contents of cosNumber. The output should look like the following:



The sine of the addition of 78 and 56 is : 0.8859248164599484