Mwnci tan() Function

Syntax

tan(number)

Description

The tan() function returns the tangent of the radian argument.

Example

PI = 3.141593
printf(" degrees tan(x)   sin(x)/cos(x)\n")
printf(" ------- -------- -------------\n")
i=-10
while ((i += 10) <= 180) {
    Radians = i * 2 * PI / 360
    if (abs(cosine = cos(Radians)) <= 0.000000) {
        printf(" %3d*** tan(x) is undefined for this value\n",i)
    } else {
        printf(" %3d    %8.5f %8.5f\n",i,tan(Radians),sin(Radians) / cosine)
    }
}


 degrees tan(x)   sin(x)/cos(x)
 ------- -------- -------------
   0     0.00000  0.00000
  10     0.17633  0.17633
  20     0.36397  0.36397
  30     0.57735  0.57735
  40     0.83910  0.83910
  50     1.19175  1.19175
  60     1.73205  1.73205
  70     2.74748  2.74748
  80     5.67129  5.67129
  90*** tan(x) is undefined for this value
 100    -5.67128 -5.67128
 110    -2.74748 -2.74748
 120    -1.73205 -1.73205
 130    -1.19175 -1.19175
 140    -0.83910 -0.83910
 150    -0.57735 -0.57735
 160    -0.36397 -0.36397
 170    -0.17633 -0.17633
 180     0.00000  0.00000