2 ms·
I actually have used alternate metrics in production code: The problem was to be able to cluster points on a map. The naïve approach is to use Euclidean distanc
by dhosek 5y ago
I actually have used alternate metrics in production code: The problem was to be able to cluster points on a map. The naïve approach is to use Euclidean distance, d = √Δx² + Δy², but the problem here is that the neighborhoods you get are circles and we're looking at the map through a rectangular viewport. Clicking on a cluster to zoom in on it will not give an optimal zoom (and may include stray pins from other clusters as well). It turned out using a box metric of d = max(Δx, Δy) gives better results for our needs since the neighborhoods are now squares instead of rectangles (and has the added bonus of being easier to calculate).