Sări la conţinut

Euclidean vs Chebyshev vs Manhattan Distance

"Out of Sight, Out of Mind"

I have learned new things while trying to solve programming puzzles. One of these is the calculation of distance.

There are many metrics to calculate a distance between 2 points p (x1, y1) and q (x2, y2) in xy-plane. We can count Euclidean distance, or Chebyshev distance or manhattan distance, etc. Each one is different from the others.

To simplify the idea and to illustrate these 3 metrics, I have drawn 3 images as shown below.

The first one is Euclidean distance. The distance can be defined as a straight line between 2 points. The formula to calculate this has been shown in the image.

In Chebyshev distance, all 8 adjacent cells from the given point can be reached by one unit.

 The last one is also known as L1 distance. The distance between two points is the…

Vezi articolul original 129 de cuvinte mai mult

Lasă un răspuns

Completează mai jos detaliile tale sau dă clic pe un icon pentru a te autentifica:

Logo WordPress.com

Comentezi folosind contul tău WordPress.com. Dezautentificare /  Schimbă )

Poză Twitter

Comentezi folosind contul tău Twitter. Dezautentificare /  Schimbă )

Fotografie Facebook

Comentezi folosind contul tău Facebook. Dezautentificare /  Schimbă )

Conectare la %s

Acest site folosește Akismet pentru a reduce spamul. Află cum sunt procesate datele comentariilor tale.

%d blogeri au apreciat: