Pythagorean theorem puzzles

Four unit squares are placed edge to edge as shown. What is the length of the diagonal line drawn?


A spider is sitting in the middle of one of the smallest walls in my living room and a fly is resting by the side of the window on the opposite wall, 1.5m above the ground and 0.5m from the adjacent wall.

The room is 5m long, 4m wide and 2.5m high.

What is the shortest distance the spider would have to crawl to catch the fly?

If the fly was further down the wall, would there be a point where the spider should take a different route, and if so, where would the fly be, and where would the spider need to go?