A railgun uses the Lorentz force to fire a conductive projectile at high velocity. The projectile slides down two conductive rails, connected to a high current power supply. When a massive electrical current passes through the projectile, the Lorentz force pushes the projectile in a direction perpendicular to the current flow. By using an electromagnet above and below the rails to set up a vertical megnetic field, the Lorentz force can be constrained to a direction parallel to the rails.