
Math.acos() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
601
are reasonable approximations, but they are not necessarily identical to the native func-
tions supported in Flash 5 and later. The Flash 4 values are sufficiently accurate for “close-
enough” applications, such as graphics display, but are not accurate enough for critical
financial or engineering calculations.
Note that the trigonometric functions require angles to be measured in radians, whereas
Flash’s
MovieClip._rotation property is measured in degrees. There are 2π radians in a
circle (1 radian is approximately 57.3 degrees). To convert from radians to degrees, use the
formula:
degrees = (radians / Math.PI) * 180;
To convert from degrees to radians, use the formula:
radians = (degrees / 180) * Math.PI;
Flash automatically converts all Math object constants to literal numbers at compile-time.
See Also
“The Number Type” in Chapter 4
Math.abs() Method
compute the absolute value of a number
Flash 5; can be used when exporting Flash 4 movies
Math.abs(x)
Arguments
x Any integer or floating-point number.
Returns
The absolute value of x (a positive number of magnitude x).
Description
The abs( ) method calculates the distance between x and 0 (i.e., the absolute value of x). It
leaves zero and positive numbers unchanged and converts negative numbers ...