Cool! is it possible that you could make N more than 30?I'm a bit late but my version shows up to 16 (or something like that) decimal places! (sorry to spam)
Sure, you could make the number of sides as large as you want...but it doesn't help the accuracy of the result much due to the crudeness of the technique and the inaccuracies mentioned in the notes.
Well, this was for Pi day (3/14) and I was familiar with how Aristotle (an ancient Greek math dude) came up with values of Pi using a method similar to this and I wanted to see if I could do computer version of it. Then, I added in the ant to make it more interesting!
you would have to use a LOT of math for it and probably the most complicated part is making the arrow work like on the game (pleese just make the arrow go to where u want it to but making it go in a ark will ba a challange and if u can't i understand but could u still try to mimick the rest of the game?)
HEY!!! hi p2s i found this REALLY good game that i think is fun and wondered if you could make it into scratch (it's a flash internet game) it's a REALLY good game so could u tell me if youre at least going to try the challange!
You mean a shape other than a circle? The method could still be used to measure the distance around the outside, as long as the shape didn't bend back on itself.
Increased the speed and accuracy of the intercept finding routine. The routine now appears to approach the correct value of Pi from below, with increasing number of sides, as I would expect.
This project calculates approximate values of Pi using only the distance formula by approximating the circle with regular polygons.
This is the technique an ant with a straight ruler might use if he wanted to calculate pi. He walks out from the center in opposite directions until he finds the circle edges to get the diameter.
Then, he divides the circle up into segments. He walks along each segment until he finds the edge of the circle and measures the distance to the last point on the circle, creating a polygon. By adding up the distances along the perimeter of the polygon, he gets an approximate circumference.
Dividing that by the diameter yields an approximate value of pi. The approximation will be more accurate if the polygon has more sides.
There are a couple of substantial inaccuracies in this calculation:
1. The circle is not perfect, it is approximated by a set of pixels.
2. The probe is also not a perfect circle, it is crudely approximated by a set of pixels
But despite that, the ant can get a pretty good result with only 30 sides or so. Not too shabby!
Note that the ant could save a lot of time by measuring one side of the polygon and multiplyiing by the number of sides (since these are regular polygons) but that wouldn't be nearly as much fun to watch!
Credit again goes to Kevin Karplus for his Print Decimal routine.
Comments
You need to be logged in to post comments
Add a Comment
cool good idea
Cool! is it possible that you could make N more than 30?I'm a bit late but my version shows up to 16 (or something like that) decimal places! (sorry to spam)
You have a method? I will check it out!
Sure, you could make the number of sides as large as you want...but it doesn't help the accuracy of the result much due to the crudeness of the technique and the inaccuracies mentioned in the notes.
Very hot! =)
How do you think of all these cool ideas?
Well, this was for Pi day (3/14) and I was familiar with how Aristotle (an ancient Greek math dude) came up with values of Pi using a method similar to this and I wanted to see if I could do computer version of it. Then, I added in the ant to make it more interesting!
(view all replies)well it also draws regualr shapes
This is really good and helpful
How do you make it do that!
I like this a lot. I have uploaded my own version which uses different technique.
This is so educational but in a good way of course!
uhhhhhhhhhhhhhhh.Im dumb as a rat
wow
man how do you make your projects like this!!
p2s i thought i saw that bug in my game that stupid backbutton thing is a bummer well i might work on it today but i wanted to make a game like froger
HAPPY EASTER!!!
Hi Paddle2See, I've shared the "Fractions-4" with your idea at (link to project)">(link to project)
Yo dude I made a sprite animator similar to pivot. You should check it out. Note it only works offline.
(link to project)">(link to project)
Cool project! That is one talented ant. :P
you would have to use a LOT of math for it and probably the most complicated part is making the arrow work like on the game (pleese just make the arrow go to where u want it to but making it go in a ark will ba a challange and if u can't i understand but could u still try to mimick the rest of the game?)
oh sorry here's the URL: http://armorgames.com/play/588/bowmaster-prelude
HEY!!! hi p2s i found this REALLY good game that i think is fun and wondered if you could make it into scratch (it's a flash internet game) it's a REALLY good game so could u tell me if youre at least going to try the challange!
you're right, this can be very innacurate, but it is still good. if you have to little sides, it doesnt even get to 3!
You mean a shape other than a circle? The method could still be used to measure the distance around the outside, as long as the shape didn't bend back on itself.
what woud hapem if you used a difrent shape???
Increased the speed and accuracy of the intercept finding routine. The routine now appears to approach the correct value of Pi from below, with increasing number of sides, as I would expect.
cool! :)
This is sort of a crude approximation of Archimedes technique. What more do you want - it's only an ant!