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

Function zOrder

docs/app/js/sanddance-app.js:102003–102015  ·  view source on GitHub ↗
(x, y, minX, minY, invSize)

Source from the content-addressed store, hash-verified

102001 return list;
102002}
102003function zOrder(x, y, minX, minY, invSize) {
102004 x = 32767 * (x - minX) * invSize;
102005 y = 32767 * (y - minY) * invSize;
102006 x = (x | x << 8) & 0x00ff00ff;
102007 x = (x | x << 4) & 0x0f0f0f0f;
102008 x = (x | x << 2) & 0x33333333;
102009 x = (x | x << 1) & 0x55555555;
102010 y = (y | y << 8) & 0x00ff00ff;
102011 y = (y | y << 4) & 0x0f0f0f0f;
102012 y = (y | y << 2) & 0x33333333;
102013 y = (y | y << 1) & 0x55555555;
102014 return x | y << 1;
102015}
102016function getLeftmost(start) {
102017 let p = start;
102018 let leftmost = start;

Callers 2

isEarHashedFunction · 0.70
indexCurveFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected