Nuclear physics is the field of physics that studies atomic nuclei and their constituents and interactions. Other forms of nuclear matter are also studied. Nuclear physics should not be confused with atomic physics, which studies the atom as a whole, including its electrons. The most commonly known application of nuclear physics is nuclear power generation, but the research has led to applications in many fields, including industrial isotopes, agricultural isotopes, nuclear medicine and magnetic resonance imaging, nuclear weapons, ion implantation in materials engineering, and radiocarbon dating in geology and archaeology. The field of particle physics evolved out of nuclear physics and the two fields are typically taught in close association. Nuclear astrophysics, the application of nuclear physics to astrophysics, is crucial in explaining the inner workings of stars and the origin of the chemical elements.