Gun forensics, or ballistics, is a specialized study of firearms.Ballistics is used by crime scene professionals to determine the type of gun used in a shooting, the trajectory of the bullet and the angle of the shot. 
- Internal ballistics has to do with what happen inside the gun.
- External ballistics refers to the bullet's path.
- Terminal ballistics, or impact ballistics, is the study of how the bullet strikes the target.
Each of these pieces are used to help determine whether or not a firearm was used in a crime. The study of internal ballistics will be explained further down. For now, we are going to talk about external and terminal ballistics and how they are used to determine the gun that was used in a crime.
In a shooting, the crime scene technicians will trace the flight path of the bullet to help reconstruct the details leading up to the shooting. Environmental conditions, air resistance and gravity can all affect a bullets trajectory and must be considered.
In addition to determining the trajectory, crime officials will look at the damage the bullet caused. If the bullet hit a human being, they will request copies of medical reports to help determine how the bullet entered the body and the damage the bullet inflicted.
You can learn more about gun forensics in this video:
Rifling of a gun refers to the specific characteristics of a firearm's barrel. Each barrel contains a number of grooves that helps the bullet spin and exit the gun's muzzle. Manufacturers use a variety of processes to make each gun unique. These process include electrolytic processes, cutting and swagging.
Each gun creates unique markings on the bullet. These markings are used to determine whether a bullet was fired with a particular gun.  Forensic personnel will inspect the bullet used in a shooting under a microscope. Then, that bullet is compared to bullets shot in a water recovery tank. If both bullets match, they will have the gun used in a shooting.