The shortest path between two points is a straight segment that connects the two points.
Refer to the diagram attached. The 6-km segment and the 8-km segment are normal to each other. Together with the segment that joins the library and the house, the three segments now form a right triangle.
The two shorter segments are the two legs, and
The longer segment that joins the library and the house is the hypotenuse.
The length of the hypotenuse can be found with the Pythagorean Theorem.
.
The length of the round-trip will equal to the sum of the length of the three segments: .