Turret damage
The raw formula
ChanceToHit = 0.5 ^ ((((Transversal speed/(Range to target * Turret Tracking))*(Turret Signature Resolution / Target Signature Radius))^2) + ((max(0, Range to target - Turret Optimal Range))/Turret Falloff)^2)
x = random number between 0 and 1 (e.g. 0.765321), different one picked by the EVE server for each individual shot made by a gun turret If x<0.01, then quality of hit multiplier = 3, otherwise quality of hit multiplier = x + 0.5 If x>Chance to Hit, then you deal no damage, otherwise you deal damage equal to Base Damage * quality of hit multiplier.
What is each of the terms used ?
"Transversal speed" is the absolute speed (in meters/second) at which you and your target are moving away from eachother in a plane perpendicular on the line joining your ship center to the center of the target. Two ships chasing eachother in a straight line or heading straigth at eachother would have this number be zero. The smaller this number, the better your chance to hit will be.
"Range to target" is the distance (in meters) between your ship's outer boundary box to your target's outer boundary box. Two similar-sized ships that are bumping eachother, or a smaller ship very close to a station (or a much larger ship) would have this number be zero. It is notewhorthy that depending on circumstances, a smaller range to target could mean a better chance to hit, or a worse chance to hit.
"Turret Tracking" is a number qualifying your gun turret's ability to track targets (in radians/second). The larger the number, the better your chance to hit will be.
"Turret Signature Resolution" is a number qualifying the originally intended target size (in meters) of your gun turret. The smaller the number, the better your chance to hit will be.
"Target Signature Radius" should be self-explanatory (in meters). The larger your target, the better your chance to hit will be.
"Turret Optimal Range" (in meters) is the rated range of your gun turret for a 100% chance to hit against a huge, immobile target. "Turret Falloff" (in meters) is the distance past your turret's optimal range where the chance to hit against a huge immobile target drops to 50%.
"Base Damage" is a number that shows how much damage a normal shot is expected to inflict. The number is equal to the sum of damage numbers on the ammo, multiplied by the gun turret's damage multiplier (listed in the turret's showinfo window).
What does that mean for turret DPS ?
You will only deal the "lower quality" hits as the hit chance gets smaller, as the higher quality hits get discarded... so that means the average DPS decreases a bit sharper as hit chance decreases (i.e. not linearly). It also means that at exactly 1% hit chance, you start ONLY dealing wrecking shots, for a grand total of 3% from the "expected average" DPS even if your hit chance is barely 1%. A 50% hit chance would mean 1% wrecking shots and 49% normal hits linearly distributed in the *0.5 to *1.00 damage range, for a final DPS of a bit under 39.75% instead of the "expected" ~52% DPS.
Simplified form for chance to hit at or ABOVE 1%: AvgDPS = BaseDPS * [ ( ChanceToHit^2 + ChanceToHit + 0.0499 ) / 2 ] Simplified form for chance to hit at or BELOW 1%: AvgDPS = BaseDPS * 3 * ChanceToHit