Commit Graph

10 Commits

Author SHA1 Message Date
Don Cross
84d6aff35a JS: Added function DefineStar.
I'm starting to implement the ability to define
up to 8 distinct points in the sky as "stars"
that will be allowed as a `body` parameter to
some Astronomy Engine functions, to be determined.
2022-11-21 12:53:45 -05:00
Don Cross
200080ca79 JavaScript: Defined string-valued enumerated type "Body".
Instead of declaring all the "body" parameters in the
TypeScript/JavaScript code to be strings, I created a
string-valued enumerated type called Body.

The same string values can still be passed in from JavaScript
code, or callers can use syntax like Astronomy.Body.Moon.

This improves the type checking inside the TypeScript source,
plus it adds better documentation for each of the parameters.
In the generated Markdown documentation, the user can click
on the Body type and see all the supported bodies.

The other three supported languages (C, C#, Python)
already use enumerated types for bodies, so this
brings the JavaScript version more in sync with them.
2021-03-27 10:44:50 -04: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
Don Cross
3c6b569cd4 Fixed breakage in nodejs demos.
I had to require('./astronomy.js') instead of require('astronomy.js')
to get the nodejs demos working, now that I maintain a redundant
copy of astronomy.js in the demo directories.
2020-08-10 11:37:34 -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
233232ea1e JS demo programs: validate command line parameters.
Print meaningful error messages and exit, if the JavaScript
demo programs are given invalid command line parameters.
2020-07-23 20:31:25 -04:00
Don Cross
83544bf57d Added C# demo for lunar eclipse.
Alphebetized demo readme pages.
2020-05-17 14:03:01 -04:00
Don Cross
f754a6de82 Fixed #58 - Solar System Barycenter, Earth/Moon Barycenter.
Can now calculate the heliocentric Solar System Barycenter (SSB)
and Earth/Moon Barycenter (EMB).

Changes made in C, C#, JavaScript and Python:
Added new body codes SSB, EMB.
Added support for calculating both in HelioVector functions.
Verified that all calculations match NOVAS.
Verified that all calculations match each other across languages.
2020-04-29 21:53:57 -04:00
Don Cross
9e4c340f60 Added link to culminate.js in nodejs example markdown. Enhanced comments. 2019-06-18 15:41:04 -04:00
Don Cross
a205fcbcb7 Added node.js example for how to calculate culmination. 2019-06-18 15:28:47 -04:00