Explanation:
when you mark such points on a coordinate grid, and mark also the coordinate differences in x and y direction as soft lines, you notice that these coordinate difference lines and the direct connection between the 2 points create a right-angled triangle.
so, Pythagoras applies :
c² = a² + b²
with c being the Hypotenuse (the baseline opposite of the 90° angle, which is the direct connection between the 2 points). a and b are the legs (coordinate differences).
so,
distance² = (8 - 6)² + (2 - 10)² = 2² + (-8)² = 4 + 64 = 68
distance = sqrt(68) = 8.246211251... ≈ 8.2