Image via Wikipedia Some years ago, in a discussion with one of my colleagues, we mentioned the number PI. Sure, you know this is a mathematical constant which represents the ratio of any circle’s circumference to its diameter in Euclidean geometry.
My colleague said : ” For a circle, PI equals 3.1459 “.
“I know”, I said, “but … for a circle ??? Is PI not allways ‘for a circle‘ ? Is there a PI for other geometrical shapes ?”
So we started to discuss the subject and, since a circle is the limit of a polygon with the number of angles approaching infinity, we decided that it must be possible to calculate some sort of PI for non-circular polygons.
What follows is the result. I leave it to the reader to judge the mathematical meaning or relevance, but at the time, I found it interesting and fun.
Let us start with the simple definition : PI equals the circumference divided by two times the radius of the circle. How could we calculate that for polygons ? I had to make a choice : either drawing the circle outside the polygon, touching all its corners, or inside the polygon, touching its sides. I chose for the former one, because you can still draw that circle for a polygon with two angles (a line !).
And then I started to calculate, and frankly, do not ask how I got to it, but recently I discovered the spreadsheet I made at that time and from it I can see I came up with the following formula :
PI_n = n times (cosinus(180 minus 360/n))/2
That gives values for PI_n for polygones :
with two angles : 2
with three angles : 2.598
with four angles : 2.828
with five angles : 2.939
with six angles : 3.000
with ten angles : 3.090
with twenty angles : 3.129
wiht thirty angles : 3.136
with fourty angles : 3.138
with 100 angles : 3.141
with 500 angles : 3.14157
with 1,000 angles : 3.141587
with 10,000 angles : 3.14159260
with 100,000 angles : 3.14159265
with 1,000,000 angles : 3.14159 26536 3325
As PI equals 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 and something more, according to wikipedia, you can see that my formula exaggerates it a little bit : my tenth digit after the decimal point is 6 in stead of 5.
But for the rest it looks like a good approach.
And the beauty of it is that it works also with decimals !
So you can calculate PI for a polygon with for example 7.359 angles !