# Tangents and 18/pi

In degrees, look at what the result is when you take tan(89), tan(89.9), tan(89.99) etc.

The value as the number of 9's gets larger converges to 18/pi, with a shifted decimal point.

Why?

Simon Bridge
Homework Helper
Observe:
Code:
octave:10> t
t =

89.900
89.990
89.999
90.000
90.000
90.000
90.000
90.000
90.000
90.000
90.000
90.000
90.000
90.000
90.000

octave:11> tan(t*pi/180)
ans =

5.7296e+02
5.7296e+03
5.7296e+04
5.7296e+05
5.7296e+06
5.7296e+07
5.7296e+08
5.7296e+09
5.7295e+10
5.7296e+11
5.7278e+12
5.7535e+13
5.4419e+14
3.5301e+15
1.6332e+16

18/pi is 5.72957795130823

To 4dp that 5.6296 ... but notice that the calculation departs from the pattern at the e+10 stage?
(That is when theta is 89.999999999 ... 9 "9"'s in a row.)

Lets try it without rounding up:
Code:
octave:12> format long

octave:14> tan(t*pi/180)
ans =

5.72957213354303e+02
5.72957789312165e+03
5.72957795072129e+04
5.72957795104345e+05
5.72957794122192e+06
5.72957798144568e+07
5.72957787343207e+08
5.72957898008453e+09
5.72953173262481e+10
5.72956950454798e+11
5.72776101541460e+12
5.75350505624601e+13
5.44191874731457e+14
3.53013952228678e+15
1.63317787283838e+16

What you are seeing is that the tangent function behave a bit like an exponential function for values close to 89.999999deg ... just like it behaves like y=x for values close to 0. What you are not seeing is any convergence to a pattern - far from it, continuing the calculation shows divergence as the argument approaches 90deg.

lurflurf
Homework Helper
We have the identity

tan(90-x)=1/tan(x)

it is better to work in radians so that

tan(pi/2-x)=1/tan(x)

when x is small we have (~ mean approximately)
tan(x)~x
so
tan(pi/2-x)=1/tan(x)~1/x

back in degrees

tan(90-x)=1/tan(x)~180/(pi x)

as you observed