contents   index   previous   next



Math.cos()

syntax:

Math.cos()

where:

x - an angle, measured in radians.

 

return:

number - an implementation-dependent approximation of the cosine of the argument

 

description:

The argument is expressed in radians. Returns NaN if x cannot be converted to a number. In order to convert degrees to radians you must multiply by 2pi/360.

 

example:

//The cosine of x is returned 

//in the following function:

function compute_cos(x)

{

   return Math.cos(x)

}

 


Math.exp()