Commit Graph

17 Commits

Author SHA1 Message Date
Don Cross
945bb3eebc Fix same exception ebraminio did in moonradar.html 2022-05-04 20:40:45 -04:00
Don Cross
b7ac00ed17 Browser demos: fix date parsing for Safari.
Safari does not work when you try to do this in JavaScript:

    const date = new Date('2022-01-08 17:26:59');

Instead, it requires a 'T' between the date and the time:

    const date = new Date('2022-01-08T17:26:59');

Fixed this issue in the moonradar.html and positions.html demos.
We still render the date/time as normal, with the space,
but parse it by replacing the space with 'T'.

Thanks to @ebraminio for reporting this!
2022-01-08 17:24:39 -05:00
Don Cross
eac7750fba Fixed #86 - eliminated redundant JS functions MakeObserver and MakeSpherical.
In the TypeScript/JavaScript code, the functions MakeObserver and MakeSpherical
are no longer needed, because the classes Observer and Spherical are now exported,
along with their constructors. I deleted those functions and reworked callers
to use the equivalent constructors instead.

Also fixed a few breakages in the html/browser examples that crept in recently.
2021-02-09 19:49:00 -05:00
Mateo Tibaquira
21c053dbed JS: Refactor the build setup
The npm dependencies required are now
installed locally inside the generate folder.

Cleaned up the Astronomy object closure for TS
and kept it for the Browser bundle.

We will have some usage examples in the website.
2021-02-07 17:09:21 -05: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
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
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
480a7d44f1 Added browser demo for calculating sunrise, sunset, moonrise, moonset. 2019-06-15 15:12:28 -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