2016-08-25-different-distances.md 865 B


title: Different Measures of Distance tags: geometry

description: A few different ways of calculating distance in noncontinuous 2d spaces

How far is it from one place to another? How does that change if you're on a flat plane? What if that plane has discrete distances (like a checkerboard, or Civ map)?

Euclidean Distance

The shortest distance between two points{width=150 height=150}

This is the go-to of distance calculations. If you're talking about continuous, uniform planar (2d) space^[It holds for 3d and higher-dimensional spaces, too.], Euclidean distance is the shortest distance between two points.

$$d = \sqrt{ |x_1 - x_2|^2 + |y_1 - y_2|^2 }$$

Manhattan Distance

Civ Distance

D&D Distance

This is a bit more complex.