@@ -622,7 +622,7 @@ func (c Cell) distanceInternal(targetXYZ Point, toInterior bool) s1.ChordAngle {
622622 // arbitrary quadrilaterals after they are projected onto the sphere.
623623 // Therefore the simplest approach is just to find the minimum distance to
624624 // any of the four edges.
625- return minChordAngle (edgeDistance (- dir00 , c .uv .X .Lo ),
625+ return min (edgeDistance (- dir00 , c .uv .X .Lo ),
626626 edgeDistance (dir01 , c .uv .X .Hi ),
627627 edgeDistance (- dir10 , c .uv .Y .Lo ),
628628 edgeDistance (dir11 , c .uv .Y .Hi ))
@@ -633,7 +633,7 @@ func (c Cell) distanceInternal(targetXYZ Point, toInterior bool) s1.ChordAngle {
633633 // tests above, because (1) the edges don't meet at right angles and (2)
634634 // there are points on the far side of the sphere that are both above *and*
635635 // below the cell, etc.
636- return minChordAngle (c .vertexChordDist2 (target , false , false ),
636+ return min (c .vertexChordDist2 (target , false , false ),
637637 c .vertexChordDist2 (target , true , false ),
638638 c .vertexChordDist2 (target , false , true ),
639639 c .vertexChordDist2 (target , true , true ))
@@ -651,7 +651,7 @@ func (c Cell) MaxDistance(target Point) s1.ChordAngle {
651651 // First check the 4 cell vertices. If all are within the hemisphere
652652 // centered around target, the max distance will be to one of these vertices.
653653 targetUVW := faceXYZtoUVW (int (c .face ), target )
654- maxDist := maxChordAngle (c .vertexChordDist2 (targetUVW , false , false ),
654+ maxDist := max (c .vertexChordDist2 (targetUVW , false , false ),
655655 c .vertexChordDist2 (targetUVW , true , false ),
656656 c .vertexChordDist2 (targetUVW , false , true ),
657657 c .vertexChordDist2 (targetUVW , true , true ))
@@ -685,7 +685,7 @@ func (c Cell) DistanceToEdge(a, b Point) s1.ChordAngle {
685685
686686 // First, check the minimum distance to the edge endpoints A and B.
687687 // (This also detects whether either endpoint is inside the cell.)
688- minDist := minChordAngle (c .Distance (a ), c .Distance (b ))
688+ minDist := min (c .Distance (a ), c .Distance (b ))
689689 if minDist == 0 {
690690 return minDist
691691 }
@@ -717,7 +717,7 @@ func (c Cell) MaxDistanceToEdge(a, b Point) s1.ChordAngle {
717717 // If the maximum distance from both endpoints to the cell is less than π/2
718718 // then the maximum distance from the edge to the cell is the maximum of the
719719 // two endpoint distances.
720- maxDist := maxChordAngle (c .MaxDistance (a ), c .MaxDistance (b ))
720+ maxDist := max (c .MaxDistance (a ), c .MaxDistance (b ))
721721 if maxDist <= s1 .RightChordAngle {
722722 return maxDist
723723 }
0 commit comments