MCPcopy Create free account
hub / github.com/microsoft/SandDance / findSplitIndex

Function findSplitIndex

docs/app/js/sanddance-app.js:102518–102529  ·  view source on GitHub ↗
(positions, size, startIndex, endIndex)

Source from the content-addressed store, hash-verified

102516 return parts;
102517}
102518function findSplitIndex(positions, size, startIndex, endIndex) {
102519 let maxLat = -1;
102520 let pointIndex = -1;
102521 for(let i = startIndex + 1; i < endIndex; i += size){
102522 const lat = Math.abs(positions[i]);
102523 if (lat > maxLat) {
102524 maxLat = lat;
102525 pointIndex = i - 1;
102526 }
102527 }
102528 return pointIndex;
102529}
102530function insertPoleVertices(positions, size, startIndex, endIndex, maxLatitude = DEFAULT_MAX_LATITUDE) {
102531 const firstLng = positions[startIndex];
102532 const lastLng = positions[endIndex - size];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected