Skip to content

Commit

Permalink
Readme update, doc assets update
Browse files Browse the repository at this point in the history
  • Loading branch information
o-murphy committed Sep 2, 2024
1 parent 35b66e3 commit 7039be9
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 33 deletions.
62 changes: 34 additions & 28 deletions Example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"execution_count": 2,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:34.696489900Z",
"start_time": "2024-08-19T16:02:34.657717800Z"
"end_time": "2024-09-02T16:53:47.386403700Z",
"start_time": "2024-09-02T16:53:47.349187400Z"
}
},
"outputs": [
Expand Down Expand Up @@ -63,8 +63,8 @@
"execution_count": 3,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:34.725343400Z",
"start_time": "2024-08-19T16:02:34.700559800Z"
"end_time": "2024-09-02T16:53:47.444508500Z",
"start_time": "2024-09-02T16:53:47.388402900Z"
}
},
"outputs": [
Expand Down Expand Up @@ -97,15 +97,16 @@
"execution_count": 4,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:35.149596900Z",
"start_time": "2024-08-19T16:02:34.756904100Z"
"end_time": "2024-09-02T16:53:47.855528400Z",
"start_time": "2024-09-02T16:53:47.416857700Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"300.0yd\n",
"Danger space at 300.0yd for 19.7inch tall target ranges from 217.1yd to 355.8yd\n"
]
},
Expand All @@ -119,14 +120,18 @@
}
],
"source": [
"# Plot trajectory out to 500 yards\n",
"# Plot trajectory out to 1000 yards\n",
"shot_result = calc.fire(zero, trajectory_range=500, extra_data=True)\n",
"ax = shot_result.plot()\n",
"# Find danger space for a half-meter tall target at 300 yards\n",
"danger_space = shot_result.danger_space(Distance.Yard(300), Distance.Meter(.5))\n",
"print(danger_space)\n",
"danger_space.overlay(ax) # Highlight danger space on the plot\n",
"plt.show()"
"plt.show()\n",
"# fig = ax.get_figure()\n",
"# fig.patch.set_alpha(0.0) # Transparent figure background\n",
"# ax.patch.set_alpha(0.0) # Transparent axes background\n",
"# fig.savefig('./demo.png', transparent=True)"
]
},
{
Expand All @@ -141,8 +146,8 @@
"execution_count": 5,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:35.262250Z",
"start_time": "2024-08-19T16:02:35.149596900Z"
"end_time": "2024-09-02T16:53:47.951392200Z",
"start_time": "2024-09-02T16:53:47.845022900Z"
}
},
"outputs": [
Expand Down Expand Up @@ -181,8 +186,8 @@
"execution_count": 6,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:35.386644400Z",
"start_time": "2024-08-19T16:02:35.258248400Z"
"end_time": "2024-09-02T16:53:48.059308300Z",
"start_time": "2024-09-02T16:53:47.949393Z"
}
},
"outputs": [
Expand Down Expand Up @@ -231,8 +236,8 @@
"execution_count": 7,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:35.658774Z",
"start_time": "2024-08-19T16:02:35.350079300Z"
"end_time": "2024-09-02T16:53:48.353800900Z",
"start_time": "2024-09-02T16:53:48.040660600Z"
}
},
"outputs": [
Expand Down Expand Up @@ -295,8 +300,8 @@
"execution_count": 8,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:35.808865900Z",
"start_time": "2024-08-19T16:02:35.666283200Z"
"end_time": "2024-09-02T16:53:48.473032Z",
"start_time": "2024-09-02T16:53:48.352804500Z"
}
},
"outputs": [
Expand Down Expand Up @@ -336,8 +341,8 @@
"execution_count": 9,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:37.492460100Z",
"start_time": "2024-08-19T16:02:35.770796900Z"
"end_time": "2024-09-02T16:53:50.057193700Z",
"start_time": "2024-09-02T16:53:48.519744400Z"
}
},
"outputs": [
Expand All @@ -348,6 +353,7 @@
"To hit target at look-distance of 700.0m sighted at a 30.0° look-angle, barrel elevation=6.1mil\n",
"\t(horizontal distance to this target is 606.2m)\n",
"Current zero has barrel elevated 4.694mil so hold for new shot is 1.406mil\n",
"700.0m\n",
"Danger space at 700.0m for 4.0m tall target at 30.0° look-angle ranges from 445.9m to 824.5m\n"
]
},
Expand Down Expand Up @@ -404,8 +410,8 @@
"execution_count": 10,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:38.391415400Z",
"start_time": "2024-08-19T16:02:37.494461700Z"
"end_time": "2024-09-02T16:53:50.975358200Z",
"start_time": "2024-09-02T16:53:50.055193800Z"
}
},
"outputs": [
Expand Down Expand Up @@ -442,8 +448,8 @@
"execution_count": 11,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:38.459695700Z",
"start_time": "2024-08-19T16:02:38.392401600Z"
"end_time": "2024-09-02T16:53:51.043366900Z",
"start_time": "2024-09-02T16:53:50.973353300Z"
}
},
"outputs": [
Expand Down Expand Up @@ -475,8 +481,8 @@
"execution_count": 12,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:38.573174800Z",
"start_time": "2024-08-19T16:02:38.465207800Z"
"end_time": "2024-09-02T16:53:51.151898600Z",
"start_time": "2024-09-02T16:53:51.040359600Z"
}
},
"outputs": [
Expand Down Expand Up @@ -513,8 +519,8 @@
"execution_count": 13,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:38.917905100Z",
"start_time": "2024-08-19T16:02:38.576680Z"
"end_time": "2024-09-02T16:53:51.504495700Z",
"start_time": "2024-09-02T16:53:51.154900600Z"
}
},
"outputs": [
Expand Down Expand Up @@ -575,8 +581,8 @@
"execution_count": 14,
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-19T16:02:38.919906700Z",
"start_time": "2024-08-19T16:02:38.889187Z"
"end_time": "2024-09-02T16:53:51.533058300Z",
"start_time": "2024-09-02T16:53:51.456841200Z"
}
},
"outputs": [
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ plt.show()
```

Danger space at 300.0yd for 19.7inch tall target ranges from 217.1yd to 355.7yd
![plot](doc/output_2_1.png)
![plot](doc/TrajectoryPlot1.png)


## Print Range Card
Expand Down Expand Up @@ -252,12 +252,12 @@ print(f'Comparison: {unit_in_meter} > .1*{unit_in_meter}: {unit_in_meter > .1*un
The shooter typically cares about the line of sight (LoS): Sight adjustments (_drop_ in the following figure) are made relative to LoS, and ranging errors – and hence [danger space](#danger-space) – follow the line of sight, not the horizon.

The following diagram shows how _look distance_ and _drop_ relate by _look angle_ to the underlying (distance _x_, height _y_) trajectory data.
![Look-angle trigonometry](doc/BallisticTrig.png)
![Look-angle trigonometry](doc/BallisticTrig.svg)

## Danger Space
Danger space is a practical measure of sensitivity to ranging error. It is defined for a target of height *h* and distance *d*, and it indicates how far forward and backward along the line of sight the target can move such that the trajectory will still hit somewhere (vertically) on the target.

![Danger Space](doc/DangerSpace.png)
![Danger Space](doc/DangerSpace.svg)

# About project

Expand Down
4 changes: 2 additions & 2 deletions aerial_target/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ We uses simplified model, so it is assumed that
* sight look angle
* target's size (to accurate adjustment)

<img src="./assets/aerial_target.svg" alt="Aerial Target" style="width: 100%;">
<img src="./assets/AerialTargetTrajectory.svg" alt="Aerial Target" style="width: 100%;">


## We can create a precalculated reticle for specific projectile and target
There the reticle example that was precalculated for the target size of ~3m, velocity - 50mps, look distance - 800m and the look angle - 20 degrees

<img src="./assets/aerial_target_reticle.svg" alt="Aerial Target" style="width: 100%;">
<img src="./assets/AerialTargetReticle.svg" alt="Aerial Target" style="width: 100%;">
File renamed without changes
4 changes: 4 additions & 0 deletions doc/BallisticTrig.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions doc/DangerSpace.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/TrajectoryPlot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions py_ballisticcalc/trajectory_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def danger_space(self,
look_angle = PreferredUnits.angular(look_angle)

# Get index of first trajectory point with distance >= at_range
print(at_range)
if (index := self.index_at_distance(at_range)) < 0:
raise ArithmeticError(
f"Calculated trajectory doesn't reach requested distance {at_range}"
Expand Down

0 comments on commit 7039be9

Please sign in to comment.