TAN function

Purpose

Return the tangent of its argument.

Syntax

y = TAN(numeric_expression)

Remarks

numeric_expression is an angle specified in radians.  To convert radians to degrees, multiply by 57.29577951308232##.  To convert degrees to radians, multiply by 0.0174532925199433##.  For more information on radians, see ATN.

TAN returns an Extended-precision result.

TAN is approximated with the expression:

TAN = SIN(Value) / COS(Value)

The Inverse Tangent (ARCTAN) of a value can be easily calculated with the ATN function.

The Hyperbolic Tangent (TANH) of a value can be calculated:

TanH = (EXP(2 * Value) - 1) / (EXP(2 * Value) + 1)

The Inverse Hyperbolic Tangent (ARCTANH) of a value can be calculated:

ArcTanH = LOG((1 + Value) / (1 - Value)) / 2

 

' Useful Macro functions

MACRO Pi = 3.141592653589793##

MACRO DegreesToRadians(dpDegrees) = (dpDegrees * 0.0174532925199433##)

MACRO RadiansToDegrees(dpRadians) = (dpRadians * 57.29577951308232##)

See also

ATN, COS, SIN

Example

pi# = 3.141592653589793##

FOR I& = 5 TO 45 STEP 5

  x$ = "The Tangent of " + FORMAT$(I&,"* ") + _

    " degrees = " + FORMAT$(TAN(pi## / 180 * _

    I&),"0.00")

NEXT I&

Result

The Tangent of  5 degrees = 0.09

The Tangent of 10 degrees = 0.18

The Tangent of 15 degrees = 0.27

The Tangent of 20 degrees = 0.36

The Tangent of 25 degrees = 0.47

The Tangent of 30 degrees = 0.58

The Tangent of 35 degrees = 0.70

The Tangent of 40 degrees = 0.84

The Tangent of 45 degrees = 1.00