You can prove that this is a right triangle.
If you look at the region underneath QP, you can see that it is a right triangle with hypotenuse 5 and base 4 and height 3. If you drop a line from R, then you will have another right triangle underneth PR, with hypotenuse 5 and base 3 and height 4. If you "close" the two triangles, they will form a box with base 4 and height 3. When you open them up, they form another right triangle, with base and height of 5 and hypotenuse of 5sqroot2 (this is also the value you would get if you used the distance formula). Notice also that the subject triangle is a special triangle in the form x : x : xsqroot2.