随笔分类 -  计算几何

acm设计竞赛计算几何
摘要:demo地址:http://www.caoke.xyz/ 阅读全文
posted @ 2019-03-18 11:36 无工时代 阅读(171) 评论(0) 推荐(0) 编辑
摘要:const Point=require('./Point') const Line=require('./Line') //多边形类 function Polygon(a) { if(this instanceof Polygon){ this.n=a.length; this.a=a; }else{ if(a.every(func... 阅读全文
posted @ 2019-03-14 16:51 无工时代 阅读(228) 评论(0) 推荐(0) 编辑
摘要:const Point=require('./Point') //计算几何线段类 function Line(a,b) { if(this instanceof Line){ this.a=a; this.b=b; }else{ if(a instanceof Point&&b instanceof Point){ ... 阅读全文
posted @ 2019-03-14 16:08 无工时代 阅读(174) 评论(0) 推荐(0) 编辑
摘要://计算几何误差修正 Math.EPS=0.00000001; //判断x的符号 Math.cmp=function(x) { if(Math.abs(x)0){ return 1; }else{ return -1; } } //计算几何点类 function Point(x,y) { if(this instanceof Poi... 阅读全文
posted @ 2019-03-14 13:25 无工时代 阅读(231) 评论(0) 推荐(0) 编辑
摘要://计算几何误差修正 Math.EPS=0.00000001; //判断x的符号 Math.cmp=function(x) { if(Math.abs(x)0){ return 1; }else{ return -1; } } console.log(Math.cmp(0.1+0.2-0.3)) console.log(Math.cmp(... 阅读全文
posted @ 2019-03-14 11:03 无工时代 阅读(230) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示