SwiftAA • aa-js • QLFits • FITSImporter • ObjCFITSIO
Astronomical Algorithms in JavaScript.
Other implementations: Swift (SwiftAA) , C# (AASharp).
aa-js is the port in javascript of the C++ implementation of Astronomical Algorithms by J.P. Naughter, called AA+, based on the reference text book by Jean Meeus. It is written in TypeScript, and covered as much as possible with tests validating the correctness of the algorithms. Tests are inspired from Jean Meeus' book and those written in SwiftAA, and are much more extended than what is available in AA+.
aa-js is the backbone of scientific algorithms used in arcsecond.io.
I am the author of the Swift version too. It's called SwiftAA.
- Planets: all the (static and dynamic) details, coordinates, quantities about
Mercury
,Venus
,Mars
,Jupiter
,Saturn
,Neptune
and of coursePluto
: planet constants, aphelion, perihelion, phase angle, illuminated fraction, magnitude, semi-diameters. - In addition, for
Mars
: the planetocentric declination of the Sun and the Earth - In addition, for
Jupiter
: the planetocentric declination of the Sun and the Earth - In addition for
Saturn
: the details of the rings system Earth
&Moon
: all the coordinates, and many details about the MoonSun
: mean & true anomaly, coordinatesjuliandays
: creation, transformation, local mean sidereal time.cosmology
: the cosmology calculator from Ned Wright's, but re-implementeddistances
: all the conversions of distancesnutation
: in longitude, for obliquity, true & mean obliquity of the eclipticprecession
: all the precession functions between epochs for coordinatessexagesimal
: utilities for manipulating sexagesimalstransits
: get rise, transit and set hours, dates, julian days, as well as altitude.
npm install aa-js
import { juliandays, Earth } from 'aa-js'
const jd = juliandays.getJulianDay(new Date())
const coords = Earth.Moon.getEquatorialCoordinates(jd)
See inside the code. Almost every method is documented (quite sparingly sometimes). A good knowledge of basic astronomy helps very much. A copy of the Astronomical Algorithms textbook, by Jean Meeus (amazon) would also help, since many methods refer to it.