Shortest ladder

There is an abutment at the base of a wall. How does the length of a ladder leaning against the wall vary with the angle shown in the diagram? For a given size abutment, is there a shortest ladder? If so, what is that length? You can adjust the size of the abutment by dragging the GREEN dot. You can adjust the angle of the ladder by dragging the RED dot. Does your solution behave reasonably in limiting cases? in interesting cases?
Adapted from "Calculus: The Analysis of Functions" by P.D. Taylor