JavaScript Tutorial/Math/cos

Материал из Web эксперт
Перейти к: навигация, поиск

Math.cos()

The cos() method calculates the cosine of a number.

It returns a numeric value between -1 and 1, representing the cosine of an angle.



   <source lang="javascript">

<html>

   <body>
   <script language="JavaScript">
   
   </script>
   <form name=form1>
   This exanple calculates the cosine of the entered number.
   

Enter First Number: <input type="text" name="input" size=10> <input type="button" value="Calculate" onClick="doMath()">
The cosine is: <input type="text" name="answer" size=10> </form> </body> </html></source>