|
@@ 3662-3668 (lines=7) @@
|
| 3659 |
|
r = y1 - ay; |
| 3660 |
|
if (!dy && r < 0) return; |
| 3661 |
|
r /= dy; |
| 3662 |
|
if (dy < 0) { |
| 3663 |
|
if (r > t1) return; |
| 3664 |
|
if (r > t0) t0 = r; |
| 3665 |
|
} else if (dy > 0) { |
| 3666 |
|
if (r < t0) return; |
| 3667 |
|
if (r < t1) t1 = r; |
| 3668 |
|
} |
| 3669 |
|
if (t0 > 0) line.a = { |
| 3670 |
|
x: ax + t0 * dx, |
| 3671 |
|
y: ay + t0 * dy |
|
@@ 3652-3658 (lines=7) @@
|
| 3649 |
|
r = y0 - ay; |
| 3650 |
|
if (!dy && r > 0) return; |
| 3651 |
|
r /= dy; |
| 3652 |
|
if (dy < 0) { |
| 3653 |
|
if (r < t0) return; |
| 3654 |
|
if (r < t1) t1 = r; |
| 3655 |
|
} else if (dy > 0) { |
| 3656 |
|
if (r > t1) return; |
| 3657 |
|
if (r > t0) t0 = r; |
| 3658 |
|
} |
| 3659 |
|
r = y1 - ay; |
| 3660 |
|
if (!dy && r < 0) return; |
| 3661 |
|
r /= dy; |
|
@@ 3642-3648 (lines=7) @@
|
| 3639 |
|
r = x1 - ax; |
| 3640 |
|
if (!dx && r < 0) return; |
| 3641 |
|
r /= dx; |
| 3642 |
|
if (dx < 0) { |
| 3643 |
|
if (r > t1) return; |
| 3644 |
|
if (r > t0) t0 = r; |
| 3645 |
|
} else if (dx > 0) { |
| 3646 |
|
if (r < t0) return; |
| 3647 |
|
if (r < t1) t1 = r; |
| 3648 |
|
} |
| 3649 |
|
r = y0 - ay; |
| 3650 |
|
if (!dy && r > 0) return; |
| 3651 |
|
r /= dy; |
|
@@ 3632-3638 (lines=7) @@
|
| 3629 |
|
r = x0 - ax; |
| 3630 |
|
if (!dx && r > 0) return; |
| 3631 |
|
r /= dx; |
| 3632 |
|
if (dx < 0) { |
| 3633 |
|
if (r < t0) return; |
| 3634 |
|
if (r < t1) t1 = r; |
| 3635 |
|
} else if (dx > 0) { |
| 3636 |
|
if (r > t1) return; |
| 3637 |
|
if (r > t0) t0 = r; |
| 3638 |
|
} |
| 3639 |
|
r = x1 - ax; |
| 3640 |
|
if (!dx && r < 0) return; |
| 3641 |
|
r /= dx; |
|
@@ 3139-3144 (lines=6) @@
|
| 3136 |
|
d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; |
| 3137 |
|
d3.geo.stream(object, d3_geo_centroid); |
| 3138 |
|
var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z; |
| 3139 |
|
if (m < ε2) { |
| 3140 |
|
x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1; |
| 3141 |
|
if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0; |
| 3142 |
|
m = x * x + y * y + z * z; |
| 3143 |
|
if (m < ε2) return [ NaN, NaN ]; |
| 3144 |
|
} |
| 3145 |
|
return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ]; |
| 3146 |
|
}; |
| 3147 |
|
var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2; |
|
@@ 3025-3025 (lines=1) @@
|
| 3022 |
|
bound.point = point; |
| 3023 |
|
bound.lineStart = lineStart; |
| 3024 |
|
bound.lineEnd = lineEnd; |
| 3025 |
|
if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90; |
| 3026 |
|
range[0] = λ0, range[1] = λ1; |
| 3027 |
|
} |
| 3028 |
|
}; |