Table of Contents

Math.tan( ) Method Flash 5; can be used when exporting Flash 4 movies

compute the tangent of an angle
Math.tan(theta)

Arguments

theta

An angle, in radians (not degrees), normally in the range of -figs/U03C0.gif/2 to figs/U03C0.gif/2, although any angle will suffice, as tangent is a periodic function.

Returns

The tangent of theta (the result is in the range of -Infinity to Infinity).

Description

The tan( ) method returns the trigonometric tangent of an angle. In a right triangle, the tangent of an angle is the result of dividing the length of the side opposite the angle by the length of the side adjacent to the angle. This is also the same as the ratio Math.sin(theta)/Math.cos(theta), so as cos(theta) approaches zero, tan(theta) approaches Infinity. Therefore, tan(theta) is not calculable for the values -figs/U03C0.gif/2, figs/U03C0.gif/2, -3figs/U03C0.gif/2, 3figs/U03C0.gif/2, etc.

Example

trace (Math.tan(0));            // Displays: 0
trace (Math.tan(Math.PI/4));    // Displays: 1

See Also

Math.atan( ), Math.cos( ), Math.sin( )


Table of Contents