We can use the sine function for this one.....
sine (30) = 9 / ramp length
ramp length = 9 / sine (30)
ramp length = 9 /(1/2)
ramp length = 18 ft.
We could have also used the 30 - 60 - 90 triangle, where the sides opposite these angles have the ratios...... 1 - √3 - 2
So the side opposite the 90 degree angle represents the ramp length and it is twice as long as the side opposite the 30 degree angle (9 ft) = 18 ft