mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-01-16 13:50:23 +01:00
use median in bt_tree
This commit is contained in:
parent
247939fec6
commit
814975afaf
@ -494,7 +494,7 @@ function _bt_tree(points, ind, leafsize=25) =
|
||||
pmc = mean(projc),
|
||||
pivot = min_index([for(p=projc) abs(p-pmc)]),
|
||||
radius = max([for(i=ind) norm(points[ind[pivot]]-points[i]) ]),
|
||||
median = mean(projc),
|
||||
median = median(projc),
|
||||
Lind = [for(i=idx(ind)) if(projc[i]<=median && i!=pivot) ind[i] ],
|
||||
Rind = [for(i=idx(ind)) if(projc[i] >median && i!=pivot) ind[i] ]
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user