mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-19 14:27:52 -04:00
Added comments to Java demos.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user