Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The BC field now accepts whichever model your bullet is published in. Switching the G1 / G7 toggle converts the value in place — the same pattern the MOA/MRAD/cm toggles already use in the turret card — so the number on screen always describes one physical bullet, and the whole app (trajectory table + target card) recalculates against the matching drag curve.
0.243 G7→ click G1 → field becomes0.479, both tables re-solve. Toggling back returns0.243and byte-identical output.0.243 G7 ≈ 0.479 G1 for the same bullet), updating live as you type the BC, muzzle velocity or temperature.NaN.How the conversion is derived
Equal retardation means
Cd_G1(M)/BC_G1 = Cd_G7(M)/BC_G7, so the factor is simplyCd_G1(M) / Cd_G7(M)read off the drag tables the app already ships — no new magic constant. It is evaluated at the bullet's own Mach number, so it tracks the entered muzzle velocity and temperature, and is clamped to Mach 1.5–3.0.In that band the factor lands between 1.91 and 1.99, matching the ~1.95 measured for modern boat-tails (175 gr SMK: published 0.475 G1 / 0.243 G7 — this converts 0.243 → 0.479). The clamp is load-bearing: through the transonic region the true ratio swings between 1.3 and 2.3, and converting there would produce nonsense.
A converted BC is an approximation of a measured one, and the README says so — if your bullet has a published BC in the model you intend to shoot, type that instead.
Tests
node test.js→ 46 passed, 0 failed (8 new): ratio identity against the drag tables, the 1.9–2.0 band across the supersonic range, clamping of subsonic/supersonic/NaNMach, the published SMK pair, round-trip stability, direction (G1 is always the larger number), same-model and bad-input no-ops, and a check that a converted BC keeps drop at 600 m within a few cm.Also driven through a stub-DOM harness exercising the real toggle and input wiring, confirming the target card's elevation and windage clicks are unchanged across a G7→G1 switch, that the ratio tracks velocity, and that the hint updates on input.