blob: 3fdb037fa39b40af26ebeb86125b7ae30022291a (
plain) (
tree)
|
|
/* See LICENSE file for copyright and license details. */
#include "common.h"
double
libtellurian_normal_gravity_radians(double latitude)
{
double a = LIBTELLURIAN_EQUATORIAL_RADIUS;
double b = LIBTELLURIAN_POLAR_RADIUS;
double neg_e2 = fma(b / a, b / a, -1.0);
double ag = a * LIBTELLURIAN_EQUATORIAL_GRAVITY;
double bg = b * LIBTELLURIAN_POLAR_GRAVITY;
double k = bg / ag - 1.0;
double sin2_phi = sin(latitude) * sin(latitude);
double num = fma(k, sin2_phi, 1.0);
double denom2 = fma(neg_e2, sin2_phi, 1.0);
return LIBTELLURIAN_EQUATORIAL_GRAVITY * num / sqrt(denom2);
}
|