Most trim problems are angle problems. Walls are rarely exactly 90°, and every degree of error shows up as a gap.
Mitres for any corner
For two pieces meeting at a corner, each piece is cut at half the amount the corner turns: mitre = (180° − corner) ÷ 2. A 90° corner gives 45°. A 135° bay window gives 22.5°.
Polygons
For a frame or planter with n equal sides: mitre = 180° ÷ n. Hexagon 30°, octagon 22.5°.
Crown molding
Crown sits at an angle between wall and ceiling (the spring angle), so cutting it flat on a compound mitre saw needs both a mitre and a bevel. For standard 38° spring crown in a 90° corner: mitre 31.6°, bevel 33.9°. For 45° spring: 35.3° and 30°. Alternatively, cut it "nested" (upside down and against the fence) at a simple 45° mitre.
Cope inside corners
On inside corners, many carpenters cut one piece square into the corner and cope the other: cut a 45° mitre to reveal the profile, then back-cut along it with a coping saw. Coped joints stay tight even as the house moves, where mitres open up.
Measure the real angle
An angle finder or two scraps of trim tell you the true corner. Put that number into the calculator rather than assuming 90°.
This guide is general information for estimating. It is not engineering, legal or tax advice. Check local codes and your inspector for your project.