o-murphy / py-ballisticcalc

LGPL library for small arms ballistic calculations based on point-mass (3 DoF) plus spin drift.
https://pypi.org/project/py-ballisticcalc
GNU Lesser General Public License v3.0
21 stars 8 forks source link

Issue with look angle calculations #70

Closed gambon2010 closed 4 months ago

gambon2010 commented 4 months ago

Describe the bug When a calculation is done with a look angle != 0, the drop adjust is higher than with a 0 degree angle instead of being lower.

To Reproduce

    dm = DragModel(0.462, TableG1, 168, 0.3, 1.17)
    ammo=Ammo(dm, Velocity.MPS(810), Temperature.Celsius(15))
    ammo.calc_powder_sens(Velocity.MPS(811), Temperature.Celsius(0))
    weapon = Weapon(sight_height=Distance.Centimeter(9), twist=15)
    atmo = Atmo(altitude=Distance.Foot(1000), temperature=Unit.Celsius(5), humidity=.5)
    zero = Shot(weapon=weapon, ammo=ammo, atmo=atmo, look_angle=0) //change look angle here
    calc = Calculator()
    calc.set_weapon_zero(zero, Distance.Meter(100))
    range_card = calc.fire(zero, trajectory_range=1000)

Expected behavior When look angle is not 0, the drop_adj correction should be a smaller value than when it is 0

Ex: Look angle 0

     distance     time    drop_adj
0      0.0 yd  0.000 s    0.00 mil 
1    100.0 yd  0.117 s   -0.01 mil
2    200.0 yd  0.244 s   -0.32 mil
3    300.0 yd  0.381 s   -1.06 mil
4    400.0 yd  0.529 s   -1.98 mil
5    500.0 yd  0.691 s   -3.06 mil
6    600.0 yd  0.867 s   -4.30 mil
7    700.0 yd  1.060 s   -5.72 mil
8    800.0 yd  1.271 s   -7.34 mil
9    900.0 yd  1.501 s   -9.19 mil
10  1000.0 yd  1.751 s  -11.30 mil

Look angle 30

     distance     time    drop_adj
0      0.0 yd  0.000 s    0.00 mil
1    100.0 yd  0.136 s    0.19 mil
2    200.0 yd  0.284 s   -0.26 mil
3    300.0 yd  0.446 s   -1.07 mil
4    400.0 yd  0.625 s   -2.06 mil
5    500.0 yd  0.821 s   -3.23 mil
6    600.0 yd  1.040 s   -4.59 mil
7    700.0 yd  1.282 s   -6.18 mil
8    800.0 yd  1.550 s   -8.03 mil
9    900.0 yd  1.846 s  -10.19 mil
10  1000.0 yd  2.168 s  -12.68 mil

Environment:

gambon2010 commented 4 months ago

I was mistaken about how the calculation was done and mistook correction and prediction. The tables here are predicted impacts not the correction needed to hit a target