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
193 194 195 196 197 198 199 |
|
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
201 202 203 204 205 206 207 208 |
|
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
210 211 212 213 214 215 216 217 218 219 |
|
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
222 223 224 225 226 227 228 229 230 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 |
|
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
289 290 291 292 293 294 295 296 297 298 299 300 |
|
plot ¶
plot(look_angle: Optional[Angular] = None) -> Axes
:return: graph of the trajectory
Source code in py_ballisticcalc\trajectory_data\_trajectory_data.py
303 304 305 306 307 308 309 310 311 |
|
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
39 40 41 42 43 44 45 46 47 48 49 |
|
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
162 163 164 165 166 167 168 169 170 |
|
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
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
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
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|