New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

earth-radius-at-geodetic-latitude

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

earth-radius-at-geodetic-latitude

Estimate the Earth radius at given latitude

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
Maintainers
1
Weekly downloads
 
Created
Source

earth-radius-at-geodetic-latitude

Build Status Greenkeeper badge

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);
//=> 6377880.978308504

const latitudeNewOrleans = 30.0154753;
earthRadiusAtGeodeticLatitude(latitudeNewOrleans);
//=> 6357371.8965936005

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.

Keywords

FAQs

Package last updated on 12 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc