|
|

楼主 |
发表于 2018-7-30 12:17
|
显示全部楼层
本帖最后由 elim 于 2018-7-29 21:28 编辑
关于割圆术,参考 wiki 百科
https://zh.wikipedia.org/wiki/%E5%89%B2%E5%9C%86%E6%9C%AF_(%E5%88%98%E5%BE%BD)
- compiled: Jul 4 2017, gcc version 4.9.1 (GCC)
- threading engine: single
- (readline v6.2 enabled, extended help enabled)
- Copyright (C) 2000-2017 The PARI Group
- PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER.
- Type ? for help, \q to quit.
- Type ?15 for how to get moral (and possibly technical) support.
- parisize = 4000000, primelimit = 500000
- (21:37) gp > \p 100
- realprecision = 105 significant digits (100 digits displayed)
- (21:38) gp > \\ Let's define two functions p and p3
- (21:38) gp > \\ p(n) returns the perimeter of inscribed n-sided regular polygon
- (21:38) gp > \\ p3(n) returns the perimeter of inscribed 3(2^n)-sided regular polygon
- (21:38) gp > p(n)=return(n*sin(Pi/n));
- (21:38) gp > p3(n)=my(s=-1);for(k=1,n,s=sqrt(2+s));return(3*2^(n-1)*sqrt(2-s));
- (21:39) gp > p(192)
- %3 = 3.141452472285462075450609308961225645247662304549675175821582774823679326212333494801353
- (21:40) gp > p3(6)
- %4 = 3.141452472285462075450609308961225645247662304549675175821582774823679326212333494801353
- (21:40) gp > w = 3 + sqrt(2)/10
- %5 = 3.141421356237309504880168872420969807856967187537694807317667973799073247846210703885038
- (21:40) gp > p(174)-w
- %6 = 6.133602074497902333075310506945118224887931254039223039283919389109215385091993202790 E-7
- (21:41) gp > p(173)-w
- %7 = -1.36553547089641779054787385645331751473057749441619638469196242072379029406538276300 E-6
- (21:41) gp > \\ Therefore p(173) < 3+sqrt(2)/10 < p(174) < Pi
- (21:42) gp > Pi
- %8 = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034
- (21:43) gp > 1/(%-3)
- %9 = 7.062513305931045769793005152570558042734310025145531333998316873555903337580056083503977
- (21:43) gp > 1/(%-7)
- %10 = 15.9965944066857198889230604047552746056716050315611208694786176996504682803929856120417
- (21:43) gp > 1/(%-15)
- %11 = 1.00341723101337260346414717528795359173645793099666172113867621168781314936975423704785
- (21:44) gp > 1/(%-1)
- %12 = 292.634591014395472378543695760411003010062573060302578389568743562178751611111964916129
- (21:44) gp > [3,3+1/7,3+1/(7+1/15),3+1/(7+1/(15+1/1)),3+1/(7+1/(15+1/(1+1/292)))]
- %13 = [3, 22/7, 333/106, 355/113, 103993/33102]
- (21:46) gp > 355/113. -Pi
- %14 = 2.66764189062422312368932886496333804051952327807343639478488643770704941443849841280 E-7
- (22:15) gp > Pi-333./106
- %15 = 8.32196275290875192471568644085445745278899411435568240011960814013119465863571186008 E-5
- (22:15) gp > \\ 333/106 < Pi < 355/113
复制代码
利用上面代码中的函数知道 p(1024) = 3.141587725277159700628854262701918739399280858574843286678421... |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|