Solving for Diagonals of Rectangular Prism