Science, Fiction, Life

What is a Rail Gun and How does it Work?

A swarm of diamondbacks fire their "railguns" at a train.

In the Starcraft 2 campaign, there is a unit called the “diamondback”. It’s a sort of hovertank, and it is useful for hunting down other vehicles because it is armed with dual “rail guns” that can fire while it moves. In the game, the rail guns are depicted as some sort of energy weapon: they fire hot blue beams at the target. This disturbed me because rail guns actually do exist, and they most certainly don’t fire blue energy beams!

So what’s a real rail gun and how do they work? I’m so glad you asked!

To understand how a railgun works, we need to review some basic physics. In fact, railguns are often used as a homework problem in introductory electricity and magnetism! Whenever you have a current flowing through a wire, it generates a magnetic field that circles around the wire. You can use the “right hand rule” to visualize this. If you point the thumb of your right hand in the direction of an electrical current, the direction that your fingers curl is the direction of the magnetic field produced by the current. In a railgun, the power source, the two parallel rails and the conductive projectile form a circuit, with the current flowing from the power supply out one rail, crossing through the projectile, and then back along the second rail. If you use the right hand rule, you can convince yourself that the magnetic field between the rails points upward in between them, as shown in this diagram:

A schematic of a railgun showing the circulating magnetic fields around the rails and the resulting Lorentz force acting on the projectile. (Borrowed from How Stuff Works)

So, we have a current flowing across the projectile, from one rail to the other, producing an upward magnetic field between the rails. When you have a current flowing in a magnetic field, that actually results in a force on the thing carrying the current. That force is perpendicular to the current and the magnetic field, and also follows a form of the “right hand rule”. Point the fingers of your right hand in the direction the current is flowing (in the case of our projectile, it is flowing across the projectile from one rail to the other) and then partially close your hand so that the fingers are now pointing in the direction of the magnetic field (upward for our railgun) and your thumb will point in the direction of the resulting force. For the railgun, the force is along the rails, away from the power supply.

This force is what propels the projectile out of the railgun. The result is a gun that doesn’t use any explosives, but can launch a projectile at enormous speeds. The larger the current, the larger the force on the projectile, and the faster it goes! The rails themselves also are subjected to a huge amount of force trying to push them away from each other, but a well-designed railgun would be able to withstand that.

This photo is from a US Navy railgun test in 2008. The projectile was fired at 2500 meters per second, just a fraction of the velocity intended for the final version of the gun. The "fire" behind the projectile is a plume of plasma, presumably from the erosion of the rails and the projectile during firing.

Railguns aren’t science fiction: they actually exist. The US Navy has tested prototypes of a system that would be able to hit targets hundreds of miles away, and an experimental system developed by the Institute for Advanced Technology has a prototype that could punch right through a tank. The problem with current railguns is that the rails wear out due to the intense heat and forces that they have to withstand for every shot.

Railgun projectiles are much simpler than missiles or even bullets because they don’t contain any explosives. Instead, they do damage because they hit their target at extremely high speeds, and the kinetic energies involved do as much or more damage than explosives. This makes the projectiles much cheaper and safer to store, and if they could be made small enough to be mounted on a vehicle like the diamondbacks in Starcraft 2, they would also be easier to aim than a traditional gun simply because their bullets travel faster. (For very long distance firing such as for the Naval prototypes you still have to account for pesky things like the rotation of the earth, just like regular cannons.) Reloading might also be faster since there wouldn’t be an empty cartridge to eject after every shot.

A diagram showing how the naval railgun would be used. Note that is says for "direct fire" purposes, the projectile reaches the horizon in 6 seconds!

