Friday, November 07, 2008

Circle

So I was trying out this Processing programming environment, which is basically a framework that lets you do rapid prototyping of visualization-type programs in Java, when one of their examples reminded me of a couple of things:

  1. Florentine Renaissance painter Giotto di Bondone, who, when asked by an emissary of the Pope for a demonstration of his work, dipped a brush in red paint and in one stroke created a perfect circle.
  2. The popular assertion that 2 Chronicles 4:2 contradicts any claims of Judeo-Christian divine infallibility by providing Jews with one of the worst ancient approximations of π. (The passage, if you're not familiar, states that King Solomon had a pot made which was 10 cubits in diameter and 30 in circumference; a cubit is about half a meter.)

The applet I produced, then, should have something for everybody. You can try your hand at matching Giotto's remarkable achievement, confirm the difficulties of producing a perfectly round circular object of a large size, investigate the properties of other convex shapes, or use the applet as a medium for art.





Since A = π r^2 and C = 2 π r, given a circle-like shape we can measure the area and circumference and then calculate π = C^2/4A. Here the circumference and area are calculated by dividing the circle into wedges and using s = r θ and A = 1/2 r^2 θ for an arc and circular wedge, respectively. (We can't just divide the circumference by the diameter as the shape, being imperfect, will have different diameters at different angles.)

A circle has minimal area for a given circumference, and diameter is directly proportional to circumference, so estimates of π calculated by dividing a circumference by a diameter will be too low; similarly, calculating π by the method above will give overestimates. If you can get your circle to give π < 3.3 consistently, you're a better artist than I am.

What would you expect if you drew a square instead of a circle? Work it out on paper, then try it out and check your answer. No peeking! If you want source code, it's available over at

http://www.geocities.com/dan131m/circlesketch/



0 comments: