You can put this solution on YOUR website! you would use Pythagorus theorem:
square on hypotenuse=sum of squares of other two sides.
In your case diagonal is hypotenuse.
so if (d)is diagonal and x and y the two sides it connects
add and
then find
Pete