@swiftcoder me neither. but then i tried a quick thing with lines in 1d and realized this generalizes to higher dimensions.