From 7bf5adcb3a8b544e140a32dfae49e4ba30ca296f Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Sat, 7 Feb 2026 11:32:06 +1100 Subject: [PATCH] Antipode-detector to complete the mapping --- label_inscribed_600cell.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/label_inscribed_600cell.js b/label_inscribed_600cell.js index ce19883..7b5a104 100644 --- a/label_inscribed_600cell.js +++ b/label_inscribed_600cell.js @@ -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; +} +