summaryrefslogtreecommitdiff
path: root/dat.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-01-16 23:02:46 +0000
committerrodri <rgl@antares-labs.eu>2024-01-16 23:02:46 +0000
commit44d868b0684ef88d830f2e99624b826fc4c3507e (patch)
treeb37a4891f8fc271a209acc8250c3cb8d75083122 /dat.h
parentd6be49085c76bbea87b7d7c61455b93883669bf1 (diff)
downloadballistics-44d868b0684ef88d830f2e99624b826fc4c3507e.tar.gz
ballistics-44d868b0684ef88d830f2e99624b826fc4c3507e.tar.bz2
ballistics-44d868b0684ef88d830f2e99624b826fc4c3507e.zip
add air drag.
Diffstat (limited to 'dat.h')
-rw-r--r--dat.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/dat.h b/dat.h
index 24799b8..da2038d 100644
--- a/dat.h
+++ b/dat.h
@@ -1,4 +1,6 @@
-#define Eg 9.81
+#define Eg 9.81 /* earth's gravity (m·s⁻²) */
+#define Cd 0.45 /* drag coefficient for a sphere */
+#define ρ 1.293 /* air density (kg·m⁻³) */
#define PIX2M 0.001
#define M2PIX (1.0/PIX2M)
@@ -6,6 +8,7 @@ enum {
Stheta = 0,
Spos,
Svel,
+ Sdrag,
Sdeltax,
Seta,
SLEN,
@@ -17,4 +20,5 @@ struct Projectile
{
Point2 p, v;
double mass;
+ double r;
};