Files
astronomy/demo/browser/README.md
Don Cross 1b0ba300d8 Removed all references to GitHub Pages, because it has been disabled.
I'm not going to use GitHub Pages after all, because it is
causing more problems than it is helping. All I really wanted
was a way to host live JavaScript browser examples.
I will find my own way of hosting just those.

The main problem is that GitHub pages uses a different flavor
of Markdown than GitHub. This makes it really difficult to get
something that works right across both.  In general, it doubles
how much stuff I have to look at when I make a cosmetic change.

So I have already turned off GitHub Pages on this repo,
and this commit removes all links and references to it.
2019-07-09 19:49:28 -04:00

1.6 KiB

JavaScript examples for the browser

You can use the JavaScript version of Astronomy Engine to perform client-side astronomy calculations in a web browser. Calculations are offloaded to the visitor's computer.

Just grab a copy of astronomy.js or the minimized astronomy.min.js and save it on your server. Inside your HTML code, pull in the script as usual:

<script src="astronomy.js"></script>

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 in Node.js programs.)

All the functionality is wrapped inside an object called Astronomy.

Here are some example web pages using Astronomy Engine in a web browser.


Moon Phase Calculator

Determines the Moon's current phase and predicts when the next few quarter phases will occur.

Planet Positions

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

Rise/Set

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

More JavaScript examples

The Node.js examples page has additional JavaScript examples that can be adapted to the browser environment, using the same Astronomy Engine source code.


API Reference

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