Mental estimate for tangent of an angle (from $0$ to $90$ degrees)

Does anyone know of a way to estimate the tangent of an angle in their head? Accuracy is not critically important, but within $5%$ percent would probably be good, 10% may be acceptable.

I can estimate sines and cosines quite well, but I consider division of/by arbitrary values to be too complex for this task. Multiplication of a few values is generally acceptable, and addition and subtraction are fine.

My angles are in degrees, and I prefer not have to mentally convert to radians, though I can if necessary. Also, all angles I'm concerned with are in the range of [0, 90 degrees].

I am also interested in estimating arc tangent under the same conditions, to within about 5-degrees would be good.

Backstory

I'm working on estimating the path of the sun across the sky. I can estimate the declination pretty easily, but now I want to estimate the amount of daylight on any given day and latitude. I've got it down to the arc cosine of the product of two tangents, but resolving the two tangents is now my sticking point. I also want to calculate the altitude of the sun for any time of day, day of the year, and latitude, which I have down to just an arc tangent.


Solution 1:

If you want to stay within 10%, the following piecewise linear function satisfies $$.9\tan\theta \le y \le 1.1\tan\theta$$ for $0\le\theta\le60$ degrees:

$$y={\theta\over60}\text{ for }0\le\theta\le20$$ $$y={2\theta-15\over75}\text{ for }20\le\theta\le45$$ $$y={\theta-20\over25}\text{ for }45\le\theta\le60$$

It might help to rewrite them as

$$y={5\theta\over300}\text{ for }0\le\theta\le20$$ $$y={8\theta-60\over300}\text{ for }20\le\theta\le45$$ $$y={4\theta-80\over100}\text{ for }45\le\theta\le60$$

so that you really don't have to divide by anything other than $3$. The line segment approximations lie above $\tan\theta$ from $\theta\approx25$ to $\theta=45$ and below it elsewhere, so you should round down and up accordingly when doing the mental arithmetic.It's obviously possible to extend this for angles greater than $60$ degrees, but whether (or how far) you can do so with formulas that use only "simple" multiplications and divisions is unclear.

A word of explanation: What I tried to do here was take seriously the OP's request for estimates you can calculate in your head. The ability to do mental arithmetic, of course, varies from person to person, so I used myself as a gauge. As for where the formulas came from, my starting point was the observation that the conversion factor between degrees and radians, $180/\pi$, is approximately $60$, so the estimate $\tan\theta\approx\theta/60$ should be OK for a while. A little trial and error showed it's good up to $\theta=20$ degrees (since $.9\tan20\approx.328$). It was easy to see that connecting $(0,0)$ to $(20,1/3)$ and $(20,1/3)$ to $(45,1)$ with straight lines would stay within the prescribed bounds. Finally, noting that $.9\tan60\approx1.55$, I saw that the line connecting $(45,1)$ to $(60,1.6)$ would have a nice slope and stay within the prescribed bounds as well.

Solution 2:

Consider trivial trig identity: $$\tag 1\tan(a+b) = \frac {\tan a + \tan b}{1-\tan a\tan b} $$ Now substitute: $$\tan a = N_1/D_1$$ $$\tan b = N_2/D_2$$ So 1 becomes: $$\tag 2\tan(a+b) =\frac {N_1D_2+N_2D_1}{D_1D_2-N_1N_2}$$ $$\tag 3\tan(a-b) =\frac {N_1D_2-N_2D_1}{D_1D_2+N_1N_2}$$ And use this "magic hash table": $$\tan 26.57^\circ = 1/2$$ $$\tan 18.43^\circ = 1/3$$ $$\tan 14.04^\circ = 1/4$$ $$\tan 11.31^\circ = 1/5$$

And a following useful identities for small angels in radians $$\tan a = a, |a| <0.05 (3.0 ^\circ) $$ And for angles more than $45^\circ$ $$\tan a = 1/\tan(90°−a)$$

You can also recursively repeat this process to get more and more precious approximation then:

$$a_i=a_{i-1}\pm b_{i-1}$$

$$\tag 4 \tan b_i=b_i=x - a_i$$

Where $a_0$ and $b_0$ picked from the table and $x$ is initial angle value

While evaluating $(4)$ you need conversion to radians. It is simply multiplication on $7/400$ So you need to aproximate $x-a_i$ with such fraction what it has $7$ in denominator and/or dividers of $400$ in numerator.

Google for "Fast_Approximation_of_Elementary_Functions.pdf" paper for further information on this trick. Direct link is prohibitted for some strange reason.

P.S. Drawing for using instead of remebering the hash table and for fast picking of $a_0$ $b_0$: enter image description here

P.P.S. To remember $(2)$ consider product of two complex numbers $$z=(D1,N1)(D2,N2)$$ so $(2)$ becomes:
$$\frac {\Im z}{\Re z}$$ to get $(3)$ just swap signs

Solution 3:

Because of the numerical coincidence that $(\pi/180)^2/3$ is nearly $10^{-4}$, the Taylor polynomial $\tan x \approx x+x^3/3$ becomes nearly $$\tan(y {\rm\ deg}) \approx .017y(1+10^{-4}y^2)$$ which seems to be accurate within 5 percent up to about 38 degrees, and within about 8 percent up to 45 degrees. Beyond 45 degrees I don't know what to do unless you can divide as in $\tan x = 1/\tan(\pi/2-x)$.

Solution 4:

For $\theta = \frac{180^{\circ}}{\pi}\arctan x$ you can use: $$\theta \approx \frac{180x}{3+x} \quad \mathrm{for} \quad 0 \leq x \leq 1$$ $$\theta \approx 90^{\circ}- \frac{180}{3x+1} \quad \mathrm{for} \quad x > 1$$ where $\theta$ is measured in degrees.

Solution 5:

This may not be the best for in-your-head calculation, but for $x$ in degrees $$ \tan\left(\frac{\pi x}{180}\right)\approx\frac{x(990-4x)}{(90-x)(630+4x)}\tag{1} $$ is at most $0.6\%$ off for $0\le x\le90$.

Here is a plot of the relative error:$\displaystyle\left.\frac{x(990-4x)}{(90-x)(630+4x)}\middle/\tan\left(\frac{\pi x}{180}\right)-1\right.$ :

$\hspace{2cm}$enter image description here

Equation $(1)$ looks a little daunting, but at least $x$ is in degrees, and the relative error is quite small. Really, the only constant that needs to be remembered for $(1)$ is $\frac{990}{4}$; that is, $$ P(x)=x\left(\frac{990}{4}-x\right)\implies\tan\left(\frac{\pi x}{180}\right)\approx\frac{P(x)}{P(90-x)}\tag{2} $$