Drag the gold point P anywhere on the grid — inside the rectangle or outside it.
The two teal distances reach one pair of opposite corners;
the two amber distances reach the other pair.
Square them and add: the two pair-totals are always equal, even though the four distances are not.