Crystal Lattice 3D Viewer
Equations in this simulation
| N_corner | atoms on the corners of the cell | each is shared by the 8 cells that meet there | |
|---|---|---|---|
| N_edge, N_face | atoms on the edges and faces | an edge is shared by 4 cells, a face by 2 | |
| Z | atoms per unit cell | 1 for simple cubic, 2 for body-centered, 4 for face-centered; for a salt, formula units per cell |
With the current values:
| M | molar mass of one formula unit | for NaCl, 22.99 + 35.45 = 58.44 g/mol | |
|---|---|---|---|
| N_A | Avogadro constant | 6.022 × 10²³ per mole | |
| V | volume of the cell | a³ for a cubic cell; (√3 ÷ 2) a² c for the hexagonal one | |
| ρ | density of the crystal | X-ray measurements of a and the density together gave one of the best early values of N_A |
With the current values:
| r | radius of each atom or ion | metallic radii for the metals, ionic radii for NaCl and CsCl, covalent radii for zinc blende and diamond | |
|---|---|---|---|
| packing | share of the cell filled by the spheres | 52% simple cubic, 68% body-centered, 74% face-centered and hexagonal close-packed, the most any packing of equal spheres can reach |
With the current values:
| h, k, l | Miller indices | the planes cut the cell edges at a ÷ h, a ÷ k and a ÷ l; a 0 means the planes run parallel to that edge | |
|---|---|---|---|
| d | spacing of the planes | the distance between neighboring planes of the family drawn in yellow |
With the current values:
| λ | X-ray wavelength λ | it must be shorter than 2d, or the planes cannot reflect it at any angle | |
|---|---|---|---|
| θ | Bragg angle | the angle between the beam and the planes; the detector sits at 2θ from the beam | |
| n | order of the reflection | the reflection (2 2 2) is the second order of (1 1 1): its planes are half as far apart |
With the current values:
| x_j, y_j, z_j | position of atom j as fractions of the cell edges | the atoms between the planes scatter out of step with those on them | |
|---|---|---|---|
| f_j | scattering factor of atom j | about the number of electrons Z at low angles, falling at higher angles; here f = Z e^(−2s²) ÷ (1 + 3s²), s = sin θ ÷ λ in Å⁻¹ | |
| F | structure factor | when F = 0 the reflection is absent: body-centered iron has no (1 0 0) peak, because the atom in the middle cancels the corners |
With the current values:
How to use the crystal lattice viewer
- Pick a structure. The unit cell is drawn with the atoms of the real example, at its measured lattice constant, and the results count the atoms per cell (corners shared by 8 cells, edges by 4, faces by 2), the coordination number, the nearest-neighbor distance, the packing fraction and the density, next to the measured density. Switch to space-filling to see the atoms at their real size, or cut them at the faces of the cell to see how much of each corner atom belongs to it.
- Set the Miller indices h, k and l. The planes of that family are drawn in yellow, the atoms on them light up, and the results give the spacing d and the angle 2θ at which the planes reflect X-rays by Bragg's law. Some choices are absent, such as (1 0 0) in body-centered iron, because the atoms between the planes scatter exactly out of step; with small spacings the wavelength is too long to reflect at all.
- Watch the detector sweep from 0 to 150°: the red beam comes in, the yellow beam goes out at the same angle to the planes, and it brightens when the path difference is a whole number of wavelengths. The chart below shows the whole powder pattern. Drag the lattice constant to see the density and the peaks shift, and switch to molybdenum radiation to see more peaks. The Molar Mass Calculator gives the mass that goes into the density.
Frequently asked questions
What is a unit cell?
The smallest box of atoms that builds the whole crystal when it is repeated in every direction, like a tile. A cubic cell is described by one length, the lattice constant a; the hexagonal cell of magnesium needs two, a and c. The atoms per cell, Z, counts each corner atom as an eighth, each edge atom as a quarter and each face atom as a half, because neighboring cells share them.
How do you calculate the density of a crystal?
Divide the mass of the atoms in one cell by its volume: ρ = Z M ÷ (N_A a³). For copper, 4 × 63.55 g/mol ÷ (6.022 × 10²³ × (361.5 pm)³) = 8.94 g/cm³, against a measured 8.96. Run backward, the same equation gave one of the most accurate early values of the Avogadro constant.
What are Miller indices?
Three whole numbers (h k l) that name a family of parallel planes: the planes cut the cell edges at a ÷ h, a ÷ k and a ÷ l, and a 0 means the planes run parallel to that edge. In a cubic crystal the spacing is d = a ÷ √(h² + k² + l²). Hexagonal crystals often use four indices (h k i l), with i = −(h + k).
Why are some X-ray reflections missing?
Bragg's law says when the waves from one set of planes are in step, but the atoms between those planes also scatter. In body-centered iron the atom in the middle of the cell sits halfway between the (1 0 0) planes and cancels them exactly, so the structure factor F is zero and there is no peak. Which peaks are missing is how X-ray diffraction tells the lattice types apart.
It says WebGL is turned off.
The 3D view needs WebGL, which every current browser has. It can be switched off by hardware acceleration being disabled in the browser settings, or by a very old graphics driver. Turn hardware acceleration on, or try another browser.
Is anything uploaded?
No. The simulation is drawn by your own browser with WebGL; nothing is sent anywhere, and it keeps working offline once the page has loaded.