Skip to content

A small program which use the ActionScript3 to calculate the PI

License

Notifications You must be signed in to change notification settings

wuhan005/Calculate-PI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Calculate-PI

A small program which use the ActionScript3 to calculate the PI

使用数学中的几何概形来计算圆周率。 具体思路就是随机生成点,然后依据点的(x,y)坐标来计算与圆心的距离,来判断是否落在圆内。

最初将times设置成与题目一样的1000次,得到结果为:3.188 并不是那么准确啊,接着不断把times增大,一直增大到播放器能承受的极限:99999999(虽然这不是CPU的极限,但是Flash播放器在计算超过15s后便会自动停止)

最后得出的结果:3.1416809514168094,大概范围在3.1414-3.1416之间。

About

A small program which use the ActionScript3 to calculate the PI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published