solar-system-calculator

small library for computation of objects in solar system

Usage no npm install needed!

<script type="module">
  import solarSystemCalculator from 'https://cdn.skypack.dev/solar-system-calculator';
</script>

README

DEMO

solarSysCalculator

Modest javascript library for calculation of planets in solar system

Installation

npm install solar-sys-calculator

Usage

  const system = new SolarSystem()
  const exampleDate = new Date(946684800*1000)

  system.compute(exampleDate) :Date(optional)

Calculates planetary positions at specified date, if date is ommited, current time will be used instead

Planetary positions

  system.geocentricCoords()

Returns object containing geocentric positions of all solar system planets

  system.geocentricCoords(names) :Array

Returns geocentric position of a specified planet

Sources

Orbital Elements - Jet Propulsion Laboratory - https://ssd.jpl.nasa.gov/?planet_pos Calculations Basis - Keith Burnett - http://www.stargazing.net/kepler/index.html