Deducing Elevation - sh4rkman/SquadCalc GitHub Wiki
⬅️
Previous: Deducing Altitude
•
Next: Deducing Spread
➡️
Now that we know the distance, and the height difference between weapon and target, we can jump into Projectile Motion calculations. Lets focus on the "Angle θ required to hit a (x, y) coordinate".
From Wikipedia, to hit a target at range x and altitude y when fired from (0,0) and with initial speed v the required angle(s) of launch θ are:
where :
-
g
is the ingame gravity (9.78) -
v
is the weapon velocity, which we can find in the SDK -
x
the distances between weapon and target (previously discussed here) -
y
the height difference between weapon and target (previously discussed here)
For our previous example, we found that weapon and target are 632.46m from each others, let's simplify and say there is no height difference :
- x = 632.46
- y = 0
Using the gravity (9.78) and velocity (110m/s) found in the SDK for regular mortars we now have :
That's our weapon elevation !
For every weapon and target solution, there is two firing solutions available :
- a "high" angle, between 45° and 90°
- a "low" angle, between 0° and 45°
Some weapons in Squad are locked ingame into a high angle, regular mortars for example can only shoot from 45° to 88.8°. But most vehicles can also be tilted or can already by default shoot at low angles.
same initial velocity, two firing solutions.
The wikipedia article isn't clear about it but the formula it gives only results in high angles, when in fact there is two formulas :
and
We now have the ability to calculate firing solution for high angles (regular mortars, m121) but also for weapons with more direct fire (UB32, GRAD). We can now even choose what angle we want to shoot a weapon !
⬅️
Previous: Deducing Altitude
•
Next: Deducing Spread
➡️