Measure the distance from the edge of the outer wall on the end of the house to the opposite outer wall on the same end of the house. This measurement is the span of the roof. Assume the span of the roof is 32 feet in this example.
Divide the span of the roof by two to obtain the run of the roof. The span of the roof is 32 feet in this example, so the run of the roof is 32 / 2 = 16 feet.
Measure the vertical distance from the peak of the roof to the top of the wall to obtain the rise of the roof. Assume for this example that the rise of the roof is 22 feet.
Add the square of the rise of the roof to the square of the run of the roof. The rise of the roof is 22 feet and the run of the roof is 16 feet, so the sum of their squares is (22 x 22) + (16 x 16) = 740.
Calculate the square root of the sum from Step 4 to obtain the length of the roof rafter. The square root of 740 is 27.2, so the length of the roof rafter in this example is 27.2 feet.