caarmen / SunriseSunset

Java utility to calculate the time of sunrise and sunset for a given location.
GNU Lesser General Public License v2.1
48 stars 8 forks source link

Create method to return magnetic direction for Sunrise and Sunset #29

Closed ghost closed 7 years ago

ghost commented 7 years ago

A method to return magnetic directions towards the sun when it is at the center of the horizon for sunrise and sunset would be swell.

This would be fantastic if I was waiting for the sun to come up with a magnetic compass, and not knowing where to look... an app could get this data for me, and show me (with help from the SunriseSunset utility). ALSO, one could set up a video camera with this info and when the sun passes the horizon, it would be perfectly centered. :)

getMagneticDirection(Calendar calendar, double latitude, double longitude) {}

returns values for: (note that Solar noon and Solar Midnight would have less use but are still of interest, and they would represent the direction the observer would be facing relative to there position (overhead, and out of sight)):

SunsetSunrise[0].getMagneticDirection(); // Sunrise
SunsetSunrise[1].getMagneticDirection(); // Solar noon
SunsetSunrise[2].getMagneticDirection(); // Sunset
SunsetSunrise[3].getMagneticDirection(); // Solar Midnight
caarmen commented 7 years ago

Transfered: https://github.com/caarmen/SunriseSunsetPlus/issues/1

caarmen commented 7 years ago

Transfered to https://github.com/robertjliguori/SunriseSunsetPlus/issues/11