Files
astronomy/demo/java
Don Cross 237bc42084 Added Kotlin demo: positions.
I also reworked how the Java and Kotlin demos
process errors in the command line arguments.
Using exceptions that are caught by main() rather
than directly exiting the process where the errors
are detected.
2022-05-02 11:28:16 -04:00
..
2022-05-01 21:12:57 -04:00
2022-05-02 11:28:16 -04:00
2022-04-28 21:04:54 -04:00
2022-05-02 10:21:23 -04:00
2022-03-22 04:33:10 +04:30
2022-03-22 04:33:10 +04:30
2022-05-01 21:12:57 -04:00

Astronomy Engine examples in Java

The class file Main.java shows examples of how to use the Kotlin version of Astronomy Engine from a Java program.

The demo program is split into separate source files, one for each topic, as listed below. Each topic is chosen by a command line parameter. To build the demo program, run this command in Linux or Mac:

./gradlew jar

On Windows, use this command to build the demo program:

gradlew.bat jar

Then use the rundemo script (or rundemo.bat file on Windows) to run the demo program, to see usage text:

./rundemo

As an example, to run the MoonPhase demo, try this:

./rundemo moonphase

MoonPhase.java

This example shows how to determine the Moon's current phase, and how to predict when the next 10 quarter phases will occur.

Positions.java

Given an observer's geographic latitude and longitude, and an optional date and time, this demo displays the equatorial and horizontal coordinates of the Sun, Moon, and planets.

Seasons.java

Calculates the equinoxes and solstices for a given calendar year.