Radial tree + Forces

This commit is contained in:
Oxy8
2026-02-10 16:18:24 -03:00
parent d6d37d93d5
commit 022da71e6a
13 changed files with 200973 additions and 94 deletions

View File

@@ -23,7 +23,7 @@ export interface Leaf {
export function buildSpatialIndex(
xs: Float32Array,
ys: Float32Array
): { sorted: Float32Array; leaves: Leaf[] } {
): { sorted: Float32Array; leaves: Leaf[]; order: Uint32Array } {
const n = xs.length;
const order = new Uint32Array(n);
for (let i = 0; i < n; i++) order[i] = i;
@@ -109,5 +109,5 @@ export function buildSpatialIndex(
sorted[i * 2 + 1] = ys[src];
}
return { sorted, leaves };
return { sorted, leaves, order };
}