diff options
author | Mattias Andrée <m@maandree.se> | 2024-10-19 18:21:54 +0200 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2024-10-19 18:21:54 +0200 |
commit | 3ce34980d7ba2bddbf3e9a1bd6f98cbc855bddc2 (patch) | |
tree | 7724cc9cb9c3b2ce5ee60d2e012d1fbeb80aacfb /libtellurian_meridan_radius_radians.c | |
download | libtellurian-3ce34980d7ba2bddbf3e9a1bd6f98cbc855bddc2.tar.gz libtellurian-3ce34980d7ba2bddbf3e9a1bd6f98cbc855bddc2.tar.bz2 libtellurian-3ce34980d7ba2bddbf3e9a1bd6f98cbc855bddc2.tar.xz |
First commit
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libtellurian_meridan_radius_radians.c')
-rw-r--r-- | libtellurian_meridan_radius_radians.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libtellurian_meridan_radius_radians.c b/libtellurian_meridan_radius_radians.c new file mode 100644 index 0000000..0a832e5 --- /dev/null +++ b/libtellurian_meridan_radius_radians.c @@ -0,0 +1,14 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +double +libtellurian_meridan_radius_radians(double latitude) +{ + double a = LIBTELLURIAN_EQUATORIAL_RADIUS; + double b = LIBTELLURIAN_POLAR_RADIUS; + double f = 1.0 - b / a; + double neg_e2 = (f - 2.0) * f; + double s = sin(latitude); + return fma(a, neg_e2, a) / pow(fma(neg_e2, s * s, 1.0), 1.5); +} |