mikereedell / sunrisesunsetlib-java

Library for computing the sunrise/sunset from GPS coordinates and a date, in Java.
http://mikereedell.github.com/sunrisesunsetlib-java/
Apache License 2.0
299 stars 69 forks source link

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

Open ghost opened 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. ALSO, one could set up a video camera with this info and when the sun passes the horizon, it would be perfectly centered. :)

getMagneticDirection([params]) {}

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)):

.getMagneticDirection(); // Sunrise
.getMagneticDirection(); // Solar noon
.getMagneticDirection(); // Sunset
.getMagneticDirection(); // Solar Midnight