From 3a7a1f8c691baabcb71b0906891de7b2d3e7f209 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Tue, 24 Sep 2024 18:38:22 +0200 Subject: [PATCH] Rename test and add credit --- .../wtapi/provider/twilight/SimpleTwilightTimeProvider.java | 5 +++++ ...mateTwilightTimeTest.java => SimpleTwilightTimeTest.java} | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) rename src/test/java/eu/m724/wtapi/twilight/{ApproximateTwilightTimeTest.java => SimpleTwilightTimeTest.java} (98%) diff --git a/src/main/java/eu/m724/wtapi/provider/twilight/SimpleTwilightTimeProvider.java b/src/main/java/eu/m724/wtapi/provider/twilight/SimpleTwilightTimeProvider.java index 9bc9a06..32e6f87 100644 --- a/src/main/java/eu/m724/wtapi/provider/twilight/SimpleTwilightTimeProvider.java +++ b/src/main/java/eu/m724/wtapi/provider/twilight/SimpleTwilightTimeProvider.java @@ -8,6 +8,11 @@ import java.time.LocalDate; import static java.lang.Math.*; +/** + * Calculates approximate sunrise and sunset times + * Usually off by a few minutes, except the Poles which, during polar days, are up to few hours inaccurate + * Adapted from: https://gml.noaa.gov/grad/solcalc/solareqns.PDF + */ public class SimpleTwilightTimeProvider extends TwilightTimeProvider { @Override public Twilight calculateTwilightTime(LocalDate date, Coordinates coordinates) { diff --git a/src/test/java/eu/m724/wtapi/twilight/ApproximateTwilightTimeTest.java b/src/test/java/eu/m724/wtapi/twilight/SimpleTwilightTimeTest.java similarity index 98% rename from src/test/java/eu/m724/wtapi/twilight/ApproximateTwilightTimeTest.java rename to src/test/java/eu/m724/wtapi/twilight/SimpleTwilightTimeTest.java index 341e25b..b1c633f 100644 --- a/src/test/java/eu/m724/wtapi/twilight/ApproximateTwilightTimeTest.java +++ b/src/test/java/eu/m724/wtapi/twilight/SimpleTwilightTimeTest.java @@ -8,7 +8,7 @@ import org.junit.Test; import java.time.LocalDate; -public class ApproximateTwilightTimeTest { +public class SimpleTwilightTimeTest { /** * Acceptable discrepancy in minutes */