The situation forms a right triangle:
Where x is the distance traveled.
We can apply the Pythagorean theorem:
c^2 =a^2 + b^2
Where:
c= hypotenuse = x
a & b= the other 2 sides = 5 ,12
Replacing:
x^2 = 5^2 + 12^2
x^2 = 25+144
x^2 = 169
x= √169
x= 13
Distance traveled = 13 miles