Distance Between Points

Calculate the Euclidean distance between two points.

Code

General
sqrt(pow($x2 - $x1, 2) + pow($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 PHP Snippets