In many ways, the role that the railguns play in Starcraft 2 makes sense: they are intended to take down armored vehicles and can aim and fire rapidly on the fly. This fits perfectly with the advantages that real-world railguns would have over traditional guns! Current railguns are still in development, but I see no reason why in the future there shouldn’t be railguns suitable for the role depicted in Starcraft. My only real complaint about the railguns in Starcraft 2 is that they look like blue energy beams! Maybe they fire so fast the projectile is turned into a beam of plasma? Or maybe blue beams just look cool. I suspect the latter.


  1. Jim

    Although I agree that blue energy beams do look pretty sweet, so would a metal slug with a giant plume of PLASMA behind it! I mean, come on.

    In other news, I remember my AP Physics B exam in high school had a question about rail guns.

    • Nico L.

      I find that the giant plume of plasma would be a lot cooler in the game. plus, if you were in the enemie`s shoes in the game, which would be scarier: a cool blue beam followed by a huge noise and a gaping hole in your tank, or a great big plume of plasma followed by a huge noise and a gaping hole in your tank?

      • R. Jack

        The projectile will be traveling faster than the speed of sound , so what is the noise the enemy hears? Maybe the sound of the first split second contact with his/her tank and probably wouldn’t have time to wonder. Jack

  2. robtheviking

    nice quick overview. The railgun upgrade used on mammoth tanks in command and conquer 3 were also blue beams of ‘energy’ but they didnt look electric, they were just a solid blue beam. Perhaps it was a way to represent how a projectile moves through the air.

    • Nico L.

      or maybe they saw it in other games, and they figured that`s how railgun shots looked like?

  3. Kia

    This article is so awesome! I reckon they’re blue beams because when an object moves at extreme speeds it bends light (think “bullet time” wobbles from Matrix). If you have a look closer look on highest resolution, there is an extra spiral of blue around the laser beam so I guess they just had to improvise the graphics for a speed air bend… Either way, StarCraft II rocks my sox off and I cannot wait for the expansions!!! 🙂

    • Ryan

      Sorry, moving fast does not bend light. The ripples in the matrix are just there to look cool, just like the blue beams in Starcraft. 🙂

    • Lel

      I heard they came up with this awesome new thing called air. They use it in supersonic plane demonstrations because when you move something real fast through it it makes ripples because it’s a gas. Might be what that bullet time thing you saw was supposed to represent.

  4. Henry Roderick

    I wonder in the picture you’ve posted of the military test fire in 2008 what is the ripple in a backwards D shape that is light blue /white ish that is in front of the projectile?

    • Fruitcake

      Henry, I’m no expert but the shock wave the projectile makes at such high speeds. It could be the projectile breaking the sound barrier, but once again, I’m not sure.

    • Vismay

      in that case the armature or the conducting rod is replaced by a “rod” of plasma that connects the two positive and negatively charged wires!!!! Plasma is used to launch payloads, but not in the way depicted by starcraft…

      • Nico L.

        i`m not sure if that could work, and if it could, would it even be practical? if by “rod” you mean a cylander filled with plasma, then it could work, but it wouldn`t be able to beat a depleted uranium slug in performance. If you just meant a bunch of plasma kept together between the rails in the shape of a rod, then that might be very complicated or impossible because plasma is a gas, and gas expands and takes the shape of the container. even if it could be molded into that shape, would a “rod” of plasma have as much kinetic energy as a very hard and dense projectile? Plasma IS just superheated gas, right? so apart from burning through materials with a low fusion temperature, or searing flesh targets, how useful would plasma even be? And we`re not talking Halo`s covenant weapons here (which I think are implausible), but real life.

  5. Ad

    probably the blue “energy” spikes are representative of the plasma trails , the naval test plasma trail is only really wide because the projectile is somewhat flathheaded

    • Nico L.

      plasma is a gas, and «i think it would expand, blue or not. correct me if «i`m wrong, since I`m nothing more than a college-level fan of science who`s going for mechanical engineering.

  6. Kyle

    The blue trail is caused by the speed the projectile moves. Real life railguns make those trails too(the really powerful military ones at least).

  7. Gary

    I love railguns but what if we were able to minimize them for foot soldiers

  8. parmar hitesh

    i am student of ty elect. engg. at msu. i want to make a rail gun as my project , can u pls give some info. about it

  9. Jinn

    Blue light can be the Cherenkov radiation by the way.
    But CR works only in water or glass, where photon can move faster than 300.000 kmph.

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2020 Ryan Anderson

Theme by Anders NorenUp ↑