public static cos(x:Number) : Number
Computes and returns the cosine of the specified angle in radians. To calculate a radian, see the description of the Math class entry.
x:Number - A number that represents an angle measured in radians.
Number - A number from -1.0 to 1.0.
The following example displays the cosine for several different angles.
trace (Math.cos(0)); // 0 degree angle. Output: 1 trace (Math.cos(Math.PI/2)); // 90 degree angle. Output: 6.12303176911189e-17 trace (Math.cos(Math.PI)); // 180 degree angle. Output: -1 trace (Math.cos(Math.PI*2)); // 360 degree angle. Output: 1
Note: The cosine of a 90 degree angle is zero, but because of the inherent inaccuracy of decimal calculations using binary numbers, Flash Player will report a number extremely close to, but not exactly equal to, zero.
acos (Math.acos method), asin (Math.asin method), atan (Math.atan method), atan2 (Math.atan2 method), sin (Math.sin method), tan (Math.tan method)