Euclidean distance and Manhattan distance

Euclidean distance, in fact, is the application of the Pythagorean theorem to calculate the distance between two points is a straight line

Two-dimensional space of the formula

among them,

Point to point Euclidean distance between; point to the origin of the Euclidean distance.



Formula three-dimensional space

Formula n-dimensional space

Manhattan distance is absolutely represent two points on the standard wheelbase of the coordinate system and:

Representative Manhattan distance in the red, green represents the Euclidean distance , i.e. the linear distance , and the blue and yellow for equivalent Manhattan distance. Manhattan distance - the distance between two points in the north-south direction plus the distance in the east-west direction, i.e., d (i, j) = | xi-xj | + | yi-yj |.

Guess you like

Origin www.cnblogs.com/likui360/p/11772991.html