ballistic-calculator

Implements .NET trajectory calculations with the BallisticCalculator NuGet package and Gehtsoft.Measurements unit types.

43|30|Updated Nov 16, 2025
One-click install
npx skills add https://github.com/nikolaygekht/ballistic.calculator.app.avalonia --skill ballistic-calculator-nikolaygekht
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ballistic-calculator
Source: https://github.com/nikolaygekht/ballistic.calculator.app.avalonia/tree/main/.claude/skills/ballistic-calculator
Command: npx skills add https://github.com/nikolaygekht/ballistic.calculator.app.avalonia --skill ballistic-calculator-nikolaygekht

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct .NET code against the BallisticCalculator library requires knowing its exact API surface — constructor signatures, argument order differences between CalculateZeroParameters and Calculate, drag table handling, and named exception types — which is easy to get wrong from memory or by scanning the package. ## Core Features & Use Cases - Trajectory computation guidance: Covers the full workflow from describing Ammunition, Rifle, Atmosphere, and Wind through zeroing with CalculateZeroParameters to reading TrajectoryPoint output (drop, windage, energy, Mach, time of flight). - Custom drag curves: Recipes for custom DragTable subclasses, radar .drg files via DrgDragTable, and multi-BC synthesis with DrgDragTableFactory. - Serialization and reticles: BXml and System.Text.Json persistence for library objects, plus building and rendering scope reticles to SVG. - Use Case: A developer building a ballistics app asks how to compute a 1,000-yard trajectory table with spin drift and a measured drag curve; the Skill supplies the exact constructor calls, the required zero-correction step, and the GC drag table wiring. ## Quick Start Use the ballistic-calculator skill to write C# code that computes a trajectory for a 168 gr .308 load zeroed at 100 yards out to 1,000 yards.

Frequently Asked Questions about ballistic-calculator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate a bullet trajectory in C# with BallisticCalculator?

Create Ammunition, Rifle, and Atmosphere objects, then call CalculateZeroParameters and Apply the result to your ShotParameters before calling Calculate. The returned TrajectoryPoint array contains drop, windage, velocity, energy, and time of flight per distance step.

How do I use a custom or measured drag curve in BallisticCalculator?

Use table id GC with a custom DragTable subclass, a radar file loaded via DrgDragTable.Open, or a multi-BC curve built with DrgDragTableFactory.Build. Pass the DragTable instance to both CalculateZeroParameters and Calculate, since DragTable.Get(GC) throws.

Why does BallisticCalculator throw ZeroRangeCantBeReachedException?

It is thrown by CalculateZeroParameters when the load cannot carry to the requested zero distance, such as a subsonic load with a 1,000-yard zero. Catch it before any broader InvalidOperationException handler and treat it as a user-fixable input error.

Does BallisticCalculator model spin drift and Coriolis effect?

Spin drift is modelled when the Rifle has Rifling and the Ammunition has both bullet diameter and length, folded into Windage. Coriolis requires setting Latitude on ShotParameters, and crosswind aerodynamic jump is also modelled under the same rifling conditions.

How do I save and load Ammunition data in BallisticCalculator?

Use the BallisticXmlSerialize extension or BallisticXmlSerializer for BXml files, or System.Text.Json's JsonSerializer directly since the data classes carry JSON attributes. Both mechanisms round-trip Ammunition, Rifle, Atmosphere, and library entries.

When should I not use the BallisticCalculator library?

Skip it for generic physics or projectile-motion exercises, game-engine or Unity projectile motion, plain unit conversions, and non-code ballistics questions like load-data or forensics advice. It targets real external ballistics modeling in .NET only.