As Will Holladay, author of a Roof Cutter's Secrets, explains: This is not a problem of calculating the length of the rafter, but of the accuracy of ridge height measurements.
Q. When cutting steep roofs, we often have problems getting the correct rafter lengths. It seems the steeper the roof gets, the lower the rafters hit on the ridge. We have been careful to double-check diagonals and our ridge height, but our first rafter is always too short, and we have to waste time fitting a pattern before proceeding. Why do the rafters need lengthening, and is there some way to calculate for this?
A. Will Holladay responds: The problem probably isn’t one of calculating the length, but in the accuracy of your ridge height measurements. No matter how accurately you might measure the proper rise from the floor, a crown in the floor deck will boost the ridge height.
It’s not uncommon for the floor height to vary 1/2 inch or so in the middle of a big room. While small dimensional differences like this might not be noticeable at a lower pitch, a steep roof magnifies any discrepancies. To avoid vertical measurement errors on steep roofs (8/12 and up), I always measure the rise from a string stretched across the top of the outside walls.