Archive for the 'math' Category

Calculating PI

Sunday, March 14th, 2010

In honor of PI day, I thought I would recall a story of my wayward youth.  =P

In middle school (at JDMS), I was becoming decently proficient at everything BASIC.  (Apple II, TRS-80 and DOS 3.3)  One of my math teachers mentioned to me that you could approximate PI by filling one quarter of a circle with an ever increasing number of rectangles of smaller and smaller widths.  And so I wrote a program to do just that.  Spent weeks running and rerunning it with different numbers of slices (and different methods of calculating the heights) and comparing the outputs to official known good values.  (and charting my accuracy)

I don’t remember exactly how accurate I finally got before they told me to stop running multi-day processes on the lab computers…  But suffice it to say: I was VERY nerdy.  =P

<>   © Copyright 2000-2005 by Derek Anderson
Get Firefox