RE: how to calculate dihedral angle?
The amount you need is determined by the design and the number of control surfaces. Even then there's no one single "right" amount. Instead each model will do well with a rather broad range of dihedral angles.
A rudder-elevator glider requires a lot of dihedral and it's best located mostly at the tips. Hence the use of tip or polyhedral with many R-E only designs. With an R-E design the dihedral is not just there for stability but also to provide the yaw coupled rolling action. A higher amount of dihedral will result in a sharper rolling response to a given amount of rudder induced yaw angle. But put in too much and efficiency suffers. It's something that needs to be set mostly by trial and error to find the amount that works to give a reasonable rudder to roll response so the control inputs are rapid enough for the pilot.
On low wing stunt models the dihedral angle can avoid knife edge rolling to the top side of the model. The old Top Flite Contender with it's flat and low wing was bad for this. Many have written that adding just a mere 3/8 to 1/2 inch of dihedral per side would have taken this effect away. Still others have written that the rudder area was just too high and a lower centralizing of the rudder area would have corrected this trait as well.
Trainers use a lot more dihedral than sport designs because it provides more ability for the model to self right itself from a pilot induced disturbance. Free flight models use generous amounts to achieve a high degree of stability for not just stability but to aid with the power to glide transition and avoid loosing a lot of the height gained in the climb due to a bad transition.
From none to generous polyhedral. All of these are right and the option you choose is best determined by the type of model you are designing. But along with this vast range of correct values based on usage comes the fact that there's no one equation to find the "right" amount since each application has it's own correct amount.
In the end you're best to pick the angle by examination and copying proven successful designs of the same style. Or in the case of very minor amounts used in RC pattern competition designs to just plan on cutting and re-joining if you find you need to add some roll couple via dihedral where it's not convienient to mix it in with one of the computer transmitters.