When building a roof, how do you calculate the length of the rafters? All you need to know are the span of the building and the slope of the roof.

source