aboutsummaryrefslogtreecommitdiffstats
path: root/libtellurian_sea_level_radians.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2024-10-22 22:22:41 +0200
committerMattias Andrée <m@maandree.se>2024-10-22 22:22:41 +0200
commitbb5de3aa2ee118df78f0347cffd4e58f846dc1fb (patch)
treeb313a20b79d67f35a5e4e05bc9106b22dc17f451 /libtellurian_sea_level_radians.c
parent... (diff)
downloadlibtellurian-bb5de3aa2ee118df78f0347cffd4e58f846dc1fb.tar.gz
libtellurian-bb5de3aa2ee118df78f0347cffd4e58f846dc1fb.tar.bz2
libtellurian-bb5de3aa2ee118df78f0347cffd4e58f846dc1fb.tar.xz
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libtellurian_sea_level_radians.c')
-rw-r--r--libtellurian_sea_level_radians.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/libtellurian_sea_level_radians.c b/libtellurian_sea_level_radians.c
index e536025..ec03985 100644
--- a/libtellurian_sea_level_radians.c
+++ b/libtellurian_sea_level_radians.c
@@ -6,15 +6,9 @@
double
libtellurian_sea_level_radians(double latitude)
{
- double a = LIBTELLURIAN_EQUATORIAL_RADIUS;
- double b = LIBTELLURIAN_POLAR_RADIUS;
- double c = cos(latitude);
- double s = sin(latitude);
- double x = a * c * a;
- double y = b * s * b;
- double num = fma(x, x, y * y);
- double denom = fma(x, c, y * s);
- return sqrt(num / denom);
+ double x = cos(latitude) * LIBTELLURIAN_EQUATORIAL_RADIUS;
+ double y = sin(latitude) * LIBTELLURIAN_POLAR_RADIUS;
+ return sqrt(fma(x, x, y * y));
}