My attempts to derive the height as a function of radius of the spheres packing the unit cell have failed. The best attempt so far was to create a diagonal line from the top atom to one of the middle ones. With that distance I thought I could use trig to find the component parallel to the height and multiply by two. Of course that didn't work. Any hints or suggestions? Even good 3d visualizations would help.