Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rounding error of sunrise sunset time by changing the tan(x) calc… #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kneke
Copy link

@Kneke Kneke commented Aug 10, 2022

…ulations of the SolarEventCalculator

Example for a wrong sunset time with an offset of two hours would be:
Location erdingGermany = new Location(48.3107657, 11.8759098);
TimeZone timeZone = TimeZone.getTimeZone("Europe/Berlin");
SunriseSunsetCalculator calculator = new SunriseSunsetCalculator(erdingGermany, timeZone);

           Calendar calendar = Calendar.getInstance();
           calendar.set(2022, Calendar.JUNE, 21);

           String resultAsString = calculator.getOfficialSunsetForDate(calendar);

           assertEquals("21:17", resultAsString); // But was 15:17

…ulations of the SolarEventCalculator

Example for a wrong sunset time with an offset of two hours would be:
               Location erdingGermany = new Location(48.3107657, 11.8759098);
               TimeZone timeZone = TimeZone.getTimeZone("Europe/Berlin");
               SunriseSunsetCalculator calculator = new SunriseSunsetCalculator(erdingGermany, timeZone);

               Calendar calendar = Calendar.getInstance();
               calendar.set(2022, Calendar.JUNE, 21);

               String resultAsString = calculator.getOfficialSunsetForDate(calendar);

               assertEquals("21:17", resultAsString); // But was 15:17
@Kneke Kneke mentioned this pull request Aug 10, 2022
@Kneke
Copy link
Author

Kneke commented Aug 10, 2022

PR for this issue #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant