Package: ballistics 0.51.0.1

Alex Jokela

ballistics: High-Performance Exterior Ballistics Trajectory Engine

Native R bindings to the 'ballistics-engine' Rust crate via 'extendr'. Provides exterior ballistics trajectory integration (RK4, adaptive RK45, fast fixed-step, and Euler), zeroing, ICAO and CIPM moist-air atmospheric modeling, 3D and segmented wind fields, boundary-layer wind shear, minimax wind-scenario hold corridors, G1-G8/GI/GS/RA4 and custom drag models, spin drift, pitch damping, precession/nutation, aerodynamic jump, gyroscopic stability, BC conversion/estimation/5D lookup tables, Monte Carlo and adaptive confidence sequences, Weapon Employment Zone (WEZ), sensitivity perturbation, counterfactual explanation, first-order error budgets, tolerance envelopes, MV/BC/Bayesian/DSF/wind/tall-target truing, turret/reticle engagement planning, parametric and imported reticles, adaptive range cards, printable PDF dope cards, ArcherBC2 .a7p profile import/export, moving-target lead, SAAMI free recoil, competition power factor, and the versioned JSON command bridge.

Authors:Alex Jokela [aut, cre]

ballistics_0.51.0.1.tar.gz
ballistics_0.51.0.1.zip(r-4.7-x86_64)ballistics_0.51.0.1.zip(r-4.6-x86_64)ballistics_0.51.0.1.zip(r-4.5-x86_64)
ballistics_0.51.0.1.tgz(r-4.6-x86_64)ballistics_0.51.0.1.tgz(r-4.6-arm64)ballistics_0.51.0.1.tgz(r-4.5-x86_64)ballistics_0.51.0.1.tgz(r-4.5-arm64)
ballistics_0.51.0.1.tar.gz(r-4.7-arm64)ballistics_0.51.0.1.tar.gz(r-4.7-x86_64)ballistics_0.51.0.1.tar.gz(r-4.6-arm64)ballistics_0.51.0.1.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
ballistics/json (API)

