X-rays were discovered in 1895 by Roentgen. They are generated when electrons are bombarded onto a metal anode target inside an x-ray tube, producing electromagnetic radiation with characteristic wavelengths depending on the metal. The x-ray tube converts electrical energy into x-ray photons and heat, and the output can be controlled by adjusting voltage and current. X-rays can pass through, scatter from, or be absorbed by the body, and are used in medical imaging due to being quick, painless, and able to diagnose diseases and injuries.