Euclidean Distance: In order to calculate the distance b/w tow points in a given Space – can be a N-dimensional, we can use Euclidean distance formula:

D(x1,x2) = SQRT((x1-x2)**2 + (y1-y2)**2) where SQRT is Square Root D stands for distance b/w point x1,x2. we can extend this for N- dimensional plan as follows

D(x1,x2,x3,…xn) = SQRT((x1-x2)**2 + (y1-y2)**2 + (z1-z2)**2 +…(xn – xn-1)**2)

Manhattan distance: it is defined as follows:

D(x1,x2) = |x1-x2| + |y1-y2| i.e. Sum of Absolute distance b/w x1,x2 and y1 and y2

### Like this:

Like Loading...

*Related*