Yeah my bad, I was looking at the wrong question.
For that question you can use linear graphs.
The gradient of XZ is (5-0)/(3-6)=-5/3, to the gradient of a line perpendicular to XZ is -1/(-5/3)=3/5. The line XP has the gradient 3/5 (because it is perpendicular to XZ), and it passes through (3,5), so it's equation is y=3/5x+16/5.
The gradient of ZY is (5-0)/(9-6)=5/3, so the gradient of ZP is 5/3 (because P is on the line ZY). This line passes through (6,0), so it has the equation y=5/3x-10.
P is on the intersection of these lines, so to find the x coordinate we have 3/5x+16/5=5/3x-10, and find this x and substitute it into one of the equations to find y.
This gives x=99/8=12+3/8, and y=85/8=10+5/8.