PI
https://www.mathsisfun.com/numbers/pi.html
Draw a circle with a diameter (all the way across the circle) of 1
Then the circumference (all the way around the circle) is 3.14159265... a number known as Pi
Pi (pronounced like "pie") is often written using the greek symbol π
The definition of π is:
The Circumference
divided by the Diameter
of a Circle.The circumference divided by the diameter of a circle is always π, no matter how large or small the circle is!
To help you remember what π is ... just draw this diagram.
Finding Pi Yourself
Draw a circle, or use something circular like a plate.
Measure around the edge (the circumference):
I got 82 cmMeasure across the circle (the diameter):
I got 26 cmDivide:
82 cm / 26 cm = 3.1538...
That is pretty close to π. Maybe if I measured more accurately?
割圓術
https://www.zhihu.com/question/342855331
作者:大的要來了
鏈接:https://www.zhihu.com/question/342855331/answer/2032705657
來源:知乎
著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。
內割法公式推導
內割法代碼實現
https://github.com/fanqingsong/code_snippet/blob/master/CPP/calc_pi.cpp
#include <iostream> #include <cmath> using namespace std; double getEdgeLen(int cutnum) { int halfCutnum = cutnum / 2; double edgeLen = 0; double halfEdgeLen = 0; if (cutnum == 6) { return 1; } halfEdgeLen = getEdgeLen(halfCutnum); edgeLen = sqrt(2 - sqrt(4 - pow(halfEdgeLen, 2))); return edgeLen; } bool checkCutnum(int cutnum) { if (cutnum < 6) { cout << "cutnum is a positive integer greater than and equal to 6, please correct." << endl; return false; } if (cutnum % 6 != 0) { cout << "cutnum must be times 6, please correct." << endl; return false; } while (true) { if (cutnum % 2 == 0) { cutnum /= 2; continue; } if (cutnum != 3) { cout << "cutnum must be 2 power times 6." << endl; return false; } } return true; } int main() { int cutnum = 0; double edgeLen = 0; double quasiPerimeter = 0; double quasiPI = 0; //printf("hello world\r\n"); cout << "please input cutnum for cutting circle, like 6, 12, 24, 48, ..." << endl; cin >> cutnum; cout << "cutnum is " << cutnum << endl; if (!checkCutnum(cutnum)) { return 0; } edgeLen = getEdgeLen(cutnum); quasiPerimeter = cutnum * edgeLen; quasiPI = quasiPerimeter / 2; cout << "the quasi PI is " << quasiPI << endl; return 0; }
開方手動計算方法
https://www.zhihu.com/question/347197295/answer/832181439
作者:曹力科
鏈接:https://www.zhihu.com/question/347197295/answer/832181439
來源:知乎
著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。
那么如何在沒有計算器的時候徒手開平方呢?
現代有一種方法的原理是這樣的。
以求3的平方根為例子,方法如下:
![]()
一時沒看懂沒關系,可以收藏以后慢慢看。
好了,如果你能看到這里,那么恭喜你,你也可以像祖沖之一樣,徒手去算圓周率了。
穿越回到那個時代,別忘了要一個大廣場,再加連起來可以繞地球一圈的算籌。