TrajectoryData
HitResult
dataclass
¶
HitResult(shot: Shot, trajectory: list[TrajectoryData], extra: bool = False)
Results of the shot
zeros ¶
zeros() -> list[TrajectoryData]
:return: zero crossing points
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
202 203 204 205 206 207 208 |
|
index_at_distance ¶
index_at_distance(d: Distance) -> int
:param d: Distance for which we want Trajectory Data :return: Index of first trajectory row with .distance >= d; otherwise -1
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
210 211 212 213 214 215 216 217 |
|
get_at_distance ¶
get_at_distance(d: Distance) -> TrajectoryData
:param d: Distance for which we want Trajectory Data :return: First trajectory row with .distance >= d
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
219 220 221 222 223 224 225 226 227 228 |
|
danger_space ¶
danger_space(at_range: Union[float, Distance], target_height: Union[float, Distance], look_angle: Optional[Union[float, Angular]] = None) -> DangerSpace
Assume that the trajectory hits the center of a target at any distance. Now we want to know how much ranging error we can tolerate if the critical region of the target has height h. I.e., we want to know how far forward and backward along the line of sight we can move a target such that the trajectory is still within h/2 of the original drop.
:param at_range: Danger space is calculated for a target centered at this sight distance :param target_height: Target height (h) determines danger space :param look_angle: Ranging errors occur along the look angle to the target
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
|
dataframe ¶
dataframe(formatted: bool = False) -> DataFrame
:param formatted: False for values as floats; True for strings with prefer_units :return: the trajectory table as a DataFrame
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
298 299 300 301 302 303 304 305 306 307 308 309 |
|
plot ¶
plot(look_angle: Optional[Angular] = None) -> Axes
:return: graph of the trajectory
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
312 313 314 315 316 317 318 319 320 |
|
TrajFlag ¶
Bases: int
Flags for marking trajectory row if Zero or Mach crossing Also uses to set a filters for a trajectory calculation loop
name
staticmethod
¶
Return a concatenated name representation of the given flag value.
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
40 41 42 43 44 45 46 47 48 49 50 |
|
DangerSpace ¶
Bases: NamedTuple
Stores the danger space data for distance specified
overlay ¶
overlay(ax: Axes, label: Optional[str] = None)
Highlights danger-space region on plot
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
171 172 173 174 175 176 177 178 179 |
|
TrajectoryData ¶
Bases: NamedTuple
Data for one point in ballistic trajectory
Attributes:
Name | Type | Description |
---|---|---|
time |
float
|
bullet flight time |
distance |
Distance
|
x-axis coordinate |
velocity |
Velocity
|
velocity |
mach |
float
|
velocity in Mach prefer_units |
height |
Distance
|
y-axis coordinate |
target_drop |
Distance
|
drop relative to sight-line |
drop_adj |
Angular
|
sight adjustment to zero target_drop at this distance |
windage |
Distance
|
|
windage_adj |
Angular
|
|
look_distance |
Distance
|
sight-line distance = .distance/cosine(look_angle) |
# |
look_height (Distance
|
y-coordinate of sight-line = .distance*tan(look_angle) |
angle |
Angular
|
Angle of velocity vector relative to x-axis |
density_factor |
float
|
Ratio of air density here to standard density |
drag |
float
|
Current drag coefficient |
energy |
Energy
|
|
ogw |
Weight
|
optimal game weight |
flag |
int
|
row type |
formatted ¶
formatted() -> Tuple[str, ...]
:return: matrix of formatted strings for each value of trajectory in default prefer_units
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
in_def_units ¶
in_def_units() -> Tuple[float, ...]
:return: matrix of floats of the trajectory in default prefer_units
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|