Commit Graph

177 Commits

Author SHA1 Message Date
Don Cross
c5738052b4 Starting to convert JavaScript code to TypeScript, and compiling it back to JavaScript.
The goal is to provide both TypeScript and JavaScript to developers.
Will also provide a type definition file once I figure that out.
This is just the first pass through the code.
It builds and passes all the unit tests, with some minor changes
to the generated README.md.
2021-02-04 22:12:49 -05:00
Don Cross
f34b700ce3 Updated copyrights for 2021. This resolves Travis CI broken build.
I forgot that my build process automatically updates
copyright years when the current year changes.
My Travis CI unit tests verify that there are no local
changes after running all the tests.
That test failed because the update_copyrights.py changed
all the "2019-2020" to "2019-2021".
2021-01-07 08:55:52 -05:00
Don Cross
246ac47d2b Fixed a failure to find a full moon using certain start dates.
In all four versions of Astronomy Engine (C, C#, JavaScript, and Python),
starting a search for a full moon near December 19, 2020 would fail.
I added a unit test to all four languages and it failed consistently
across them all.

The root cause: I was too optimistic about how narrow I could make
the window around the approximate moon phase time in the
SearchMoonPhase functions. Finding the exact moon phase time failed
because it was outside this excessively small window around the approximate
time. I increased the window from 1.8 days to 3.0 days.
This should handle all cases with minimal impact on performance.

Now all four of the new unit tests pass.
2020-12-18 14:29:41 -05:00
Don Cross
8f16f0a5ae Pluto integrator: finished porting to Python.
I believe this wraps up the Python integrator.
It now works in all 4 languages and passes all tests.
Fixed up demo tests to match new output.
Turned on Travis CI checking in this branch again.
2020-08-24 20:54:20 -04:00
Don Cross
1a2508f68b Pluto integrator: ported to JavaScript. 2020-08-24 14:14:32 -04:00
Don Cross
db9eb6b180 Maintain redundant copies of Astronomy Engine source in demo folders.
Windows does not support relative links in Git by default.
This broke the first-time experience for Windows users.
From now on I will maintain copies of the astronomy.js
and astronomy.py in the demo folders, so that the demos
will work on Windows immediately after cloning the repo.
2020-08-10 11:08:27 -04:00
Don Cross
f8cc44a0a5 Deleting relative links to astronomy code.
Using Linux relative links to astronomy.py and astronomy.js
from the demo directories just doesn't work in Windows.
This creates a stumbling block for first-time users.
To make it easier for people to get started, I will just
make redundant copies in other directories as needed.
It is better to use a little extra disk space -- hard drives are cheap!

This is the first step: get rid of the links.
2020-08-10 10:41:58 -04:00
Don Cross
941fc73c9a Browser demo positions.html: fix exception, allow edit date.
When I added support for pseudo-bodies like SSB
(Solar System Barycenter), it broke the positions.html demo.
Use an explicit list of the bodies to be calculated.
I should probably get rid of Astronomy.Bodies, because it
seems to invite bugs like this. I will think more about that.

Also, there was no way to manually edit the time.
Added a checkbox called "Automatic" that toggles whether
the time is updated automatically every second or
is entered by the user.

Persist the checkbox and edited time in the saved options.
2020-08-10 10:37:51 -04:00
Don Cross
d3c29e7fd6 Added magnified view of Sun around SSB in barycenter.html animation. 2020-01-21 14:11:52 -05:00
Don Cross
a61dda0370 Starting to work on a demo of plotting the Solar System Barycenter.
Animate the Sun's motion around the Solar System Barycenter (SSB),
along with the four major planets Jupiter, Saturn, Uranus, and Neptune.
2020-01-21 13:25:32 -05:00
Don Cross
112366b66a Fixed cosmetic issues in demo pages after removing GitHub CSS. 2019-07-09 20:18:03 -04:00
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
Don Cross
a205fcbcb7 Added node.js example for how to calculate culmination. 2019-06-18 15:28:47 -04:00
Don Cross
480a7d44f1 Added browser demo for calculating sunrise, sunset, moonrise, moonset. 2019-06-15 15:12:28 -04:00
Don Cross
cf0b2c354c Updated browser example readme. Mention minimized version. Use relative links. 2019-06-12 17:33:32 -04:00
Don Cross
18251d16a4 Added another C example program: positions.c.
This example demonstrates how to calculate equatorial coordinates
and horizontal coordinates of solar system bodies.

Added explanatory comments to moonphase.c.

Added #defines for MIN_YEAR, MAX_YEAR in astronomy.h.

Removed unnecessary code from positions.html; no longer need
to calculate geocentric vector before calculating equatorial coordinates.
2019-06-11 20:31:22 -04:00
Don Cross
3b8a02be75 Fixed broken code in positions.html.
I had not tested this browser example in a while.
Since then I made breaking changes in astronomy.js.
Just now fixing it here.
2019-06-05 21:30:45 -04:00
Don Cross
dc0bb07fbb Positions demo: save geographic coordinates. 2019-05-15 21:10:27 -04:00
Don Cross
b80bb78db5 Browser demo positions.html now shows altitude and azimuth. 2019-05-15 20:18:21 -04:00
Don Cross
73d990d656 Added regex validation to observer coordinates in positions.html. 2019-05-14 21:58:52 -04:00
Don Cross
e8d40778d3 Allow entering observer coordinates in positions.html demo page. 2019-05-14 20:20:24 -04:00
Don Cross
97bd6bf070 Better formatting of RA, DEC in positions.html demo page. 2019-05-14 19:29:21 -04:00
Don Cross
f723ea93d9 Starting to implement another JS demo: planet positions. 2019-05-14 18:11:38 -04:00
Don Cross
330cd47f9a Removed fossil Node.js section from JS browser document. 2019-05-13 15:19:31 -04:00
Don Cross
1bde214fd3 Fixed incorrect links. 2019-05-13 14:55:18 -04:00
Don Cross
4ae1626615 I had Node.js, browser docs backwards. 2019-05-13 14:52:20 -04:00
Don Cross
8cd6b421b6 Split JS examples into separate pages for Node.js and browser. 2019-05-13 14:44:05 -04:00