August 1999
Intermediate to advanced
1488 pages
72h 53m
English
math.sin(num)
The sin() method of the Math object is used to calculate the sine of a number. It returns a numeric value between –1 and 1.
Listing 6.172 shows how the sin() method is used.
<html> <body> <script language="JavaScript"> <!–– Hide // function calculates the sine of input number function doMath(){ var inputNum1=document.form1.input1.value; var result = Math.sin(inputNum1); document.form1.answer.value = result; } // End Hide ––> </script> <form name=form1> Enter Number: <input type="text" name="input1" size=10> <input type="button" value="Calculate" onClick='doMath()'> ... |
Read now
Unlock full access