Damage is calculated by how much a single projectile or swing affects an enemy. They are reduced by their armor and resistances and buffed by your stats and perks. D.P.S. is calculated by the average of how much damage you output per second. This includes terrain, damage over time, and other effects so long as you created them; it also consists of the damage from your weapon.