ballistics_rs is a Rust crate designed for external ballistics calculations. It provides utilities and equations to help developers create ballistics solver programs. This crate includes functions to calculate the speed of sound, kinetic energy, gyroscopic stability, and ballistic coefficient of projectiles.
Getting Started
To use ballistics_rs in your project, add the following to your Cargo.toml:
[]
= "0.1.4"
Usage
Speed of Sound
Calculate the speed of sound in air given the temperature:
use ;
let speed = calculate
.temperature
.solve;
println!;
Kinetic Energy
Calculate the kinetic energy of a bullet:
use ;
let energy = calculate
.bullet_weight
.velocity
.solve;
println!;
Aperture Sight Calibration
Determine the movement of your point of aim for each click of an aperture:
use ;
let calibration = calculate
.sight_movement_twenty_clicks
.sight_radius
.solve;
println!;
Form Factor
Calculate the form factor of a bullet:
use ;
let form_factor = calculate
.drag_coefficient
.standard_bullet_drag_coefficient
.solve;
println!;
Velocity Projection
Project the velocity of a second bullet based on the weight and velocity of a first bullet:
use ;
let projected_velocity = calculate
.bullet_weight_1
.bullet_weight_2
.bullet_velocity_1
.solve;
println!;
Lag Time
Calculate the lag time of a bullet:
use ;
let lag_time = calculate
.actual_time_of_flight
.distance
.muzzle_velocity
.solve;
println!;
Wind Deflection
Calculate the wind deflection of a bullet:
use ;
let wind_deflection = calculate
.lag_time
.crosswind_speed
.solve;
println!;
Aerodynamic Jump
Calculate the aerodynamic jump of a bullet:
use ;
let jump = calculate
.gyro_stability
.bullet_length
.solve;
println!;
Gyroscopic Stability
Calculate the gyroscopic stability factor of a bullet:
use ;
let stability = calculate
.bullet_weight
.rifling_twist
.bullet_diameter
.bullet_length
.solve;
let velocity_corrected = velocity_correction
.muzzle_velocity
.gyro_stability
.solve;
let atmospheric_corrected = atmospheric_correction
.air_temp
.air_pressure
.gyro_stability
.solve;
println!;
Spin Drift
Calculate the spin drift of a bullet in the direction of rifling twist:
use ;
let spin_drift = calculate
.gyro_stability
.actual_time_of_flight
.solve;
println!;
Ballistic Coefficient
Calculate the ballistic coefficient of a bullet:
use ;
let bc = calculate
.bullet_weight
.bullet_diameter
.form_factor
.solve;
println!;
Constants
The crate also provides several constants for use in calculations:
use ;
println!;
println!;
println!;
println!;
println!;