Can You Calculate Pi by Drawing a Circle?

栏目: IT技术 · 发布时间: 4年前

内容简介:If you think about it, pi is really weird. This irrational number shows up in the craziest places. If you swing a mass back and forth on string,Of course, most people associate pi with circles. That's understandable, since the most basic definition of pi i

If you think about it, pi is really weird. This irrational number shows up in the craziest places. If you swing a mass back and forth on string, there's a pi in there . It pops up in the Heisenberg uncertainty principle , Einstein's general relativity, and the interaction between two electric charges.

Of course, most people associate pi with circles. That's understandable, since the most basic definition of pi is the ratio of the circumference to the diameter of a circle:

Illustration: Rhett Allain

Now for the important part. Tomorrow, as you may know, is Pi Day. Why tomorrow? Because it’s March 14—yes, 3/14—and 3.14 is the value of pi to two decimals. Of course, the actual number continues to an infinite number of decimal places: 3.14159265359 … and so on forever. That’s why it’s called irrational.

I should add that the US is pretty much the only place that uses the middle-endian date format of month/day/year. If you go with the little-endian format of day/month/year, then today is 14/3—which is obviously not pi. (In that case I suggest July 22, since the fraction 7/22 is a fairly decent approximation for pi.)

Anyway, my traditional way of celebrating Pi Day is to find a new way each year of calculating a numerical value for pi. It's just what I do. I've been at this for quite some time now, so here are some of my favorites:

I have even more Pi Day posts here . But now let's try this a new way. Let’s see how close we can get to pi by drawing a circle.

Here's how this will work. You draw a circle. From that circle, you can determine both the circumference and the radius. Then the value of pi would be the circumference divided by twice the radius. Simple, right?

Oh, but what if your circle isn't perfect? I mean, who draws perfect circles anyway? Let's imagine that this un-perfect circle is actually a bunch of discrete points connected by line segments. If you zoomed on a part of it, it might look like this:


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

分布式算法导论

分布式算法导论

泰尔 / 霍红卫 / 机械工业出版社 / 2004年09月 / 39.0

分布式算法20多年来一直是倍受关注的主流方向。本书第二版不仅给出了算法的最新进展,还深入探讨了与之相关的理论知识。这本教材适合本科高年级和研究生使用,同时,本书所覆盖的广度和深度也十分适合从事实际工作的工程师和研究人员参考。书中重点讨论了点对点消息传递模型上的算法,也包括计算机通信网络的实现算法。其他重点讨论的内容包括分布式应用的控制算法(如波算法、广播算法、选举算法、终止检测算法、匿名网络的随机......一起来看看 《分布式算法导论》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换