Diffraction of x rays in capillary optics