programming-examples/python/Basics/Compute the distance between two points.py

7 lines
135 B
Python
Raw Normal View History

2019-11-18 14:44:36 +01:00
import math
p1 = [4, 0]
p2 = [6, 6]
distance = math.sqrt( ((p1[0]-p2[0])**2)+((p1[1]-p2[1])**2) )
print(distance)