solar

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNight

func IsNight(t time.Time, latitude, longitude float64) bool

IsNight returns true if the given UTC time is before sunrise or after sunset.

Types

type SunTimes

type SunTimes struct {
	Sunrise time.Time
	Sunset  time.Time
}

SunTimes holds sunrise and sunset times for a given date and location.

func Calculate

func Calculate(date time.Time, latitude, longitude float64) SunTimes

Calculate computes sunrise and sunset UTC times for a given date, latitude, and longitude. Uses the NOAA Solar Calculator algorithm. Zenith = 90.833 (official sunrise/sunset with refraction).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL