mathPI:通过java swing模拟随机点的产生计算圆周率π的近似值-源码

上传者: 42131798 | 上传时间: 2021-05-29 19:08:19 | 文件大小: 24KB | 文件类型: ZIP
mathPI 通过java swing模拟随机点的产生计算圆周率π的近似值 主函数在cotroller包中 程序中在画布上画出一个正方形与圆形,圆形为正方形的内部最大圆, 如何模拟计算π值 由很多随机点出现在圆形与正方形中的比列进行计算 π=4 * 圆内点数 / 正方形内点数 存在问题: 由于程序中每次绘制画布都是将所有点进行绘制,所以当点数到达一定数量的时候ui线程便会阻塞导致点击窗口关闭按钮未能及时响应,所以可在控制台强制关闭 解决方法: 每次绘制不全部重新绘制,只绘制新增点即可

文件下载

资源详情

[{"title":"( 20 个子文件 24KB ) mathPI:通过java swing模拟随机点的产生计算圆周率π的近似值-源码","children":[{"title":"mathPI-master","children":[{"title":"README.md <span style='color:#111;'> 703B </span>","children":null,"spread":false},{"title":"out","children":[{"title":"production","children":[{"title":"mathPI","children":[{"title":"cn","children":[{"title":"sharhe","children":[{"title":"mathPI","children":[{"title":"utils","children":[{"title":"AlgoVisHelper.class <span style='color:#111;'> 4.46KB </span>","children":null,"spread":false}],"spread":true},{"title":"handle","children":[{"title":"PointHandle.class <span style='color:#111;'> 1.60KB </span>","children":null,"spread":false}],"spread":true},{"title":"controller","children":[{"title":"CircleController.class <span style='color:#111;'> 2.18KB </span>","children":null,"spread":false}],"spread":true},{"title":"fram","children":[{"title":"AlgoJFrame$1.class <span style='color:#111;'> 222B </span>","children":null,"spread":false},{"title":"AlgoJFrame.class <span style='color:#111;'> 1.34KB </span>","children":null,"spread":false},{"title":"AlgoJFrame$AlgoJPanl.class <span style='color:#111;'> 2.85KB </span>","children":null,"spread":false}],"spread":true},{"title":"beans","children":[{"title":"Point.class <span style='color:#111;'> 646B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"mathPI.iml <span style='color:#111;'> 423B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"cn","children":[{"title":"sharhe","children":[{"title":"mathPI","children":[{"title":"utils","children":[{"title":"AlgoVisHelper.java <span style='color:#111;'> 3.62KB </span>","children":null,"spread":false}],"spread":true},{"title":"handle","children":[{"title":"PointHandle.java <span style='color:#111;'> 1.53KB </span>","children":null,"spread":false}],"spread":true},{"title":"controller","children":[{"title":"CircleController.java <span style='color:#111;'> 1.53KB </span>","children":null,"spread":false}],"spread":true},{"title":"fram","children":[{"title":"AlgoJFrame.java <span style='color:#111;'> 2.46KB </span>","children":null,"spread":false}],"spread":true},{"title":"beans","children":[{"title":"Point.java <span style='color:#111;'> 513B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".idea","children":[{"title":"uiDesigner.xml <span style='color:#111;'> 8.59KB </span>","children":null,"spread":false},{"title":"workspace.xml <span style='color:#111;'> 27.97KB </span>","children":null,"spread":false},{"title":"encodings.xml <span style='color:#111;'> 200B </span>","children":null,"spread":false},{"title":"vcs.xml <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"misc.xml <span style='color:#111;'> 273B </span>","children":null,"spread":false},{"title":"modules.xml <span style='color:#111;'> 252B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明