The measurement of the angles can be used to determine crystal structure, see x-ray crystallography for more details. As a simple example, Bragg's law, as stated above, can be used to obtain the lattice spacing of a particular cubic system through the following relation:
where  is the lattice spacing of the cubic crystal, and , , and  are the Miller indices of the Bragg plane. Combining this relation with Bragg's law gives:
One can derive selection rules for the Miller indices for different cubic Bravais lattices as well as many others, a few of the selection rules are given in the table below.
These selection rules can be used for any crystal with the given crystal structure. KCl has a face-centered cubic Bravais lattice.  However, the K and the Cl ion have the same number of electrons and are quite close in size, so that the diffraction pattern becomes essentially the same as for a simple cubic structure with half the lattice parameter.  Selection rules for other structures can be referenced elsewhere, or derived. Lattice spacing for the other crystal systems can be found here.