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
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 |
|
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 |