How the maths works
A roof slope is a right-angled triangle. The run is the flat side, the rise is the upright side and the rafter is the sloping side. Pitch in degrees is the inverse tangent of rise divided by run, so a 1,660 mm rise over a 4,000 mm run is about 22.5°.
The rafter length comes from Pythagoras: the square root of run squared plus rise squared. For an overhang, divide the level overhang by the cosine of the pitch to get the extra length along the slope.
Australian plans usually give pitch in degrees. You'll sometimes see it as a rise per 1,000 mm of run, or as a percentage on low-slope metal roofs. This calculator shows all three.