Unit cell and basis. A crystal is a lattice (vectors a1, a2, a3) plus a basis of atoms at fractional positions. Volume V = a1 . (a2 x a3). Atoms on a cell corner belong to 8 cells, on an edge to 4, on a face to 2, so FCC has 8x1/8 + 6x1/2 = 4 atoms per cell, BCC has 2, SC 1, diamond 8, HCP (primitive cell) 2.
Atomic packing fraction. Hard spheres touch along the nearest-neighbour distance d, so the radius is r = d/2 and APF = N (4/3) pi r^3 / V. Closed forms: SC pi/6 = 0.5236, BCC pi sqrt3/8 = 0.6802, FCC and ideal HCP pi/(3 sqrt2) = 0.7405, diamond pi sqrt3/16 = 0.3401. 0.7405 is the densest sphere packing in 3D (Kepler conjecture, proved by Hales).
Miller planes. The plane (hkl) cuts the axes at 1/h, 1/k, 1/l; the family is h u + k v + l w = m in fractional coordinates. The reciprocal vector G = h b1 + k b2 + l b3 (with b_i . a_j = delta_ij) is normal to the planes and d(hkl) = 1/|G|. For a cubic cell d = a / sqrt(h^2 + k^2 + l^2).
Diffraction. Bragg law n lambda = 2 d sin(theta). A reflection exists only if the structure factor F = sum_j exp[2 pi i (h x_j + k y_j + l z_j)] is not zero. FCC needs h, k, l all odd or all even; BCC needs h + k + l even; diamond adds h + k + l != 4n + 2. Line intensity here is |F|^2 x (1 + cos^2 2theta)/(sin^2 theta cos theta) with equal atomic scattering factors for all atoms.
What is simplified. Atoms are rigid spheres of equal size; real metals are not hard spheres and the cell edge changes with temperature. Atomic form factors, thermal (Debye-Waller) damping, absorption and peak widths are ignored, so the pattern shows line positions and relative selection-rule intensities only, not what a real diffractometer records. The lattice parameters in the material presets are typical room-temperature values and should be checked against a reference before being quoted. HCP uses the primitive hexagonal cell; the plane family is drawn in that cell.
Checks on this page use the atom coordinates only: atoms and neighbours are counted, and the repeat distance of the atom planes is measured by finding the smallest shift that maps the projected planes onto themselves, then compared with d(hkl)/n* from the structure factor. The Cu (111) line is also compared with the textbook value near 43.3 degrees for Cu K-alpha (1.5406 A).