The run
Each rafter covers half the span, less half the ridge board: (288 in − 1 1/2 in) ÷ 2 = 143 1/4 in, which is 11 ft 11 1/4 in.
Give the span, the pitch, the overhang and the ridge board, and see the rafter length, run, rise and roof angle as you type, with how many rafters the roof takes.
Takes off half the ridge board on each side and adds the overhang along the slope, not level.
Each rafter covers half the span, less half the ridge board: (288 in − 1 1/2 in) ÷ 2 = 143 1/4 in, which is 11 ft 11 1/4 in.
A rafter is the long side of a right triangle whose short sides are the run and the rise. For every 12 of run at 6 in 12 it is √(12² + 6²) = 13.42, so the rafter is 13.42 ÷ 12 = 1.118 times the run. The roof pitch calculator gives the factor for any pitch.
143 1/4 in × 1.118 = 160.16 in, 13 ft 4 3/16 in, from the ridge to the outside of the wall. The overhang is level, so it grows on the slope too: 12 in × 1.118 = 13.42 in. Together, 14 ft 5 9/16 in.
The roof angle is arctan(6 ÷ 12) = 26.57°, the setting for the plumb cuts at the ridge and the tail. The rise from the top of the wall to the ridge line is 143 1/4 × 6 ÷ 12 = 71 5/8 in.
Along a 40 ft building at 16 in on center there are 480 ÷ 16 = 30 spaces, so 31 rafters a side, 62 in all. Then press "Put this on an estimate" to put them on a line of the estimate template at your price.
Halve the span less the ridge board thickness to get the run, multiply by the slope factor √(1 + (pitch ÷ 12)²), then add the overhang times the same factor. A 24 ft span at 6 in 12 with a 1 1/2 in ridge and a 12 in overhang: 143.25 in × 1.118 + 12 in × 1.118 = 173.57 in, or 14 ft 5 9/16 in.
At 6 in 12 the rafter is 1.118 times the run. With a 12 ft run that is 13 ft 5 in (13.42 ft) before the overhang and the ridge board.
It is √(1 + (rise ÷ 12)²): 4 in 12 is 1.054, 6 in 12 is 1.118, 8 in 12 is 1.202, 12 in 12 is 1.414.
Yes, half its thickness on each side: the rafters meet the faces of the ridge board, not its center line. With a 1 1/2 in ridge each run is 3/4 in shorter.
Divide the building length by the spacing, round down, add one, and double it for both sides. 40 ft at 16 in on center is 480 ÷ 16 = 30, plus 1 is 31 a side, 62 rafters.