Formula to find cutting angles for a "lean to ladder." 
I would appreciate some help in finding a formula that will help me build my cat's a lean-to ladder.
The ladder will have rails that I will cut from birch plywood, but I need to be able to find the cut angles for the top and bottom of the rails. I know I will probably need the length of the rails and the distance the bottom rail will be from the wall.
Let's say I want my rails to be 5 feet tall (once it is leaning against the wall, so it will have to be cut longer than 5 feet) and the bottom rail will be 18 inches from the wall to the outside of the rail.
This could also be of importance: The steps of the ladder will actually be much larger than traditional ladder steps, with each step being a little platform of sorts. I imagine I will make each step 10 - 12 inches deep by probably 22 inches wide.
A repeatable formula would be great, in case I need to change my measurements. Any thoughts? Also, does anyone know of a simple cad program that will help me design such projects.
 A: 
Let say that your feline-friendly ladder is some $\pmb{h}$ units tall and you want the bottom outside edge of its wooden rail to rest on the floor a distance of $\pmb{a}$ units from the wall. Then, you need a birch plywood plank which is longer than $\pmb{b}$ units, where,
$$b=\sqrt{a^2+h^2}.$$
According to the drawing, a finished ladder with the mentioned measurements makes an angle $\measuredangle {\pmb{\theta}}$ with the floor it stands on, where,
$$\measuredangle \theta = \tan^{-1}\left(\dfrac{h}{a}\right).$$
This is the angle you need to make at the end of the plank, which is going to become the bottom of the rail of the finished ladder. At the other end of the plank, which is going to be the top of the rail, a cut must be made with the angle $\measuredangle{\pmb{\beta}}$, where,
$$\measuredangle \beta = 90^o - \measuredangle \theta.$$
The width $\pmb{w}$ and the thickness $\pmb{t}$ of the plank you need for the rails depend on the size and the number of steps you are going to use. The readymade cat ladders available in stores usually have either $9”\times 9”-$ or $11”\times 11”-$ steps. Since you are planning to use steps larger than these industry-standard ones, you need to be careful when you chose $\pmb{w}$ and $\pmb{t}$ for you ladder.  The best advice, which we can give, is “ask an experienced carpenter”.
You also need to figure out the number of steps of the ladder. Usually, steps of commercially available cat ladders are placed $9\dfrac{3}{4}”$ apart. When we tried to use this gap in a ladder having your specifications, we ran into a problem. Therefore, we decided to use ${\bf{s}} = 9\dfrac{1}{2}”$ and were able to accommodate 5 steps as shown in the diagram. Don’t forget to use a step with a larger depth as the topmost step, which is normally have a hole.
If you want to use a larger gap $\bf{s}$ for your ladder, then you have to change your design, so that the topmost step rests on the wall instead of the top of the rail.
For a numerical example, see Prof. Jean Marie’s last comment.
