A railgun is a purely electrical gun that accelerates a conductive projectile along a pair of metal rails using the same principles as the homopolar motor. Railguns use two sliding or rolling contacts that permit a large electrical current to pass through the projectile. This current interacts with the strong magnetic fields generated by the rails and this accelerates the projectile.
[spoilSchematic diagram of a railgun-

It can be shown from the Biot-Savart law that the magnetic field a distance s from a semi-infinite current-carrying wire is given by:

So, in the space between two semi-infinite wires, the magnitude of the field is:

To obtain the average magnetic field in the space between the two wires, we assume that r is small compared with d and compute the following integral:

By the Lorentz force law, the magnetic force on a current-carrying wire is given by IdB, so since the width of the conductive projectile is d, we have

The formula is based on the assumption that the distance (l) between the point where the force (F) is measured and the beginning of the rails is greater than the separation of the rails (d) by a factor of about 3 or 4 (l > 3d). Some other simplifying assumptions have also been made; to describe the force more accurately, the geometry of the rails and the projectile must be taken into consideration.
EASY DEFINITION- BAD ASS ELECTRICAL GUN!