diff options
author | Mattias Andrée <m@maandree.se> | 2024-10-22 22:22:41 +0200 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2024-10-22 22:22:41 +0200 |
commit | bb5de3aa2ee118df78f0347cffd4e58f846dc1fb (patch) | |
tree | b313a20b79d67f35a5e4e05bc9106b22dc17f451 /libtellurian_elevated_gravity_radians.c | |
parent | ... (diff) | |
download | libtellurian-bb5de3aa2ee118df78f0347cffd4e58f846dc1fb.tar.gz libtellurian-bb5de3aa2ee118df78f0347cffd4e58f846dc1fb.tar.bz2 libtellurian-bb5de3aa2ee118df78f0347cffd4e58f846dc1fb.tar.xz |
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r-- | libtellurian_elevated_gravity_radians.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libtellurian_elevated_gravity_radians.c b/libtellurian_elevated_gravity_radians.c index 1c97f1a..edf9678 100644 --- a/libtellurian_elevated_gravity_radians.c +++ b/libtellurian_elevated_gravity_radians.c @@ -6,6 +6,7 @@ double libtellurian_elevated_gravity_radians(double gravity, double latitude, double altitude) { + double lat = geodetic(latitude); double a = LIBTELLURIAN_EQUATORIAL_RADIUS; double b = LIBTELLURIAN_POLAR_RADIUS; double omega = LIBTELLURIAN_ANGULAR_VELOCITY; @@ -15,7 +16,7 @@ libtellurian_elevated_gravity_radians(double gravity, double latitude, double al double neg_k1 = fma(-2.0, f + m, -2.0) / a; double k2 = 4.0 * f / a; double neg_k3 = -3.0 / (a * a); - double sin2_phi = sin(latitude) * sin(latitude); + double sin2_phi = sin(lat) * sin(lat); double s = fma(neg_k3, altitude, fma(k2, sin2_phi, neg_k1)); return fma(s * altitude, gravity, gravity); } |