1. 首页
  2. 考试认证
  3. 其它
  4. box intersect 1d 报告一维区间集合中的所有交叉点

box intersect 1d 报告一维区间集合中的所有交叉点

上传者: 2024-10-05 04:56:58上传 ZIP文件 5.07KB 热度 2次
框相交1d查找区间集合中的所有交叉点。例子全路口以下是如何使用此模块检测一组区间中的所有交叉点: var boxIntersect1D = require ( 'box-intersect-1d' ) var boxes = [ [ 0 , 1 ] , [ 0 , 2 ] , [ 10 , 100 ] , [ 5 , 8 ] , [ 1.5 , 7 ] ] boxIntersect1D . full ( boxes , function ( i , j ) { console . log ( i , j ) console . log ( 'overlap:' , boxes [ i ] , boxes [ j ] ) } )输出overlap: [ 0, 1 ] [ 0, 2 ] overlap: [ 1.5, 7 ] [ 0, 2 ] o
下载地址
用户评论