Calculate the rafter length for a gable roof from the pitch, building width, and overhang — exact trigonometry.
rafter = (building_width ÷ 2) × √(rise²+run²)÷run + overhang
The horizontal run is half the building width. Multiply by the pitch's slope multiplier and add the overhang to get the rafter length.
This gives the common rafter length. Hip and valley rafters are longer — they run diagonally.
For a 24 ft wide building with a 6:12 pitch, the horizontal run is half the width: 12 ft. The slope multiplier at 6:12 is 1.118, so the rafter from ridge to wall is 12 x 1.118 = 13.4 ft. Add a 1 ft overhang and you'd cut each common rafter at about 14.4 ft.
This is the common rafter length along the slope. You still need to mark the bird's-mouth (the notch that sits on the wall plate) and the plumb cuts at each end, so order stock a little longer than the calculated length.
Pure trigonometry — no estimation. Add for the bird's-mouth cut and plumb cut when ordering stock length.
About 13.4 ft plus overhang — the 12 ft run times the 1.118 slope multiplier.