MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 349

Actionscript language reference
Table of Contents

Advertisement

Description
Method; returns the ceiling of the specified number or expression. The ceiling of a number is the
closest integer that is greater than or equal to the number.
Example
The following code returns a value of 13:
Math.ceil(12.5);
See also
Math.floor(),
Math.cos()
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.cos(x:Number) : Number
Parameters
A number that represents an angle measured in radians.
x
Returns
A number from -1.0 to 1.0.
Description
Method; computes and returns the cosine of the specified angle in radians. To calculate a radian,
see
"Description" on page 344
Example
The following example displays the cosine for several different angles.
trace (Math.cos(0));
trace (Math.cos(Math.PI/2)); // 90 degree angle. Output: 6.12303176911189e-17
trace (Math.cos(Math.PI));
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.
See also
Math.acos(), Math.asin(), Math.atan(), Math.atan2(), Math.sin(),
Math.round()
of the Math class entry.
// 0 degree angle. Output: 1
// 180 degree angle. Output: -1
Math.tan()
Math.cos()
349

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flex

Table of Contents