Name

Math.atan( ) Method — compute the arc tangent of a number

Availability

Flash 5; may be used when exporting Flash 4 movies

Synopsis

Math.atan(x)

Arguments

x

A number between -Infinity and Infinity, inclusive (the tangent of some angle).

Returns

The angle, in radians, whose tangent is x.

Description

The arc tan function (sometimes written as tan-1) is the inverse of the tangent function. It returns the angle whose tangent has the specified value, in radians. The return value is in the range -π/2 to π/2.

Example

trace (Math.atan(1.0));       // Displays: 0.78539...
trace (Math.atan(0.0));       // Displays: 0
trace (Math.atan(-Infinity)); // Displays: -1.5707... (i.e., -pi/2)

See Also

Math.acos( ), Math.asin( ), Math.tan( )

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.