HTBasic Help
×
Menu
Index

TAN

Returns the tangent of an expression.
 
 TAN( argument )
 
Usage:
A=TAN(B)
Tangent=TAN(X)
PRINT "Tangent of";Angle;"=";TAN(Angle)
Example: TAN.BAS
Description:
The tangent of an angle is the sine of the angle divided by the cosine of the angle. The numeric expression is treated as an angle in the current trigonometric mode: RADians or DEGrees. The default units are radians. TAN is defined for all real numbers except ±PI/2 (±90 degrees) and other odd multiples of PI/2 (90 degrees).
COMPLEX Arguments
TAN accepts either a COMPLEX or REAL argument and returns a value of the same type. For COMPLEX arguments the angle must be specified in radians, regardless of the current trigonometric mode. The real and imaginary parts of TAN(Z) are calculated (using real arithmetic) as:
REAL(TAN(Z)) = SIN(2*REAL(Z))/D
IMAG(TAN(Z)) = SINH(2*IMAG(Z))/D
Where:
D = COS(2*REAL(Z))+COSH(2*IMAG(Z))
The domain of TANH includes all points in the complex plane except CMPLX(PI/2,0) and other odd multiples of PI/2. Also, intermediate values generated during the calculation of the function can also cause over or underflow errors for very large or small values of Z.
See Also: