Degree (com.robertpenner.utils.Degree)

com.robertpenner.utils.Degree
class Degree

The Degree class includes wrappers for the built-in Math functions (sin, cos, tan, and their inverses) that allow you to work with angles in degrees instead of radians.

Availability:

ActionScript 2.0; Flash Player 6

Method summary

Method Description
sinD(angle:Number) : Number

Takes an angle in degrees and returns its sine.

cosD(angle:Number) : Number

Takes an angle in degrees and returns its cosine.

tanD(angle:Number) : Number

Takes an angle in degrees and returns its tangent.

asinD(ratio:Number) : Number

Takes the inverse sine of a slope ratio and returns its angle in degrees.

acosD(ratio:Number) : Number

Takes the inverse cosine of a slope ratio and returns its angle in degrees.

atanD(ratio:Number) : Number

Takes the inverse tangent of a slope ratio and returns its angle in degrees.

atan2D(y:Number, x:Number) : Number

Takes the inverse tangent of a slope ratio and returns its angle in degrees.

sinD(angle:Number) : Number

Usage

trace (Degree.sinD(90));

Parameters

angle:Number - The angle in degrees.

Returns

Returns the sine of the angle.

Description

Takes an angle in degrees and returns its sine.


cosD(angle:Number) : Number

Usage

trace (Degree.cosD(0));

Parameters

angle:Number - The angle in degrees.

Returns

Returns the cosine of the angle.

Description

Takes an angle in degrees and returns its cosine.


tanD(angle:Number) : Number

Usage

trace (Degree.tanD(45));

Parameters

angle:Number - The angle in degrees.

Returns

Returns the tangent of the angle.

Description

Takes an angle in degrees and returns its tangent.


asinD(ratio:Number) : Number

Usage

trace (Degree.asinD(1));

Parameters

ratio:Number - The slope ratio.

Returns

Returns the angle in degrees.

Description

Takes the inverse sine of a slope ratio and returns its angle in degrees.


acosD(ratio:Number) : Number

Usage

trace (Degree.acosD(1));

Parameters

ratio:Number - The slope ratio.

Returns

Returns the angle in degrees.

Description

Takes the inverse cosine of a slope ratio and returns its angle in degrees.


atanD(ratio:Number) : Number

Usage

trace (Degree.atanD(1));

Parameters

ratio:Number - The slope ratio.

Returns

Returns the angle in degrees.

Description

Takes the inverse tangent of a slope ratio and returns its angle in degrees.


atan2D(y:Number, x:Number) : Number

Usage

trace (Degree.atan2D(7, 7));

Parameters

y:Number - The y coordinate of the slope ratio.

x:Number - The x coordinate of the slope ratio.

Returns

Returns the angle in degrees.

Description

Takes the inverse tangent of a slope ratio and returns its angle in degrees.