Shot
Shot
A base class for creating Shot. Stores shot parameters for the trajectory calculation.
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) |
weapon |
Weapon
|
Weapon instance uses for making shot |
ammo |
Ammo
|
Ammo instance uses for making shot |
atmo |
Atmo
|
Atmo instance uses for making shot |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
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
|
weapon
|
Weapon
|
Weapon instance used for making shot |
required |
ammo
|
Ammo
|
Ammo instance used for making shot |
required |
atmo
|
Optional[Atmo]
|
Atmo instance used for making shot |
None
|
winds
|
Optional[List[Wind]]
|
list of winds used for making shot |
None
|
Example
This is how you can create a shot
from py_ballisticcalc import Weapon, Ammo, Atmo, Wind
shot = Shot(
weapon=Weapon(...),
ammo=Ammo(...),
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
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 |
|
winds
property
writable
¶
winds: Tuple[Wind, ...]
Property that returns winds sorted by until distance
Returns:
Type | Description |
---|---|
Tuple[Wind, ...]
|
Tuple[Wind, ...] sorted by until distance |
barrel_elevation
property
¶
barrel_elevation: Angular
Barrel elevation in vertical plane from horizontal
Returns:
Type | Description |
---|---|
Angular
|
Angle of barrel elevation in vertical plane from horizontal |
barrel_azimuth
property
¶
barrel_azimuth: Angular
Horizontal angle of barrel relative to sight line
Returns:
Type | Description |
---|---|
Angular
|
Horizontal angle of barrel relative to sight line |