unpythonic.net Tags

Jeff Epler's blog

About me

I've been a computer programmer since I first started typing in program listings on a Commodore Vic 20 when I was about 8. My hobbies include electronics, CNC manufacturing, photography, beer and winemaking.

I live with my wife and lots of left-over parts from unfinished projects in Lincoln, Nebraska, USA.]

Blog

18 May 2011, 12:54 UTC

almost-integers from tan()


From time to time, I've written little programs to find almost-integers in certain forms.

Most recently, I hit upon the form tan(i)/tan(j) where i and j are both integers. I was at first surprised to see that there were in fact a lot of the form tan(2x)/tan(x) ≅ 2, but a little thought revealed why: These were values of x that were just above multiples of π.

Example:

>>> x=355; tan(2*x)/tan(x); x/pi
2.000000001817364
113.00000959524569

Reduce x modulo π, and the formula becomes tan(2ϵ)/tan(ϵ) ≅ 2ϵ/ϵ ≅ 2. Mystery solved.

[permalink]

All older entries
Website Copyright © 2004-2024 Jeff Epler