Shot
Shot
dataclass
¶
Shot(
ammo: Ammo,
weapon: Optional[Weapon] = None,
look_angle: Optional[Union[float, Angular]] = None,
relative_angle: Optional[Union[float, Angular]] = None,
cant_angle: Optional[Union[float, Angular]] = None,
atmo: Optional[Atmo] = None,
winds: Optional[Sequence[Wind]] = None,
)
All information needed to compute a ballistic trajectory.
Attributes:
Name | Type | Description |
---|---|---|
look_angle |
Angular
|
Angle of sight line relative to horizontal. If the look_angle != 0 then any target in sight crosshairs will be at a different altitude: With target_distance = sight distance to a target (i.e., as through a rangefinder): * Horizontal distance X to target = cos(look_angle) * target_distance * Vertical distance Y to target = sin(look_angle) * target_distance |
relative_angle |
Angular
|
Elevation adjustment added to weapon.zero_elevation for a particular shot. |
cant_angle |
Angular
|
Tilt of gun from vertical, which shifts any barrel elevation from the vertical plane into the horizontal plane by sine(cant_angle) |
ammo |
Ammo
|
Ammo instance used for making shot |
weapon |
Weapon
|
Weapon instance used for making shot |
atmo |
Atmo
|
Atmo instance used for making shot |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ammo
|
Ammo
|
Ammo instance used for making shot |
required |
weapon
|
Optional[Weapon]
|
Weapon instance used for making shot |
None
|
look_angle
|
Optional[Union[float, Angular]]
|
Angle of sight line relative to horizontal. If the look_angle != 0 then any target in sight crosshairs will be at a different altitude: With target_distance = sight distance to a target (i.e., as through a rangefinder): * Horizontal distance X to target = cos(look_angle) * target_distance * Vertical distance Y to target = sin(look_angle) * target_distance |
None
|
relative_angle
|
Optional[Union[float, Angular]]
|
Elevation adjustment added to weapon.zero_elevation for a particular shot. |
None
|
cant_angle
|
Optional[Union[float, Angular]]
|
Tilt of gun from vertical, which shifts any barrel elevation from the vertical plane into the horizontal plane by sine(cant_angle) |
None
|
atmo
|
Optional[Atmo]
|
Atmo instance used for making shot |
None
|
winds
|
Optional[Sequence[Wind]]
|
list of winds used for making shot |
None
|
Example
from py_ballisticcalc import Weapon, Ammo, Atmo, Wind
shot = Shot(
ammo=Ammo(...),
weapon=Weapon(...),
look_angle=Unit.Degree(5),
relative_angle=Unit.Degree(0),
cant_angle=Unit.Degree(0),
atmo=Atmo(...),
winds=[Wind(...), ... ]
)
Source code in py_ballisticcalc/conditions.py
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 |
|
Attributes¶
barrel_elevation
property
writable
¶
barrel_elevation: Angular
Total barrel elevation (in vertical plane) from horizontal.
Returns:
Type | Description |
---|---|
Angular
|
Angle of barrel elevation in vertical plane from horizontal
|