Shop More Submit  Join Login
This is a simulation which uses a cannon to calculate PI.

Given a circular pond in a square field where the pond and field have the same diameter, we fire a cannon into the field over and over, hitting randomly and count the number of times we hit the pond.

Because the area of a square is (W squared) where "W" is the width of the square and because the area of a circle is (PI times D squared) where "D" is the diameter of the circle, if a circle and square have the same width, the ratio of the area of the circle to the area of the square is PI / 4.

So we keep shooting cannonballs into the field and then we check the ratio of times we hit the pond divided by the times we fired in total. Take that ratio, multiply by 4 and we get our current guess at the value of PI. As the number of cannonballs fired increases, we should get closer and closer to PI.

Keep in mind that, while this is a valid method of calculating PI, it is also very inefficient as each additional digit of accuracy requires 10x as many shots as the previous digit.
Add a Comment:
 
Flagged as Spam
Flagged as Spam
:iconnightingale2012:
Nightingale2012 Featured By Owner Jun 27, 2011
how long can this go on??!! I left it on left and came back and it was still shooting! Is there a limit??!!
Reply
:iconavoidingcliches:
AvoidingCliches Featured By Owner Jun 5, 2010
Very nice. We'll keep working on the "random" bit. What did you use for this?
Reply
:icondovsherman:
DovSherman Featured By Owner Jun 8, 2010
I'm sorry but I don't understand the question. Use for what?
Reply
:iconavoidingcliches:
AvoidingCliches Featured By Owner Jun 8, 2010
As in, did you write the code for this? And what program did you use for the graphics?

I'm no computer guy, just mathy and physicsy. I am interested in what exactly you're running here...

I'm afraid my questions are vague because my understanding is similarly vague...
Reply
:icondovsherman:
DovSherman Featured By Owner Jun 10, 2010
Oh, I see. It's a very simple Flash-based program, written with Flash Actionscript. I made the graphics myself - the canon using Swift3D and the rest with the simple graphics editor built into Flash.
Reply
:iconmimin-photography:
Mimin-Photography Featured By Owner May 3, 2009
This is so amazing...so simple and yet - brilliant.
Reply
:iconbozar88:
Bozar88 Featured By Owner Nov 22, 2008
isn't it somehow connected with the integral over the circular path?
Reply
:icontapeking:
tapeking Featured By Owner Apr 26, 2008
Wow... Thats an interesting way to calculate pi. I wish we did something like this in my math class.
Reply
Add a Comment: