Author |
Message |
BenLi

|
Posted: Tue Oct 24, 2006 8:25 pm Post subject: pi |
|
|
This has to be the most retarded thing i've ever posted... but entertaining (and interesting) nonetheless
code: |
setscreen ("graphics:max;max")
var x := 0
drawfilloval (maxx div 2, maxy div 2, maxy div 2, maxy div 2, black)
for i : 1 .. maxx
for n : 1 .. maxy
if whatdotcolor (i, n) = black then
x += 1
end if
end for
end for
put "pi is: ", x / (maxy div 2) ** 2
| [/quote] |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
ericfourfour
|
Posted: Tue Oct 24, 2006 9:33 pm Post subject: (No subject) |
|
|
That was pretty funny. I didn't even go over the source before I ran it because it looked like another flashy program (it was like 10 lines with 1 draw in a loop) but then all I saw was a big black circle. Then I actually looked at the source and wow. That is one of the most original ways of finding pi ever. |
|
|
|
|
 |
Tony

|
|
|
|
 |
Zacebdal
|
Posted: Wed Oct 25, 2006 3:08 pm Post subject: Is it just me? |
|
|
Is it just me, or maybe i just dont understand but if this is used to find the mathematical value of pi, it is incorrect. Pi, as far as i know and im proud of knowing it ,is approximately 3.14159265358979. so maybe im just doing something wrong but anyways.... |
|
|
|
|
 |
BenLi

|
Posted: Wed Oct 25, 2006 4:16 pm Post subject: (No subject) |
|
|
consider this: with 50 digits of pi, you are able to calculate the biggest circle possible in the observable universe down to the error margin of a single proton. The inversely, you would need a circle as big as the universe to calculate pi to 50 digits (unless you use a computer to simulate this). So obviously this program wouldn't be accurate since the circle is only the size of your moniter. Its accurate to tw digits though! lol |
|
|
|
|
 |
Clayton

|
Posted: Wed Oct 25, 2006 4:16 pm Post subject: (No subject) |
|
|
It's because the circle isn't big enough to get that degree of accuracy. To get that good of a degree of accuracy you would have to have a HUGE circle to calculate from. |
|
|
|
|
 |
ZeroPaladn
|
|
|
|
 |
Silent Avenger

|
Posted: Thu Oct 26, 2006 3:45 pm Post subject: (No subject) |
|
|
Now how do you know that all those decimal places are correct? Now just for laughs I'm going to print off the first page and show it to my Geometry teacher. |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
iamcow
|
Posted: Thu Oct 26, 2006 4:44 pm Post subject: (No subject) |
|
|
Quote: not sure if it is a reliable source
i think that means he's not sure |
|
|
|
|
 |
Silent Avenger

|
Posted: Thu Oct 26, 2006 6:00 pm Post subject: (No subject) |
|
|
I meant that question to be a rhetorical question, of course the site will most likely be unreliable. |
|
|
|
|
 |
[Gandalf]

|
Posted: Thu Oct 26, 2006 6:59 pm Post subject: (No subject) |
|
|
Eh... What?
"Hmm... Why don't I make a website that outputs random numbers claiming to be pi.. Sounds good."
And, Zacebdal, just to show how much work it takes to calculate pi, here's the accuracy after just under one billion iterations of pi = 4 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11...:
3.141592652587059
Compared to the real approximation:
3.141592653589793 |
|
|
|
|
 |
Silent Avenger

|
Posted: Thu Oct 26, 2006 9:50 pm Post subject: (No subject) |
|
|
[Gandalf] wrote: Eh... What?
"Hmm... Why don't I make a website that outputs random numbers claiming to be pi.. Sounds good." I'm not saying it is an unreliable source but it could be. I also find the site has no real point to it because most people only really need pi to the accuracy of 8 decimal places. Now I'm not saying that everybody needs pi to only 8 decimal places because some could use more or less. |
|
|
|
|
 |
[Gandalf]

|
Posted: Fri Oct 27, 2006 2:53 pm Post subject: (No subject) |
|
|
Silent Avenger wrote: of course the site will most likely be unreliable.
Sounds pretty definite to me.
And why not have pi to some large number of decimal places? It's been computed, so why not make it available for everyone to use whenever? Even if it's just for curiosity. |
|
|
|
|
 |
Silent Avenger

|
Posted: Fri Oct 27, 2006 10:48 pm Post subject: (No subject) |
|
|
I guess there is no reason to not have pi to a billion decimal places but who would use that many decimal places anyway? (this is a rhetorical question you don't actually need to answer) |
|
|
|
|
 |
Andy
|
Posted: Sun Oct 29, 2006 5:00 am Post subject: (No subject) |
|
|
to find pi, just do an taylor expansion of tan(x). there are faster ways of approximating pi than that gandalf =P |
|
|
|
|
 |
|