| @@ 20-27 (lines=8) @@ | ||
| 17 | px = x.call(hexbin, point, i) / dx - (pj & 1 ? .5 : 0), pi = Math.round(px), |
|
| 18 | py1 = py - pj; |
|
| 19 | ||
| 20 | if (Math.abs(py1) * 3 > 1) { |
|
| 21 | var px1 = px - pi, |
|
| 22 | pi2 = pi + (px < pi ? -1 : 1) / 2, |
|
| 23 | pj2 = pj + (py < pj ? -1 : 1), |
|
| 24 | px2 = px - pi2, |
|
| 25 | py2 = py - pj2; |
|
| 26 | if (px1 * px1 + py1 * py1 > px2 * px2 + py2 * py2) pi = pi2 + (pj & 1 ? 1 : -1) / 2, pj = pj2; |
|
| 27 | } |
|
| 28 | ||
| 29 | var id = pi + "-" + pj, bin = binsById[id]; |
|
| 30 | if (bin) bin.push(point); else { |
|
| @@ 5017-5017 (lines=1) @@ | ||
| 5014 | var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix; |
|
| 5015 | if (!plby2) return lfocx; |
|
| 5016 | var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2; |
|
| 5017 | if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx; |
|
| 5018 | return (rfocx + lfocx) / 2; |
|
| 5019 | } |
|
| 5020 | function d3_geom_voronoiRightBreakPoint(arc, directrix) { |
|