summaryrefslogtreecommitdiffstats
path: root/src/ballistics.c
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-07-12 21:30:48 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-07-12 21:30:48 +0300
commit4020a7124a80a608acd41a913ca5f6ad3ff3d488 (patch)
tree53ecefe6279497a4d2c6a921cab6dade6ed85e40 /src/ballistics.c
parent866393b70f5baddcaf9571b7240ebd4ce44bc67c (diff)
downloada3catragmx-4020a7124a80a608acd41a913ca5f6ad3ff3d488.tar.gz
a3catragmx-4020a7124a80a608acd41a913ca5f6ad3ff3d488.tar.bz2
a3catragmx-4020a7124a80a608acd41a913ca5f6ad3ff3d488.zip
add: tmp commit
Diffstat (limited to '')
-rw-r--r--src/ballistics.c31
1 files changed, 31 insertions, 0 deletions
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));
+}