Antipode-detector to complete the mapping
This commit is contained in:
parent
3c874326a6
commit
7bf5adcb3a
@ -269,3 +269,12 @@ export function equator(i600, b600, apices) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export function antipode(shape, nid) {
|
||||||
|
const n0 = shape.nodes.filter((n) => n.id === nid)[0];
|
||||||
|
const dists = shape.nodes.map((n) => [ dist(n, n0), n ]);
|
||||||
|
dists.sort((a, b) => b[0] - a[0]);
|
||||||
|
return dists[0][1].id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user