Math.acos Function (JavaScript)

Returns the arc cosine (or inverse cosine) of a number.

Math.acos(number)

The required number argument is a numeric expression.

The arc cosine of the number argument, in radians.

The following code shows how to use the acos function.

var v1 = Math.acos(-1.0);
var v2 = Math.cos(-1.0);

document.write(v1);
document.write("<br/>");
document.write(v2);

// Output:
// 3.141592653589793
// 0.5403023058681398

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported in Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Show:
© 2014 Microsoft