Sin (Math.sin Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Returns
- A number; an integer.
Number
Example
The following example returns a random number between two specified integers.
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.round(Math.random() * (max-min+1) + (min-
.5));
return randomNum;
}
for (var i = 0; i<25; i++) {
trace(randRange(4, 11));
}
See also
ceil (Math.ceil method)

sin (Math.sin method)

public static sin(x:Number) : Number
Computes and returns the sine of the specified angle in radians. To calculate a radian, see the
description of the Math class entry.
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.
Parameters
- A number that represents an angle measured in radians.
x:Number
Returns
- A number; the sine of the specified angle (between -1.0 and 1.0).
Number
Example
The following example draws a circle using the mathematical constant pi, the sine of an angle,
and the Drawing API.
drawCircle(this, 100, 100, 50);
//
function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void {
mc.lineStyle(2, 0xFF0000, 100);
mc.moveTo(x+r, y);
758
ActionScript classes
,
floor (Math.floor method)

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF