I literally just did this question for a mate yesterday!
See the picture above. I rotated the radius of the sphere down and made a right angled triangle with the height and the radius. Simply use Pythagoras (by letting the radius of the cylinder be R) and you'll get the answer: