Step-by-step explanation:
the distance between 2 points is the Hypotenuse of a right-angled triangle. its legs are the x and y coordinate differences.
and so, we can use Pythagoras
c² = a² + b²
with c being the Hypotenuse, and a, b being the legs.
so,
the x difference is 9-12 = -3
the y difference is 31-25 = 6
therefore,
distance² = (-3)² + 6² = 9 + 36 = 45
distance = sqrt(45) = 6.708203932...