From 4020a7124a80a608acd41a913ca5f6ad3ff3d488 Mon Sep 17 00:00:00 2001 From: hybrid Date: Sun, 12 Jul 2026 21:30:48 +0300 Subject: add: tmp commit --- src/ballistics.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/ballistics.c') diff --git a/src/ballistics.c b/src/ballistics.c index 10d97da..418318a 100644 --- a/src/ballistics.c +++ b/src/ballistics.c @@ -4,6 +4,12 @@ #include "constants.h" #include "context.h" +static inline double speed_of_sound(double temperature); +static inline double calculate_retard(DragModel drag_function, + double ballistic_coefficient, + double velocity, + double mach); + double atmospheric_correction(double ballistic_coefficient, double temperature, double pressure, @@ -36,3 +42,28 @@ double calculate_air_density(double temperature, else return pressure / (SPECIFIC_GAST_CONSTANT_DRY_AIR * temperature); } + +static inline double speed_of_sound(double temperature) { + return sqrt(331.3 * (1.0 + temperature - 273.15 / 273.15)); +} + +static inline double +calculate_retard(DragModel ballistic_model, + double ballistic_coefficient, + double velocity, + double mach) +{ + double m = velocity / mach; +for (int i = 0 +} + +double retard(DragModel ballistic_model, + double ballistic_coefficient, + double velocity, + double temperature) +{ + return calculate_retard(ballistic_model, + ballistic_coefficient, + velocity, + speed_of_sound(temperature)); +} -- cgit v1.3.1