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 |
|
8 | This library is a translation of [meeus][] from Go to Javascript and contains
|
9 | selected algorithms from the book "Astronomical Algorithms" by Jean Meeus,
|
10 | following the second edition, copyright 1998, with corrections as of
|
11 | August 10, 2009.
|
12 |
|
13 | Additional algorithms not covered in the book have been added.
|
14 |
|
15 | ## Installation
|
16 |
|
17 | ```
|
18 | npm install --save astronomia
|
19 | ```
|
20 |
|
21 | ## Browser usage
|
22 |
|
23 | Make sure you add `<meta charset="UTF-8">` to your HTML or at least include your
|
24 | bundle with `<script src="your-bundle.js" charset="UTF-8"></script>` then
|
25 | this 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 |
|
36 | For 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 |
|
99 | If you require a small footprint in your final application, each of the provided
|
100 | packages can be used as a single one:
|
101 |
|
102 | ```js
|
103 | // instead of
|
104 | const base = require('astronomia').base
|
105 | // use
|
106 | const base = require('astronomia/lib/base')
|
107 | ```
|
108 |
|
109 | ES6 Syntax
|
110 |
|
111 | ```js
|
112 | // instead of
|
113 | import {base} from 'astronomia'
|
114 | // use
|
115 | import base from 'astronomia/lib/base'
|
116 | ```
|
117 |
|
118 | ## Running tests
|
119 |
|
120 | npm test
|
121 |
|
122 | to even run very long lasting tests, do
|
123 |
|
124 | SLOWTESTS=1 npm test
|
125 |
|
126 | In local browser
|
127 |
|
128 | npm run zuul -- --local 3000
|
129 |
|
130 | ## Contribution and License Agreement
|
131 |
|
132 | If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license.
|
133 |
|
134 | You 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 |
|
138 | MIT Licensed
|
139 |
|
140 | See [LICENSE][] for more info.
|
141 |
|
142 | ## References
|
143 |
|
144 |
|
145 |
|
146 | * [LICENSE][LICENSE]
|
147 | * [meeus][meeus]
|
148 | * [VSOP87 dataset][VSOP87 dataset]
|
149 |
|
150 |
|
151 |
|
152 | [meeus]: https://github.com/soniakeys/meeus.git
|
153 | [LICENSE]: ./LICENSE
|
154 | [VSOP87 dataset]: ftp://cdsarc.u-strasbg.fr/pub/cats/VI/81
|