User Guide
346 Chapter 6: ActionScript Core Classes
Example
The following example shows how Math.abs() returns the absolute value of a number and does
not affect the value of the
x parameter (called num in this example):
var num:Number = -12;
var numAbsolute:Number = Math.abs(num);
trace(num); // output: -12
trace(numAbsolute); // output: 12
Math.acos()
Availability
Flash Player 5. In Flash Player 4, the methods and properties of the Math class are emulated using
approximations and might not be as accurate as the non-emulated math functions that Flash
Player 5 supports.
Usage
Math.acos(x:Number) : Number
Parameters
x
A number from -1.0 to 1.0.
Returns
A number; the arc cosine of the parameter x.
Description
Method; computes and returns the arc cosine of the number specified in the parameter x,
in radians.
Example
The following example displays the arc cosine for several values.
trace(Math.acos(-1)); // output: 3.14159265358979
trace(Math.acos(0)); // output: 1.5707963267949
trace(Math.acos(1)); // output: 0
See also
Math.asin(), Math.atan(), Math.atan2(), Math.cos(), Math.sin(), Math.tan()
Math.asin()
Availability
Flash Player 5. In Flash Player 4, the methods and properties of the Math class are emulated using
approximations and might not be as accurate as the non-emulated math functions that Flash
Player 5 supports.
Usage
Math.asin(x:Number) : Number;