Explanation:
2 points in a coordinate grid create a right-angled triangle.
the distance is the Hypotenuse (the side opposite of the 90° angle). and the x coordinate and y coordinate differences are the legs.
and with that we use Pythagoras
c² = a² + b²
with c being the Hypotenuse, and a and b being the legs.
so, in our case :
distance² = (1 - 2)² + (7 - 3)² = (-1)² + 4² = 1 + 16 = 17
distance = sqrt(17)