Distance Between Points

Calculate the Euclidean distance between two points.

Code

General
import math
return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

Parameters

X coordinate of first point

Y coordinate of first point

X coordinate of second point

Y coordinate of second point

Server

More Python Snippets