A rectangle has 90 degree angles. When a line cuts it diagonally, it makes a right angle. (I drew the picture on a rocking chair so...)
When there is a right angle we think about the Pythogarean theorem.

Plug the values:

Simplify:

Combine like terms:

Take the square root of both sides:

The length of the path is 10 miles.