aboutsummaryrefslogblamecommitdiffstats
path: root/libtellurian_transverse_radius_radians.c
blob: dae8f04a345bdc0d617c616333044f275f242d52 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                         
/* See LICENSE file for copyright and license details. */
#include "common.h"


double
libtellurian_transverse_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 pow(fma(neg_e2, s * s, 1.0), -0.5);
}