UNPKG

5 kBMarkdownView Raw
1# astronomia
2
3> An astronomical library
4
5[![NPM version](https://badge.fury.io/js/astronomia.svg)](https://www.npmjs.com/package/astronomia/)
6[![Build Status](https://secure.travis-ci.org/commenthol/astronomia.svg?branch=master)](https://travis-ci.org/commenthol/astronomia)
7
8This library is a translation of [meeus][] from Go to Javascript and contains
9selected algorithms from the book "Astronomical Algorithms" by Jean Meeus,
10following the second edition, copyright 1998, with corrections as of
11August 10, 2009.
12
13Additional algorithms not covered in the book have been added.
14
15## Installation
16
17```
18npm install --save astronomia
19```
20
21## Browser usage
22
23Make sure you add `<meta charset="UTF-8">` to your HTML or at least include your
24bundle with `<script src="your-bundle.js" charset="UTF-8"></script>` then
25this package runs in modern browsers.
26
27- Chrome: >=45
28- Firefox: >= 45
29- Safari: >=10
30- Mobile Safari: >=10
31- Edge: >=13
32- IE: >=10 (needs `core-js/es6` polyfill)
33
34## Usage
35
36For documentation of the different packages please take a look at the source code as well as at the tests.
37
38## Packages
39
40- **angle**: Angular Separation.
41- **apparent**: Apparent Place of a Star.
42- **apsis**: Perigee and apogee of the Moon.
43- **base**: Basic constants and methods
44- **binary**: Binary Stars.
45- **circle**: Smallest Circle containing three Celestial Bodies.
46- **conjunction**: Planetary Conjunctions.
47- **coord**: Transformation of Coordinates. Ecliptic, Equatorial, Horizontal, Galactic coordinates.
48- **deltat**: Dynamical Time and Universal Time.
49- **eclipse**: Eclipses.
50- **elliptic**: Elliptic Motion.
51- **elementequinox**: Reduction of ecliptical Elements from one Equinox to another one.
52- **eqtime**: Equation of time.
53- **fit**: Curve Fitting.
54- **globe**: Ellipsoid, Globe, Coordinates of Earth Observer.
55- **illum**: Illuminated Fraction of the Disk and Magnitude of a Planet.
56- **interpolation**: Interpolation of equidistant values (linear, len3, len5); Lagrange Polynoms
57- **iterate**: Iteration.
58- **jm**: Jewish and Moslem Calendars.
59- **julian**: Julian Days, Gregorian, Julian calendar functions.
60- **jupiter**: Ephemeris for Physical Observations of Jupiter.
61- **jupitermoons**: Positions of the Satellites of Jupiter.
62- **kepler**: Equation of Kepler.
63- **line**: Bodies in Straight Line
64- **mars**: Ephemeris for Physical Observations of Mars.
65- **moon**: Ephemeris for Physical Observations of the Moon.
66- **moonillum**: Illuminated Fraction of the Moon's Disk.
67- **moonmaxdec**: Maximum Declinations of the Moon.
68- **moonnode**: Passages of the Moon through the Nodes.
69- **moonphase**: Phases of the Moon.
70- **moonposition**: Position of the Moon.
71- **nearparabolic**: Near-parabolic Motion.
72- **node**: Passages through the Nodes.
73- **nutation**: Nutation and the Obliquity of the Ecliptic.
74- **parabolic**: Parabolic Motion.
75- **parallactic**: The Parallactic Angle, and three other Topics.
76- **parallax**: Correction for Parallax.
77- **perihelion**: Planets in Perihelion and Aphelion.
78- **planetelements**: Elements of Planetary Orbits.
79- **planetposition**: Ecliptic position of planets by full VSOP87 theory.
80- **pluto**: Pluto.
81- **precess**: Precession.
82- **refraction**: Atmospheric Refraction.
83- **rise**: Rising, Transit, and Setting.
84- **saturnmoons**: Positions of the Satellites of Saturn.
85- **saturnring**: The Ring of Saturn.
86- **semidiameter**: Semidiameters of the Sun, Moon, and Planets.
87- **sexagesimal**: Sexagesimal classes.
88- **sidereal**: Sidereal Time at Greenwich.
89- **solar**: Solar Coordinates.
90- **solardisk**: Ephemeris for Physical Observations of the Sun.
91- **solarxyz**: Rectangular Coordinates of the Sun.
92- **solstice**: Equinoxes, Solstices and Solarterms.
93- **stellar**: Stellar Magnitudes.
94- **sundial**: Calculation of a Planar Sundial.
95- **sunrise**: Compute rise, noon, set of the Sun for an earth observer.
96
97## Using a single package
98
99If you require a small footprint in your final application, each of the provided
100packages can be used as a single one:
101
102```js
103// instead of
104const base = require('astronomia').base
105// use
106const base = require('astronomia/lib/base')
107```
108
109ES6 Syntax
110
111```js
112// instead of
113import {base} from 'astronomia'
114// use
115import base from 'astronomia/lib/base'
116```
117
118## Running tests
119
120 npm test
121
122to even run very long lasting tests, do
123
124 SLOWTESTS=1 npm test
125
126In local browser
127
128 npm run zuul -- --local 3000
129
130## Contribution and License Agreement
131
132If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license.
133
134You are also implicitly verifying that all code is your original work or correctly attributed with the source of its origin and licence.
135
136## License
137
138MIT Licensed
139
140See [LICENSE][] for more info.
141
142## References
143
144<!-- !ref -->
145
146* [LICENSE][LICENSE]
147* [meeus][meeus]
148* [VSOP87 dataset][VSOP87 dataset]
149
150<!-- ref! -->
151
152[meeus]: https://github.com/soniakeys/meeus.git
153[LICENSE]: ./LICENSE
154[VSOP87 dataset]: ftp://cdsarc.u-strasbg.fr/pub/cats/VI/81