contents   index   previous   next



Math.acos()

syntax:

Math.acos(x)

where:

x - a number between 1 and -1.

 

return:

number - the arc cosine of x.

 

description:

The return value is expressed in radians and ranges from 0 to pi. Returns NaN if x cannot be converted to a number, is greater than 1, or is less than -1.

 

example:

function compute_acos(x)

{

   return Math.acos(x)

}

 

// If you pass -1 to the function compute_acos(),

// the return is the

// value of pi (approximately 3.1415...),

// if you pass 3 the

// return is NaN since 3 is out

// of the range of Math.acos.

 


Math.asin()