Check out example codes for "two point distance matlab". It will help you in understanding the concepts better.

Code Example 1

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

Learn ReactJs, React Native from akashmittal.com