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

Handle Sun's sunrise and sunset azimuth #39

Merged
merged 2 commits into from
Mar 22, 2024
Merged

Commits on Mar 19, 2024

  1. Handle Sun's sunrise and sunset azimuth

    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)
    ```
    rhannequin committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    5426c29 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    86b4a8c View commit details
    Browse the repository at this point in the history