@woosh/meep-engine 2.76.3 → 2.76.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/meep.cjs CHANGED
@@ -116789,15 +116789,15 @@ function heuristic(index0, index1, width) {
116789
116789
  const x1 = index0 % width;
116790
116790
  const y1 = (index0 / width) | 0;
116791
116791
 
116792
- //
116793
116792
  const x2 = index1 % width;
116794
116793
  const y2 = (index1 / width) | 0;
116795
116794
 
116796
- //
116797
- const dx = Math.abs(x1 - x2);
116798
- const dy = Math.abs(y1 - y2);
116795
+ // deltas
116796
+ const dx = x2 - x1;
116797
+ const dy = y2 - y1;
116799
116798
 
116800
- return dx + dy;
116799
+ // we skip expensive SQRT, but still get a good guiding heuristic which has the same monotonic order
116800
+ return dx * dx + dy * dy;
116801
116801
  }
116802
116802
 
116803
116803