Skip to content

shc2012/piPerformancecalculations

Repository files navigation

compute π 计算π 蒙特卡洛方法 基于随机采样原理 在单位正方形内随机撒点 统计落在1/4圆内的点数比例 适合演示但收敛速度较慢 尼拉坎萨级数 使用收敛更快的级数公式: π = 3 + 4/(2×3×4) - 4/(4×5×6) + 4/(6×7×8) - ... 每项精度提高约3位小数 迭代次数与精度成正比 Monte Carlo Method Based on the principle of random sampling Generates random points within a unit square Counts the proportion of points falling within a quarter-circle Ideal for demonstration purposes but has a slow convergence rate Nilakantha Series Uses a rapidly converging series formula: π = 3 + 4/(2×3×4) – 4/(4×5×6) + 4/(6×7×8) – ... Each term improves accuracy by ~3 decimal places Number of iterations is proportional to the desired accuracy 老版Windows下载链接https://pan.312314.xyz/s/n2fA oudWindows Download https://pan.312314.xyz/s/n2fA

About

compute pi 计算圆周率

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages