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

Function shiftLongitudesIntoRange

docs/app/js/sanddance-app.js:102553–102563  ·  view source on GitHub ↗
(positions, size)

Source from the content-addressed store, hash-verified

102551 }
102552}
102553function shiftLongitudesIntoRange(positions, size) {
102554 let refLng;
102555 const pointCount = positions.length / size;
102556 for(let i = 0; i < pointCount; i++){
102557 refLng = positions[i * size];
102558 if ((refLng + 180) % 360 !== 0) break;
102559 }
102560 const delta = -Math.round(refLng / 360) * 360;
102561 if (delta === 0) return;
102562 for(let i2 = 0; i2 < pointCount; i2++)positions[i2 * size] += delta;
102563}
102564
102565},{"./cut-by-grid":"geAhV","./utils":"7b2Ry","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"1WN0h":[function(require,module,exports) {
102566var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected