calculating distance for four features

calculating distance for four features

if you want to calculate the distance between 4 features coordinates, you do it like that :

A (1,2,5,1)

B (7, 1, 3, 0)

import math

dist = math.sqrt((7-1)**2+(1-2)**2+(3-5)**2+(0-1)**2)

print(dist)

>>> 6.4807 ...

  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

Your email address will not be published. Required fields are marked *