SyntaxFix
Write A Post
Hire A Developer
Questions
dist = sqrt( (x2 - x1)**2 + (y2 - y1)**2 )
As others have pointed out, you can also use the equivalent built-in math.hypot():
math.hypot()
dist = math.hypot(x2 - x1, y2 - y1)