TAN
Tangent
This numeric function returns the tangent of an angle expressed in radians.
Syntax
Section titled “Syntax”TAN (numeric-value [,ERR=line-ref|,ERC=error-code])numeric-value- is any valid number.
line-ref- is the program line number or label to branch to if an error is produced by this function.
error-code- is a programmer-defined error code. Valid values are positive or negative whole numbers.
Remarks
Section titled “Remarks”This function is available starting with release level 7.0.
This function returns a number in the range of +/-.99999999999987E-8 to +/- .12732395447356 for numeric-values ranging from +/- .99999999999999E-8 radians to +/- .1.5707963267949 (Pi/2) radians.
Note that TAN and ATN are inverse functions; that is:
TAN (ATN(x)) = xATN (TAN(x)) = xThoroughbred Basic does not have a separate cotangent function, but the cotangent function is the tangent of the complementary angle. In other words, if the angle is represented by the numeric variable ANGLE_IN_RADIANS, then TAN (ACS(-1)/2 - ANGLE_IN_RADIANS) gives the cotangent of ANGLE_ IN_RADIANS since ACS(-1)/2 is the radian equivalent of 90 degrees.
Examples
Section titled “Examples”TAN (0)The result is 0.
TAN (ACS(-1)/2)The result is 12732395447356 because ACS(-1)/2 is equal to Pi/2. This example assumes that the value of the PRECISION variable is set to 14.
TAN (ACS(-1)/4)The result is 1 because ASC(-1)/4 is the equivalent of 45 degrees.
See also
Section titled “See also”ACS function
From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF