Overview:
-
Minkowski distance between two n-dimensional points (x1, y1... Dn) and (x2, y2... Dn) is given by ((x1-y1)p + (x2-y1)p...+(xn - yn)p)1/p
-
The Minkowski distance is a metric that gives specialised distance for each value of the parameter p.
-
When p = 1, the resultant metric is the Manhattan distance.
-
When p = 2, the resultant metric is the Euclidean distance.
-
When p = ∞, the resultant metric is the Chebyshev distance.
-
Example:
# Example Python program that finds the Minkowski distance between # two points on a 2-dimensional real plane for the parameter value 1, 2 # and ∞ # Points on a 2-dimensional plane # Manhattan distance # Euclidean distance # Chebyshev distance |
Output:
Minkowski distance when p = 1 |