Let's say that I have a camera positioned in front of a wall. The camera is looking straight at the closest point on the wall. The camera can see 2 horizontal lines on the wall (extending to infinity). Taking into account the camera's field of view and the y position (up and down) of the lines in the camera's viewport, I can compute the angle between the 2 lines ($a$). I also know the distance of both of the lines to the floor ($i$ and $j$). Using this information, I need to compute the distance of the camera to the base of the wall ($d$).
Here is a side-view diagram of this problem:
Here are the 2 equations (with 2 unknowns) that I have come up with:
So, the question is how to solve these 2 equations for $b$ and $d$. I feel like I'm missing something really simple. I'd really appreciate it if someone could point me in the right direction.