The hip and valley factor is determined by finding the square root of ((rise/run)² + 2).

The hip and valley factor is a number that is multiplied by the actual run (horizontal distance) of a common rafter to determine the length of a hip or valley rafter. Repeat, the actual run, not the length, of a common rafter. For precision, the thickness of the ridge board and any eave overhang should be taken into account when determining the run. The hip and valley factor varies according to the slope of the roof, as shown below. 

(Also see the Roof Pitch Multiplier Table.)

Roof Pitch (In Degrees) Hip and Valley Factor
1/12 4.76° 1.4167
2/12 9.46° 1.4240
3/12 14.04° 1.4362
4/12 18.43° 1.4529
5/12 22.62° 1.4743
6/12 26.57° 1.5000
7/12 30.26° 1.5298
8/12 33.69° 1.5635
9/12 36.87° 1.6008
10/12 39.81° 1.6415
11/12 42.51° 1.6853
12/12 45° 1.7321
13/12 47.29° 1.7815
14/12 49.4° 1.8333
15/12 51.34° 1.8874
16/12 53.13° 1.9437
17/12 54.78° 2.0017
18/12 56.31° 2.0616
19/12 57.72° 2.1230
20/12 59.04° 2.1858