Files
astronomy/demo/nodejs
Don Cross 4f842627da Fixed mistake in GeoVector(SUN): we do need to correct for light-travel time.
To be consistent, when calculating the geocentric position of the Sun,
we do need to correct for light travel time just like we would for any
other object. This reduces the maximum time error for predicting transits
from 25 minutes to 11 minutes.

Also had to disable aberration when calculating moon phases
(longitude from Sun) in order to keep a good fit with test data.
2020-06-13 13:45:59 -04:00
..
2020-05-17 14:03:01 -04:00
2019-12-14 21:16:43 -05:00
2020-05-17 14:03:01 -04:00
2020-05-17 14:03:01 -04:00
2020-05-17 14:03:01 -04:00
2020-05-17 14:03:01 -04:00
2019-06-16 21:30:53 -04:00

JavaScript examples for Node.js

The source file astronomy.js works as a Node.js module. Download the file into your project directory. Then in your own source file, do this:

const Astronomy = require('astronomy.js');

Vanilla JS There are no external dependencies! Astronomy Engine is completely self-contained, and it always will be.

(By the way, you can use the same file astronomy.js for astronomy calculations inside the browser.)


Culmination

Finds when the Sun, Moon, and planets reach their highest position in the sky on a given date, as seen by an observer at a specified location on the Earth. Culmination is also the moment a body crosses the meridian, the imaginary semicircle in the sky that passes from due north on the horizon, through the zenith (straight up), and then toward due south on the horizon.

Horizon Intersection

This is a more advanced example. It shows how to use coordinate transforms to find where the ecliptic intersects with an observer's horizon at a given date and time.

Lunar Eclipse

Calculates details about the first 10 partial/total lunar eclipses after the given date and time.

Moon Phase Calculator

This example shows how to determine the Moon's current phase, and how to predict when the next few quarter phases will occur.

Positions

Calculates equatorial and horizontal coordinates of the Sun, Moon, and planets.

Rise/Set

Shows how to calculate sunrise, sunset, moonrise, and moonset times.

Seasons

Calculates the equinoxes and solstices for a given calendar year.


API Reference

Complete documentation for all the functions and types available in the JavaScript version of Astronomy Engine.