bhalash / gravity

A Node.js module which functionally calculates planetary gravity.

Home Page:https://www.npmjs.com/package/esg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ESG

ESG-short for Equatorial Surface Gravity-is a small functionally-programmed library which returns the surface gravity of a spherical body as derived from the Newton's gravitational constant.

Build Status

Installation

npm install esg

Usage

var esg = require('esg').ESG;

// Surface gravity in m/s.
esg.gravity(5.972E+24, 6.371E+6) // 9.91810989409835

// Relative surface gravity to Earth's, expressed as a ratio.
esg.relative(5.972E+24, 6.371E+6); // 1

// Escape velocity in m/s.
esg.escape(5.972E+24, 6.371E+6); // 11241.732796619975

// Orbital velocity in m/s.
esg.orbit(5.972E+24, 6.371E+6); // 7949.105492777197

Testing

npm test

Contributing

Pull requests welcome.

License

The code is under the MIT license.

About

A Node.js module which functionally calculates planetary gravity.

https://www.npmjs.com/package/esg

License:MIT License


Languages

Language:TypeScript 60.3%Language:JavaScript 39.7%