deviant art

Deviant Login Shop  Join deviantART for FREE Take the Tour
[x]
Download File
SWF, 10.9 KB
more ▶

More from ~DovSherman

Featured in Groups:

Details

November 25, 2005
10.9 KB
500×550
Thumb

Statistics

Comments: 39
Favourites: 50 [who?]

Views: 11,176 (0 today)
Downloads: 637 (0 today)
[x]
:icondovsherman:
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:
 
love 1 1 joy 0 0 wow 0 0 mad 0 0 sad 0 0 fear 0 0 neutral 0 0
:icontheghostdragon93:
*theghostdragon93 20 hours ago  Student General Artist
this
is
not
a
joke!
carry
on
reading!
or
you
will
die,
even
if
you
only
looked
at
the
word
warning!


ONCE
THERE
WAS
A
LITTLE
GIRL
CALLED
CLARISSA,
SHE
WAS
10
YEARS
OLD
AND
SHE
LIVED
IN
A
MENTAL
HOSPITAL,
BEACUSE
SHE
KILLED
HER
MUM
AND
DAD.








SHE
GOT
SO
BAD
SHE
STARTED
TO
KILL
ALL
THE
STAFF
IN
THE
HOSPITAL
SO
THE
GOVERMENT
DECIDED
THAT
THE
BEST
IDEA
WAS
TO
GET
RID
OF
HER
SO
THEY
SET
UP
A
SPECIAL
ROOM
TO
KILL
HER,
AS
HUMANE
AS
POSSIBLE
BUT
IT
WENT
RONG
THE
MACHINE
THEY
WERE
USEING
WENT
WRONG.








AND
SHE
WAS
SAT
THERE
IN
AGONY
FOR
HOURS
UNTILL
SHE
FINALLY
DIED.








NOW
EVERY
WEEK
ON
THE
DAY
OF
HER
DEATH
SHE
RETURNS
TO THE
PERSON
THAT
READS
THIS
LETTER,
ON
A
MONDAY
NIGHT
AT
12:00
SHE
KREEPS
INTO
YOUR
ROOM
AND
KILLS
YOU,
BUT
SLOWLY
AND
PAINFULLY
SLOWLY
CUTTING
DIFFRENT
PARTS
OF
UR
BODY
THEN
WATCHES
YOU
BLEED
TO
DEATH
IF
YOU
DONT
SEND
THIS
TO
20
PEOPLE
BY
MIDNIGHT
SHELL
BE
COMEING
TO KILL
YOU!
SEND
IT
SO
SHE
HAS
ANOTHER
LOAD
OF
PEOPLE
TO
GET
AND
FORGETS
ABOUT
YOU
DONT
BELVE ME
HEY?

EXAMPLE
1:
JENNY
DIDNT BELIVE THIS AND DELETED IT WITHOUT EVEN READING THE WHOLE THING! A FEW DAYS LATER ON THE MONDAY NIGHT SHE WAS WOKEN UP BYE LOUDE FOOTSTEPS AND HEAVY BREETHING THERE WAS CLARISSA STANDING THERE WITH A HUGE KNIFE AND WELL JENNY IS HISTORY NOW.









EXAMPLE
2:
TOM
ONLY SENT IT TO 5 PEOPLE CUZ HE THOUGHT HED BE SAFE AND IT WAS PROBLY JUST A JOKE BUT OH HOW RONG WAS HE! HE DIED THE NEXT NIGHT ON MONDAY AND ILL TELL YA NOW IT WASNT PRETTY(JUST CUZ HE SENT FIVE HE DIDNT COMPLETE THE TASK)

EXAMPLE
3:
JOEANNA
SENT IT TO 19 PEOPLE SHE THOUGHT IT WAS CLOSE ENOUGH AND WOULD DO BUT SHE WAS WRONG SHE DIED THAT NIGHT ON A MONDAY AND ONCE AGAIN IT WASNT
Reply
:iconorochirin:
~OrochiRin Oct 6, 2012  Student Digital Artist
this
is
not
a
joke!
carry
on
reading!
or
you
will
die,
even
if
you
only
looked
at
the
word
warning!


ONCE
THERE
WAS
A
LITTLE
GIRL
CALLED
CLARISSA,
SHE
WAS
10
YEARS
OLD
AND
SHE
LIVED
IN
A
MENTAL
HOSPITAL,
BEACUSE
SHE
KILLED
HER
MUM
AND
DAD.








SHE
GOT
SO
BAD
SHE
STARTED
TO
KILL
ALL
THE
STAFF
IN
THE
HOSPITAL
SO
THE
GOVERMENT
DECIDED
THAT
THE
BEST
IDEA
WAS
TO
GET
RID
OF
HER
SO
THEY
SET
UP
A
SPECIAL
ROOM
TO
KILL
HER,
AS
HUMANE
AS
POSSIBLE
BUT
IT
WENT
RONG
THE
MACHINE
THEY
WERE
USEING
WENT
WRONG.








AND
SHE
WAS
SAT
THERE
IN
AGONY
FOR
HOURS
UNTILL
SHE
FINALLY
DIED.








NOW
EVERY
WEEK
ON
THE
DAY
OF
HER
DEATH
SHE
RETURNS
TO THE
PERSON
THAT
READS
THIS
LETTER,
ON
A
MONDAY
NIGHT
AT
12:00
SHE
KREEPS
INTO
YOUR
ROOM
AND
KILLS
YOU,
BUT
SLOWLY
AND
PAINFULLY
SLOWLY
CUTTING
DIFFRENT
PARTS
OF
UR
BODY
THEN
WATCHES
YOU
BLEED
TO
DEATH
IF
YOU
DONT
SEND
THIS
TO
20
PEOPLE
BY
MIDNIGHT
SHELL
BE
COMEING
TO KILL
YOU!
SEND
IT
SO
SHE
HAS
ANOTHER
LOAD
OF
PEOPLE
TO
GET
AND
FORGETS
ABOUT
YOU
DONT
BELVE ME
HEY?

EXAMPLE
1:
JENNY
DIDNT BELIVE THIS AND DELETED IT WITHOUT EVEN READING THE WHOLE THING! A FEW DAYS LATER ON THE MONDAY NIGHT SHE WAS WOKEN UP BYE LOUDE FOOTSTEPS AND HEAVY BREETHING THERE WAS CLARISSA STANDING THERE WITH A HUGE KNIFE AND WELL JENNY IS HISTORY NOW.









EXAMPLE
2:
TOM
ONLY SENT IT TO 5 PEOPLE CUZ HE THOUGHT HED BE SAFE AND IT WAS PROBLY JUST A JOKE BUT OH HOW RONG WAS HE! HE DIED THE NEXT NIGHT ON MONDAY AND ILL TELL YA NOW IT WASNT PRETTY(JUST CUZ HE SENT FIVE HE DIDNT COMPLETE THE TASK)

EXAMPLE
3:
JOEANNA
SENT IT TO 19 PEOPLE SHE THOUGHT IT WAS CLOSE ENOUGH AND WOULD DO BUT SHE WAS WRONG SHE DIED THAT NIGHT ON A MONDAY AND ONCE AGAIN IT WASNT
Reply
:iconnightingale2012:
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:
Very nice. We'll keep working on the "random" bit. What did you use for this?
Reply
:icondovsherman:
I'm sorry but I don't understand the question. Use for what?
Reply
:iconavoidingcliches:
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:
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:
This is so amazing...so simple and yet - brilliant.
Reply
:iconbozar88:
isn't it somehow connected with the integral over the circular path?
Reply
:icontapeking:
Wow... Thats an interesting way to calculate pi. I wish we did something like this in my math class.
Reply
Add a Comment: