How is starship damage calculated?

//ads -- adsterra.com -- native banner
?>
I know that damage is calculated based on multiple variables:
- weapon strength (weapons can be upgraded)
- weapon type
- shield strength (hence fighters receive more damage than full size starships)
- attacker position (without modification, side and rear shields are less effective than forward shields)
Despite this the damage range can be phenomenal, ranging from double digits right up to this (damage of 7706!):
Can anyone please explain how damage is calculated? I'm curious to know especially why there can be such large apparent discrepancies.
Pictures about "How is starship damage calculated?"



Mr. Autofire | How is Damage calculated?
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Mike B, Photography Maghradze PH, Matthias Groeneveld, Andrea Piacquadio