Given P1 = (a,b) and P2 = (c,d), find the distance between the two points.
Please explain you to solve it, thank you.
Form a rigth-triangle, with the distance between the two points represented
by the hypotenuse. The length of the x side is (c - a). The length of the y
side is (d - b).
The Pythagorean theorem tells us that d^2 = x^2 + y^2, or
d^2 = (c - a)^2 + (d - b)^2
Taking the square root of both sides of the equation gives us
d = √((c - a)^2 + (d - b)^2)
For our purposes here, there is no need to multiply the
quantities on the right side of the equation. That would
result in an unnecessarily complex expression. If you
were given actual values for a, b, c and d, you would
perform the subtractions, square the numbers you get,
add the squares, then take the square root.