Check out example codes for "distance between 2 points mathlab". It will help you in understanding the concepts better.

Code Example 1

>> x = [0 0];
>> y = [2 1];
>> norm(x-y)
ans =
      2.2361

Code Example 2

>> X = [0,0;2,1];
>> d = pdist(X,'euclidean')
d =
    2.2361

Learn ReactJs, React Native from akashmittal.com