(I would be appreciative if somebody could give a more formal formulation of this problem.)
The Spider and the Fly Problem is a problem in which the objective is to minimize the distance the spider must travel to reach the fly on the other side of the room.
The spider can only move on the surface of the room. Let S be the point where the spider is, and F be the point where the fly is. One is given the length of YG, GF, PH, and HS, as well as the length, width and height of the rectangular prism. Assume that the fly and spider stay on their respective sides, but aside from that, their points are not necessarily where they are placed on the diagram. Is there a general formula for calculating the shortest distance between the spider and the fly? (Is there a general formula for the geodesic of the cuboid?)
I solved the original spider and the fly problem (by just creating meshes of the cube and getting lucky), but I don't see how I could generalize the result, especially as the spider and fly do not have to be at the same position they are in the original problem. In the original problem, the spider is centered and one unit from the top, and the fly is centered and one unit from the bottom. I've tried considering the simpler case where the fly and spider remain in the same spot, but I still couldn't generalize it, especially for more extreme cases (if we make the height very large compared to the others, our line will go off the mesh, I'm not sure how to deal with this.)
I looked online for any hints about the problem, and the the Mathworld Page used the word "geodesic" to describe the solution. I did some more research, but could only find solutions for the sphere and some other 3d shapes. I also couldn't find any page describing a general solution to the problem, only pages using the meshes of the rectangular prism as a solution.