Skip to content

Commit 35bf0c7

Browse files
committed
Fix
1 parent 192e237 commit 35bf0c7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/S2EdgeUtil.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ public struct XYZPruner {
232232
// it will be very small but for some large arcs (ie. from (1N,90W) to
233233
// (1N,90E) the path can be wildly deformed. I did a bunch of
234234
// experiments with geodesics to get safe bounds for the deformation.
235-
let approxArcLen = abs(from.x - to.x) + abs(from.y - to.y) + abs(from.z - to.z)
235+
let absX = abs(from.x - to.x)
236+
let absY = abs(from.y - to.y)
237+
let absZ = abs(from.z - to.z)
238+
let approxArcLen = absX + absY + absZ
236239
if approxArcLen < 0.025 { // less than 2 degrees
237240
maxDeformation = max(maxDeformation, approxArcLen * 0.0025)
238241
} else if approxArcLen < 1.0 { // less than 90 degrees

0 commit comments

Comments
 (0)