DEV Community

Cover image for Bragg's Law: How Crystals Turn X-Rays Into a Map of Atoms
NovaSolver
NovaSolver

Posted on Originally published at novasolver.jp

Bragg's Law: How Crystals Turn X-Rays Into a Map of Atoms

In 1912, a beam of X-rays was aimed at a copper sulfate crystal and a photographic plate was placed behind it. Instead of a single fuzzy shadow, the plate came back covered in a regular pattern of sharp spots. Something inside the crystal was sorting the X-rays into precise directions. Within a year, William Lawrence Bragg had explained why, and the explanation was almost embarrassingly simple: a crystal behaves like a stack of evenly spaced mirrors, and X-rays reflect strongly only at certain angles.

That one idea became the foundation of X-ray crystallography, the technique that has since revealed the structure of DNA, of proteins, of minerals, and of nearly every engineered alloy. This article explains what Bragg's law says, how to use it, and where it quietly trips people up.

Why this calculation matters

Atoms in a crystal sit on a repeating three-dimensional lattice. You cannot see that lattice with visible light, because visible wavelengths are thousands of times larger than the gaps between atoms. X-rays, with wavelengths around 0.1 nm, are a near-perfect match for atomic spacing, and that match is what makes diffraction possible.

Bragg's law is the bridge between something you can measure and something you cannot. You can measure an angle on a detector with high precision. You cannot directly measure the distance between atomic planes. Bragg's law converts the first into the second. Every powder diffraction pattern used to identify an unknown phase, every protein structure deposited in a database, every residual-stress measurement on a turbine blade rests on this single equation. Get the angle, and you get the spacing; get a set of spacings, and you get the crystal.

The core formula

Picture the crystal as a series of parallel planes of atoms, each plane separated from the next by a distance d. An incoming X-ray wave partially reflects off the first plane, off the second plane, off the third, and so on.

Waves reflecting from deeper planes travel a longer path. The extra distance traveled by a wave bouncing off the second plane, compared with one bouncing off the first, is 2 d sin(theta), where theta is the glancing angle measured from the plane surface, not from the normal.

Strong reflection happens only when every reflected wave arrives in step with the others. That requires the extra path length to equal a whole number of wavelengths:

n * lambda = 2 * d * sin(theta)
Enter fullscreen mode Exit fullscreen mode

Here lambda is the X-ray wavelength, d is the spacing between atomic planes, theta is the glancing angle, and n is the diffraction order, a positive integer. This is Bragg's law.

Two consequences are worth holding onto. First, because sin(theta) can never exceed 1, the law has solutions only when n*lambda is no larger than 2d. That sets a hard ceiling on how many orders you can ever see:

n_max = floor( 2 * d / lambda )
Enter fullscreen mode Exit fullscreen mode

Second, smaller plane spacings push the reflection to larger angles. Fine structure shows up far from the incident beam, coarse structure close to it. That inverse relationship is why a diffraction pattern is, in a real sense, a picture of the crystal turned inside out.

A worked example

Consider a beam of X-rays with wavelength lambda = 0.154 nm, the characteristic copper K-alpha line used in many laboratory diffractometers. It strikes a crystal whose atomic planes are spaced d = 0.282 nm apart. Where does the first-order reflection appear?

Step 1 — set the order. First order means n = 1.

Step 2 — solve Bragg's law for sin(theta).

sin(theta) = n * lambda / (2 * d)
sin(theta) = 0.154 / (2 * 0.282)
sin(theta) = 0.154 / 0.564
sin(theta) = 0.273
Enter fullscreen mode Exit fullscreen mode

Step 3 — take the inverse sine.

theta = arcsin(0.273)
theta = 15.8 degrees
Enter fullscreen mode Exit fullscreen mode

So the first-order Bragg reflection appears at a glancing angle of 15.8 degrees. On a diffractometer that reports the angle between the incident and diffracted beams, this peak shows up at 2*theta = 31.6 degrees.

It is also worth checking how many orders this crystal can produce. With 2d = 0.564 nm and lambda = 0.154 nm, the ceiling is floor(0.564 / 0.154) = floor(3.66) = 3. The crystal can deliver first-, second-, and third-order reflections of this wavelength and no more. Measuring the angles of all three, and feeding them back through Bragg's law, is exactly how crystallographers pin down d to a fraction of a percent.

Common mistakes

Measuring theta from the wrong reference. Bragg's law uses the glancing angle between the beam and the atomic plane. In optics you are trained to measure angles from the surface normal. Mixing the two conventions sends every spacing astray. When in doubt, remember that grazing incidence means small theta.

Confusing theta with 2*theta. Diffractometers usually plot intensity against 2*theta, the full scattering angle, because that is what the detector arm sweeps. Bragg's law itself wants theta. Halve the instrument angle before substituting, or your spacing will be wrong by a large factor.

Forgetting the sin(theta) ceiling. If a calculation hands you sin(theta) greater than 1, the reflection simply does not exist for that order and wavelength. It is not a numerical error to be forced through; it means n*lambda has exceeded 2d.

Assuming every plane spacing reflects. Bragg's law gives a necessary condition, not a complete one. The structure factor, which depends on which atoms sit where inside the unit cell, can drive certain reflections to zero intensity even when the Bragg angle is satisfied. A missing peak is often physics, not a flaw in the sample.

Treating the wavelength as exact. Laboratory X-ray sources emit a narrow band, not a single line, and the K-alpha line is itself a close doublet. For high-precision work that spread broadens every peak and must be accounted for.

Try the interactive NovaSolver calculator

Working one angle by hand is instructive, but the relationships between spacing, wavelength, order, and angle are best felt by moving them. The Bragg Diffraction Simulator — X-Ray Crystallography on NovaSolver lets you set the plane spacing d, the X-ray wavelength lambda, the diffraction order n, and even a lattice strain epsilon, then returns the Bragg angle theta, the diffraction angle 2*theta, the effective d-spacing, and the maximum attainable order, with a visual of reflection from adjacent lattice planes and the positions of the multi-order peaks.

Related calculators

You can browse the full set in the optics tools hub.

Closing note

Bragg's law is a rare case where one short equation opened an entire branch of science. The physics behind it is just path difference and constructive interference, the same idea that explains the colors in a soap film. What makes it powerful is the scale: X-ray wavelengths happen to match atomic spacings, so a measured angle becomes a measured distance between atoms. Keep the angle convention straight, respect the sin(theta) ceiling, and remember that a missing peak can be telling you something. With those habits, a diffraction pattern stops being a field of spots and starts being a readable map of the crystal.

Top comments (0)