Distance Between Points

Calculate the Euclidean distance between two points.

Code

General
echo "scale=10; sqrt(($x2 - $x1)^2 + ($y2 - $y1)^2)" | bc -l

Parameters

X coordinate of first point

Y coordinate of first point

X coordinate of second point

Y coordinate of second point

Server

More Bash Snippets