Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Math | |||
Object
|
+-Math
public class Math
extends Object
The Math class is a top-level class whose methods and properties you can use without using a constructor.
Use the methods and properties of this class to access and manipulate mathematical constants and functions. All the properties and methods of the Math class are static and must be called using the syntax Math.method(parameter) or Math.constant. In ActionScript, constants are defined with the maximum precision of double-precision IEEE-754 floating-point numbers.
Several Math class methods use the measure of an angle in radians as a parameter.You can use the following equation to calculate radian values before calling the method and then provide the calculated value as the parameter, or you can provide the entire right side of the equation (with the angle's measure in degrees in place of degrees) as the radian parameter.
To calculate a radian value, use the following formula:
radians = degrees * Math.PI/180
The following is an example of passing the equation as a parameter to calculate the sine of a 45˚ angle:
Math.sin(45 * Math.PI/180) is the same as Math.sin(.7854)
Availability: ActionScript 1.0; 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.
|
Modifiers |
Property |
Description |
|---|---|---|
|
|
A mathematical constant for the base of natural logarithms, expressed as e. |
|
|
|
A mathematical constant for the natural logarithm of 10, expressed as loge10, with an approximate value of 2.302585092994046. |
|
|
|
A mathematical constant for the natural logarithm of 2, expressed as loge2, with an approximate value of 0.6931471805599453. |
|
|
|
A mathematical constant for the base-10 logarithm of the constant e ( |
|
|
|
A mathematical constant for the base-2 logarithm of the constant e ( |
|
|
|
A mathematical constant for the ratio of the circumference of a circle to its diameter, expressed as pi, with a value of 3.141592653589793. |
|
|
|
A mathematical constant for the square root of one-half, with an approximate value of 0.7071067811865476. |
|
|
|
A mathematical constant for the square root of 2, with an approximate value of 1.4142135623730951. |
Properties inherited from class Object constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
Computes and returns an absolute value for the number specified by the parameter |
|
|
|
Computes and returns the arc cosine of the number specified in the parameter |
|
|
|
Computes and returns the arc sine for the number specified in the parameter |
|
|
|
Computes and returns the value, in radians, of the angle whose tangent is specified in the parameter |
|
|
|
Computes and returns the angle of the point |
|
|
|
Returns the ceiling of the specified number or expression. |
|
|
|
Computes and returns the cosine of the specified angle in radians. |
|
|
|
Returns the value of the base of the natural logarithm (e), to the power of the exponent specified in the parameter |
|
|
|
Returns the floor of the number or expression specified in the parameter |
|
|
|
Returns the natural logarithm of parameter |
|
|
|
Evaluates |
|
|
|
Evaluates |
|
|
|
Computes and returns |
|
|
|
Returns a pseudo-random number n, where 0 <= n < 1. |
|
|
|
Rounds the value of the parameter |
|
|
|
Computes and returns the sine of the specified angle in radians. |
|
|
|
Computes and returns the square root of the specified number. |
|
|
|
Computes and returns the tangent of the specified angle. |
Methods inherited from class Object
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00001816.html