earth-radius-at-geodetic-latitude
![Greenkeeper badge](https://badges.greenkeeper.io/dbrockman/earth-radius-at-geodetic-latitude.svg)
Estimate the Earth radius at given latitude
Install
$ npm install --save earth-radius-at-geodetic-latitude
Usage
const earthRadiusAtGeodeticLatitude = require('earth-radius-at-geodetic-latitude');
const latitudeNewYork = 40.730610;
earthRadiusAtGeodeticLatitude(latitudeNewYork);
const latitudeNewOrleans = 30.0154753;
earthRadiusAtGeodeticLatitude(latitudeNewOrleans);
This function is based on the equation discussed on this GIS Stack Exchange thread and this wikipedia entry on Geocentric Earth radius:
The equation:
R = ( (a^2 cos(f))^2 + (b^2 sin(f))^2 ) / ( (a cos(f))^2 + (b sin(f))^2 )
where f
is the latitude and a
and b
are the equatorial radius and the polar radius, respectively.
API
earthRadiusAtGeodeticLatitude(latitude)
Takes latitude (number) and returns an estimate of the Earth radius at that given latitude.
The radius is in meters.