I don't have the answer to your question but I'm working on a problem similar to yours. I am building a bench where the back is at an angle and the bench itself is making two 45 deg turns to complete a corner. I am trying to figure out how to calculate the bevel and mitter angles to cut the boards for the back. I think I'm close to the solution but not quite.
If you have any clue, or bette a solution, I would appreciate if you let me know.