-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle Sun's sunrise and sunset azimuth (#39)
Knowing when the Sun rises or sets is interesting, but it can also be interesting to know _where_ on the horizon these events are going to happen. The location of the Sun on the horizon's axis is the azimuth. This change adds support of the computing the azimuth angle of the Sun's at sunrise and sunset. `Sun#rising_azimuth` and `Sun#setting_azimuth` can return `nil` as the Sun sometimes never rises or never sets at some places on Earth, like locations close to the poles. ```rb date = Date.new(2015, 2, 5) epoch = Astronoby::Epoch.from_time(date) observer = Astronoby::Observer.new( latitude: Astronoby::Angle.as_degrees(38), longitude: Astronoby::Angle.as_degrees(-78) ) sun = Astronoby::Sun.new(epoch: epoch) sun.setting_azimuth(observer: observer)&.str(:dms) ```
- Loading branch information
1 parent
2a48ab6
commit 09e3762
Showing
5 changed files
with
245 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.