# Install 'ballistics' in R:
install.packages('ballistics', repos = c('https://ajokela.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ajokela/ballistics-r/issues

On CRAN:

Conda:

ballisticsextendrexterior-ballisticsrustcargo

1.70 score 2 scripts 218 exports 0 dependencies

Last updated from:59ccaff155. Checks:12 OK, 3 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK299
linux-devel-x86_64OK332
source / vignettesOK364
linux-release-arm64OK298
linux-release-x86_64OK303
macos-release-arm64OK254
macos-release-x86_64OK719
macos-oldrel-arm64OK369
macos-oldrel-x86_64OK763
windows-devel-arm64FAIL315
windows-devel-x86_64OK523
windows-release-arm64FAIL351
windows-release-x86_64OK471
windows-oldrel-x86_64OK324
wasm-releaseFAIL233

Exports:a7p_carried_fieldsadjusted_muzzle_velocityadjustment_displayadjustment_factoradvanced_spin_driftadvanced_stabilityadvanced_yaw_of_reposeaerodynamic_jumpaerodynamic_jump_launch_offsetair_atair_density_cipmanalyze_bc_segmentsangular_accelerationapply_dsf_trajectoryapply_form_factorapply_reynolds_correctionas_json_arrayas_json_objectas_resolved_requestatmo_sockatmospheric_conditionsballistic_inputsballistics_constantsballistics_solverbc_table_loadbc5d_caliber_to_keybc5d_managerbc5d_table_from_bytesbc5d_table_loadboundary_layer_speed_ratiobrent_root_findbridge_callcalculate_atmospherecalculate_cepcalculate_leadcalculate_zero_anglecalculate_zero_rangecheck_station_aircheck_trajectory_stabilitycli_commandsclicks_forcluster_bc_predictcombined_angular_motioncome_upscompare_loadscompass_to_shooter_bearingcompute_derivativescompute_wezconfidence_ellipseconfidence_sequenceconvert_bc_at_machconvert_bc_at_velocityconvert_bc_segmentscorrect_chrono_velocitycourtney_miller_plastic_tipcrosswind_jump_sensitivitydamped_yaw_of_reposedecode_solve_request_v1default_form_factordefault_twist_inchesdensity_altitudedensity_matched_altitudederivatives_interpolated_bcderive_dsf_pointdial_plandiscretize_truing_rangesdope_card_layout_infodrag_coefficientdrag_coefficient_fulldrag_tabledrop_to_adjustmentdsf_tabledsf_window_startdynamic_stability_spineffective_sgengine_versionenhanced_spin_driftenhanced_spin_drift_simpleepicyclic_frequenciesepicyclic_motionerror_budgetestimate_bcestimate_bc_segmentsestimate_bullet_lengthevaluate_power_factorexplain_differenceexport_a7pfaa_density_altitudefast_integrateformat_reference_drag_curveformat_reticle_descriptionfree_recoilgenerate_dope_card_pdfgyroscopic_drifthold_curvehold_point_in_reticleidentify_bullet_typeimport_a7pimport_reticle_documentimport_ventum_reticleintegrate_trajectoryinterpolate_powder_curvelead_from_toflimit_cycle_yawlitz_crosswind_jumplitz_spin_driftlocal_atmospherelooks_like_drgmagnus_driftmc_percentilemoist_speed_of_soundmoment_of_inertiamover_ringmulti_observation_truingmv_calibration_windownutation_amplitudep_hit_bivariateparse_click_valueparse_drgparse_powder_sweepparse_target_sizeparse_target_specparse_wind_directionparse_wind_observationparse_wind_scenario_setparse_wind_segmentpdf_cardpdf_ladder_bc_labelperturbation_axesperturbation_axes_in_groupperturbation_bisect_axisperturbation_central_differenceperturbation_evaluateperturbation_read_axisperturbation_with_axispitch_damping_coefficientpitch_damping_momentplan_correctionsplan_truing_experimentpower_factorprecession_with_dampingpredict_stability_at_distancepressure_altitudeprofile_opticquantize_anglequick_drop_estimaterange_tablerecommend_bc_familyreduce_qnhreference_drag_tablerender_terminal_chartresolve_powder_velocityresolve_projectile_shaperesolve_station_conditionsreticle_bdc_from_dropsreticle_by_idreticle_catalogreticle_mil_dotreticle_mil_gridreticle_scaled_marksreticle_treerevolution_annotationrun_monte_carlorun_monte_carlo_adaptivesample_points_for_vizsample_trajectorysanitize_profile_namesight_correction_for_jumpsolve_request_v1solve_robust_holdsolve_trajectorysolve_trajectory_mcsolve_v1special_erfspecial_erfcspecial_ln_betaspecial_ln_gammaspecial_normal_cdfspin_damping_momentspin_decay_correction_factorspin_decay_ratespin_driftspin_drift_ml_correctionspin_ratestability_coefficientstability_reportstation_airstation_for_density_altitudestation_pressure_plausibilitytall_targetterminal_canvastolerance_envelopetracking_cf_in_rangetransonic_correctiontransonic_drag_risetransverse_moment_of_inertiatrue_velocitytrue_winduncertainty_truingunit_convertupdate_spin_ratevalidate_opticvalidate_profilevalidate_relative_humidityvalidate_reticlevalidate_wind_segmentswelfordwilson_intervalwind_at_positionwind_cardwind_conditionswind_fieldwind_shear_at_altitudewind_shear_sock_vectorwind_sockwind_vectoryaw_of_reposezero_banner_dial_values

Dependencies:

Readme and manuals

Help Manual

Help pageTopics
List 'ProfileData' fields carried by the '.a7p' export formata7p_carried_fields
Powder-temperature-adjusted muzzle velocity from 'BallisticInputs'adjusted_muzzle_velocity
Format an angular or quantized-click adjustment with optional bias and tracking CFadjustment_display
Angular conversion factor for a click base unit ('mil', 'moa', 'smoa')adjustment_factor
Bullet-type advanced spin drift (meters)advanced_spin_drift
Advanced gyroscopic stability accounting for bullet type and boat tailadvanced_stability
Legacy advanced yaw of repose helperadvanced_yaw_of_repose
Detailed aerodynamic jump componentsaerodynamic_jump
Compute aerodynamic-jump launch-angle offset (radians)aerodynamic_jump_launch_offset
Evaluate local air properties aloft and downrange ('atmosphere::air_at')air_at
CIPM moist-air density calculation (vectorized)air_density_cipm
Convert and analyze velocity-banded BC segments with family recommendationanalyze_bc_segments
Angular acceleration 'moment / moment_of_inertia' (rad/s^2)angular_acceleration
Solve a trajectory and apply a Mach-keyed DSF table post-correctionapply_dsf_trajectory
Apply form factor to a base drag coefficientapply_form_factor
Apply low-Reynolds-number drag correctionapply_reynolds_correction
Mark a vector to always serialize as a JSON array (even when length 1)as_json_array
Mark an empty list to serialize as an empty JSON object '{}'as_json_object
Mark a list as an already-resolved solve requestas_resolved_request
Create a downrange atmosphere-segment ('AtmoSock') handleatmo_sock
Construct an 'AtmosphericConditions' configuration listatmospheric_conditions
Construct a 'BallisticInputs' configuration listballistic_inputs
Physical and numerical constants from 'ballistics-engine'ballistics_constants
Create a stateful 'BallisticsSolver' handleballistics_solver
Load a legacy offline binary BC correction table ('BcCorrectionTable')bc_table_load
Convert a caliber in inches to its integer 5D table keybc5d_caliber_to_key
Create a directory-backed 5D BC table manager ('Bc5dTableManager')bc5d_manager
Parse a 5D ML BC table ('Bc5dTable') from raw bytesbc5d_table_from_bytes
Load a caliber-specific 5D ML BC table ('Bc5dTable') from diskbc5d_table_load
Boundary-layer wind-shear speed ratio vs. height above launchboundary_layer_speed_ratio
Brent's method 1D root finder backed by Rust ('angle_calculations::brent_root_find')brent_root_find
Invoke the unified versioned JSON command bridge ('ballistics_engine::bridge')bridge_call
Calculate air density and speed of sound at one or more altitudescalculate_atmosphere
Circular Error Probable (CEP, 50% radius) from 2D impact coordinatescalculate_cep
Solve wind-aware moving-target intercept leadcalculate_lead
Calculate the zero launch angle (radians)calculate_zero_angle
Find near and far zero crossing distances from a launch anglecalculate_zero_range
Validate combined station air conditionscheck_station_air
Assess whether a bullet stays gyroscopically stable through terminal rangecheck_trajectory_stability
List all 'ballistics-engine' CLI commands and surface availabilitycli_commands
Compute whole turret clicks for a linear drop at a rangeclicks_for
Predict empirical BC degradation cluster and optional velocity-adjusted BCcluster_bc_predict
Advance combined precession/nutation 'AngularState' by one step 'dt'combined_angular_motion
Generate a come-ups elevation adjustment card ('card_service::come_ups_v1')come_ups
Compare multiple ballistic loads side-by-side ('terminal_commands::compare')compare_loads
Convert a compass wind bearing to shooter-relative anglecompass_to_shooter_bearing
Compute instantaneous 6-DOF equations-of-motion derivativescompute_derivatives
Compute Weapon Employment Zone (WEZ) hit probability vs. rangecompute_wez
95% confidence ellipse from 2D impact coordinatesconfidence_ellipse
Create an anytime-valid 'BernoulliConfidenceSequence' handleconfidence_sequence
Convert a scalar BC between drag-model families at a given Mach numberconvert_bc_at_mach
Convert a scalar BC between drag-model families at a given velocity (fps)convert_bc_at_velocity
Convert velocity-banded BC segments between reference drag familiesconvert_bc_segments
Back-solve true muzzle velocity from a downrange chronograph readingcorrect_chrono_velocity
Courtney-Miller plastic-tip stability correctioncourtney_miller_plastic_tip
Crosswind aerodynamic-jump sensitivity (MOA per m/s)crosswind_jump_sensitivity
Damped yaw of repose and convergence ratedamped_yaw_of_repose
Decode and validate a 'solve-json' v1 requestdecode_solve_request_v1
Get legacy default form factor by bullet name and drag modeldefault_form_factor
Estimate default barrel twist rate (inches/turn) targeting Sg = 2.0default_twist_inches
Run the versioned 'atmosphere.density_altitude' v1 servicedensity_altitude
Density-matched standard altitude (meters)density_matched_altitude
Interpolate Mach-keyed BC segmentsderivatives_interpolated_bc
Derive a Mach-keyed DSF point from an observed drop ('truing_service::derive_dsf_point_v1')derive_dsf_point
Compute a dial/hold/hybrid engagement plan via 'truing_service::dial_plan_v1'dial_plan
Discretize a candidate range interval (yards) for truing experiment planningdiscretize_truing_ranges
Query PDF dope card pagination layout ('rows_per_page', 'page_count')dope_card_layout_info
Evaluate standard reference drag coefficient Cd(Mach) (vectorized)drag_coefficient
Evaluate drag coefficient with optional transonic and Reynolds correctionsdrag_coefficient_full
Construct a custom or reference 'DragTable' handledrag_table
Convert linear drop and range into angular turret adjustment (vectorized)drop_to_adjustment
Create a Mach-keyed Drop Scale Factor ('DsfTable') handledsf_table
Compute the DSF truing window start distance (meters) from Mach 0.9 distancedsf_window_start
Dynamic gyroscopic stability from bullet geometry and spin ratedynamic_stability_spin
Compute effective gyroscopic stability factor (Sg) from 'BallisticInputs'effective_sg
Get the underlying ballistics-engine versionengine_version
Full enhanced spin drift decomposition ('SpinDriftComponents')enhanced_spin_drift
Simplified enhanced spin drift (meters)enhanced_spin_drift_simple
Epicyclic precession and nutation frequencies (rad/s)epicyclic_frequencies
Compute instantaneous epicyclic (pitch_rad, yaw_rad) at time 't'epicyclic_motion
Propagate input uncertainties to impact covariance and ranked variance shareserror_budget
Estimate ballistic coefficient from observed drop or velocity dataestimate_bc
Empirically estimate velocity-banded BC segments from bullet characteristicsestimate_bc_segments
Estimate bullet length (meters) from diameter and massestimate_bullet_length
Evaluate bullet load against all USPSA, IDPA, and SASS power-factor divisionsevaluate_power_factor
Explain differences between two solve requests by symmetric counterfactual group swapsexplain_difference
Export a 'ProfileData' list to an ArcherBC2 '.a7p' binary fileexport_a7p
FAA-rule density altitude (feet)faa_density_altitude
Fast fixed-step trajectory integrationfast_integrate
Format a built-in reference drag curve as table, CSV, or JSON textformat_reference_drag_curve
Format a 'ReticleDescription' as table or JSON textformat_reticle_description
SAAMI free-recoil momentum-balance calculatorfree_recoil
Render a printable PDF dope card directly from 'DopeCardConfig' and 'CardRow'sgenerate_dope_card_pdf
Pure gyroscopic spin drift component (meters)gyroscopic_drift
Solve an interpolated drop-vs-range 'HoldCurve' handlehold_curve
Locate a (drop_mil, wind_mil) hold point within a reticlehold_point_in_reticle
Identify bullet type classification, sectional density, and degradation factorsidentify_bullet_type
Import an ArcherBC2 '.a7p' binary ballistic profileimport_a7p
Import a third-party '.reticle' XML drawing documentimport_reticle_document
Import a Ventum JSON reticle specificationimport_ventum_reticle
Low-level ODE trajectory integration (RK4 / RK45 / Euler)integrate_trajectory
Interpolate a measured powder temperature-to-velocity curveinterpolate_powder_curve
Compute moving-target lead components from an explicit time of flightlead_from_tof
Limit-cycle yaw angle (radians)limit_cycle_yaw
Litz crosswind aerodynamic-jump estimator (MOA)litz_crosswind_jump
Litz spin drift approximation (vectorized)litz_spin_drift
Local atmosphere lapse from base station conditionslocal_atmosphere
Detect whether text looks like a '.drg' Doppler drag filelooks_like_drg
Magnus lateral drift component (meters)magnus_drift
Linear-interpolated percentile over a sorted numeric vectormc_percentile
Moist-air speed of sound (vectorized)moist_speed_of_sound
Axial moment of inertia Ix (kg*m^2)moment_of_inertia
Compute moving-target uncertainty ring radiusmover_ring
Multi-observation joint MV and BC truingmulti_observation_truing
Compute the recommended MV calibration range window (meters) from Mach 1.2 distancemv_calibration_window
Damped nutation amplitude at time 't'nutation_amplitude
Bivariate normal hit probability over a rectangular or circular targetp_hit_bivariate
Parse a turret click graduation specification (e.g. '"0.1mil"', '"0.25moa"', '"1/8moa"')parse_click_value
Parse a '.drg' Doppler drag-curve text file or stringparse_drg
Parse a powder temperature sweep specificationparse_powder_sweep
Parse a WEZ target-size specification string (e.g. '"18x30"', '"5"')parse_target_size
Parse a target specification string (e.g. '"rect:18x30"', '"circle:10"')parse_target_spec
Parse a wind direction token (degrees, or a clock position like '"3oc"' or '"10h30"')parse_wind_direction
Parse a wind-truing observation string (e.g. '"600:-8.5"')parse_wind_observation
Parse a named wind-scenario set documentparse_wind_scenario_set
Parse a CLI-style wind segment specification stringparse_wind_segment
Generate a printable PDF dope card via 'card_service::pdf_card_v1'pdf_card
Format footer BC label text for velocity-keyed BC ladders on printed dope cardspdf_ladder_bc_label
List all 32 perturbation input axes and their metadataperturbation_axes
List perturbation axes belonging to a named 'InputGroup'perturbation_axes_in_group
Bisect a single continuous 'InputAxis' against a monotone R predicateperturbation_bisect_axis
Compute central-difference drop and windage sensitivities along one 'InputAxis'perturbation_central_difference
Evaluate a 'SolveRequestV1' at explicit downrange distances via the perturbation kernelperturbation_evaluate
Read the value of a single 'InputAxis' from a solve requestperturbation_read_axis
Return a copy of a solve request with one 'InputAxis' modifiedperturbation_with_axis
Pitch damping coefficient 'C_mq + C_m_alpha_dot' vs. Mach (vectorized)pitch_damping_coefficient
Pitch damping aerodynamic moment (N*m)pitch_damping_moment
Plan dial, hold, or hybrid engagement corrections for an opticplan_corrections
Design an optimal observation-range plan for identifiable MV/BC truingplan_truing_experiment
Plot a trajectoryplot.ballistics_trajectory
Compute competition power factor ('weight_gr * velocity_fps / 1000', vectorized)power_factor
Precession frequency helper from 'pitch_damping'precession_with_damping
Predict gyroscopic stability downrange given velocity drop and spin retentionpredict_stability_at_distance
Pressure altitude from station pressurepressure_altitude
Extract a validated 'OpticProfile' from a 'ProfileData' listprofile_optic
Quantize an angular correction onto a turret click detent latticequantize_angle
Fast ballistic drop approximation (inches)quick_drop_estimate
Generate a full range table card ('card_service::range_table_v1')range_table
Recommend the best-fitting reference drag family for velocity-banded BC segmentsrecommend_bc_family
Reduce sea-level QNH altimeter pressure to local station pressurereduce_qnh
Retrieve a built-in reference (mach, cd) drag table as a 'data.frame'reference_drag_table
Render a multi-series Unicode Braille or ASCII chart stringrender_terminal_chart
Resolve powder-temperature-adjusted muzzle velocity (m/s)resolve_powder_velocity
Infer projectile shape from model name, caliber, weight, and drag modelresolve_projectile_shape
Resolve station temperature and pressure honoring presence and pressure moderesolve_station_conditions
Generate a BDC reticle from (range, drop_mil) pairsreticle_bdc_from_drops
Fetch a built-in reticle description by catalog IDreticle_by_id
List all built-in named reticles in 'reticle_catalog'reticle_catalog
Generate a standard parametric mil-dot reticlereticle_mil_dot
Generate a uniform MIL hash grid reticlereticle_mil_grid
Scale reticle marks for an explicit magnification (FFP or SFP)reticle_scaled_marks
Generate a Christmas-tree holdover reticlereticle_tree
Compute turret revolution annotation (revolution, remainder_clicks)revolution_annotation
Run a Monte Carlo ballistic dispersion simulationrun_monte_carlo
Run an adaptive-stopping seeded Monte Carlo simulationrun_monte_carlo_adaptive
Subsample 2D Monte Carlo impact points for plottingsample_points_for_viz
Sample a solved state trajectory at regular distance intervalssample_trajectory
Sanitize a profile name for safe filesystem storagesanitize_profile_name
Sight correction (elevation_rad, windage_rad) for aerodynamic jumpsight_correction_for_jump
Build an explicit-SI 'SolveRequestV1' listsolve_request_v1
Solve robust minimax hold corridors across named segmented-wind scenariossolve_robust_hold
Solve a ballistic trajectorysolve_trajectory
Single-shot Monte Carlo kernel evaluation ('monte_carlo::solve_trajectory_for_monte_carlo')solve_trajectory_mc
Solve a trajectory using the versioned explicit-SI 'solve_v1' contractsolve_v1
Error function erf(x) from 'ballistics_engine::special' (vectorized)special_erf
Complementary error function erfc(x) (vectorized)special_erfc
Log-beta function ln B(a, b) (vectorized)special_ln_beta
Log-gamma function ln Gamma(x) (vectorized)special_ln_gamma
Standard normal CDF Phi(z) (vectorized)special_normal_cdf
Aerodynamic spin-damping moment (N*m)spin_damping_moment
Spin-rate retention factor (0..1) over elapsed flight timespin_decay_correction_factor
Spin decay angular deceleration rate (rad/s^2)spin_decay_rate
Spin drift with optional spin-decay factor (meters)spin_drift
Apply empirical ML correction to spin driftspin_drift_ml_correction
Compute bullet spin rate from velocity and barrel twistspin_rate
Miller gyroscopic stability coefficient Sgstability_coefficient
Formatted gyroscopic stability analysis report ('terminal_commands::stability')stability_report
Create a validated 'StationAir' handlestation_air
Resolve a physical station (altitude_m, temperature_c, pressure_hpa) from density altitudestation_for_density_altitude
Check plausibility of a station pressure reading at an altitudestation_pressure_plausibility
Compute scope tracking correction factor from a tall-target testtall_target
Create a Unicode Braille or ASCII terminal plotting canvas handleterminal_canvas
Compute one-variable tolerance envelopes keeping impact inside a targettolerance_envelope
Check whether a scope tracking correction factor is within the valid physical rangetracking_cf_in_range
Apply transonic wave-drag correction to base Cd (vectorized)transonic_correction
Transonic wave-drag rise factor vs. Mach (vectorized)transonic_drag_rise
Transverse moment of inertia Iy (kg*m^2)transverse_moment_of_inertia
Back-solve effective muzzle velocity from a single observed drop (MIL)true_velocity
Back-solve effective crosswind from observed horizontal miss(es)true_wind
Bayesian MAP uncertainty-aware joint MV/BC truing with covariance and predictive bandsuncertainty_truing
Convert quantities between the CLI's input units and the engine's internal unitsunit_convert
Update projectile spin rate after elapsed flight timeupdate_spin_rate
Validate an 'OpticProfile' configurationvalidate_optic
Validate a saved ballistic profile ('ProfileData')validate_profile
Validate a relative humidity reading (with sensor-band tolerance)validate_relative_humidity
Validate a 'ReticleDescription'validate_reticle
Validate a table/list of wind segmentsvalidate_wind_segments
Create a streaming 'Welford' mean/variance accumulator handlewelford
Fixed-sample Wilson score confidence interval for a binomial proportionwilson_interval
Compute the 3D wind vector at a 3D projectile position with optional wind shearwind_at_position
Generate a multi-speed wind drift card ('card_service::wind_card_v1')wind_card
Construct a 'WindConditions' configuration listwind_conditions
Create a 3D 'WindField' handle ('constant', 'profile', 'log', or 'ekman')wind_field
Evaluate a 'WindShearProfile' across altitudeswind_shear_at_altitude
Evaluate 'WindShearWindSock' at a 3D positionwind_shear_sock_vector
Create a downrange segmented 'WindSock' handlewind_sock
Convert wind speed, direction (radians), and vertical speed to a 3D wind vectorwind_vector
Equilibrium yaw of repose and convergence rateyaw_of_repose
Compute zero-banner dial readouts (moa, mil) adjusted by elevation CFzero_banner_dial_values