Added comments to Java demos.

This commit is contained in:
Don Cross
2022-05-02 13:38:31 -04:00
parent 90aa6ed369
commit 5df9b03e7c
7 changed files with 18 additions and 5 deletions

View File

@@ -23,5 +23,5 @@ TestDemo moonphase 2019-06-15T09:15:32.987Z
TestDemo positions +45.6 -90.7 2018-11-30T17:55:07.234Z
TestDemo seasons 2019
echo "PASS: Java demos"
echo "Java demos: PASS"
exit 0

View File

@@ -2,6 +2,13 @@ package io.github.cosinekitty.astronomy.demo;
import io.github.cosinekitty.astronomy.*;
public class MoonPhase {
/**
* Display Moon phase information and the next 10 quarter phases.
*
* @param time
* The date and time for which to display Moon phase information,
* and when to initiate a search for the subsequent quarter phases.
*/
public static int run(Time time) {
// Calculate the Moon's ecliptic phase angle,
// which ranges from 0 to 360 degrees.

View File

@@ -8,7 +8,7 @@ public class Positions {
};
/**
* Display equatorial and horizontal coordinates of solar system bodies.
* Print a table of solar system body positions in equatorial and horizontal coordinates.
*
* @param observer
* The geographic location for which to calculate positions.

View File

@@ -2,6 +2,12 @@ package io.github.cosinekitty.astronomy.demo;
import io.github.cosinekitty.astronomy.*;
public class Seasons {
/**
* Print the times of the equinoxes and solstices for a calendar year.
*
* @param year
* The calendar year value for which to find equinoxes and solstices.
*/
public static int run(int year) {
SeasonsInfo seasons = Astronomy.seasons(year);
System.out.printf("March equinox : %s%n", seasons.getMarchEquinox());

View File

@@ -7,7 +7,7 @@ Fail()
TestDemo()
{
echo "Testing: $1"
echo "Testing Kotlin demo: $1"
./rundemo $* > test/$1.txt || Fail "Error running demo: $1"
diff {correct,test}/$1.txt || Fail "Incorrect output: $1"
}

View File

@@ -1,7 +1,7 @@
import io.github.cosinekitty.astronomy.*
/**
* Displays Moon phase information and predicts the next 10 quarter phases.
* Display Moon phase information and the next 10 quarter phases.
*
* @param time
* The date and time for which to display Moon phase information,

View File

@@ -1,7 +1,7 @@
import io.github.cosinekitty.astronomy.*
/**
* Demonstration of calculating the equinoxes and solstices for calendar year.
* Print the times of the equinoxes and solstices for a calendar year.
*
* @param year
* The calendar year value for which to find equinoxes and solstices.