TAN Function

Calculates the tangent of an angle.

Syntax

TAN(expression)

Syntax Elements

expression is any DataBasic expression that evaluates to a value in degrees.

The relation between radians and degrees is: 2 Pi radians = 360 degrees.

Operation

If there is no PRECISION statement in the program, the value is returned rounded to the nearest four decimal places. Otherwise, the number of decimal places returned is as specified by the PRECISION statement.

In each case, the significant decimal places returned are the result of rounding. However, only up to five places are significant: if the PRECISION statement specifies a precision greater than five, trailing zeroes are appended to the five significant places so as to return the numbers of places specified.

Comments

Tangent is undefined for angles which are odd multiples of 90 degrees (90*1=90, 90*3=270, etc.). If the expression used is an odd multiple of 90, a warning message is displayed and a value of zero is returned.

Examples

ANGLE = 25
A = TAN(ANGLE)

Calculates the tangent of an angle of 25 degrees and assigns the value to A.

Y = TAN(30)

Assigns the tangent of an angle of 30 degrees to variable Y.