diff options
author | Ben Burwell <ben@benburwell.com> | 2018-05-25 00:01:10 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2018-05-25 00:01:10 -0400 |
commit | 483b758f27e212c0684cdb6ca065c56765818e26 (patch) | |
tree | 25b88300acbfd51191413eba1239af400d883400 /vendor/github.com/cpucycle/astrotime/README.md | |
parent | d6b0483feb598a0c69c0d17a754545a9355e500c (diff) |
Run dep init
Diffstat (limited to 'vendor/github.com/cpucycle/astrotime/README.md')
-rw-r--r-- | vendor/github.com/cpucycle/astrotime/README.md | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/vendor/github.com/cpucycle/astrotime/README.md b/vendor/github.com/cpucycle/astrotime/README.md new file mode 100644 index 0000000..88c00ab --- /dev/null +++ b/vendor/github.com/cpucycle/astrotime/README.md @@ -0,0 +1,44 @@ +astrotime +========= + +NOAA astrological algorithms for sunrise and sunset ported to Go + + +FUNCTIONS: + +// CalcSunrise calculates the sunrise, in local time, on the day t at the +// location specified in longitude and latitude. +func CalcSunrise(t time.Time, latitude float64, longitude float64) time.Time + +// NextSunrise returns date/time of the next sunrise after tAfter +func NextSunrise(tAfter time.Time, latitude float64, longitude float64) (tSunrise time.Time) + +// CalcSunset calculates the sunset, in local time, on the day t at the +// location specified in longitude and latitude. +func CalcSunset(t time.Time, latitude float64, longitude float64) time.Time + +// NextSunset returns date/time of the next sunset after tAfter +func NextSunset(tAfter time.Time, latitude float64, longitude float64) (tSunset time.Time) + + +EXAMPLE: + +```go +package main + +import ( + "astrotime" + "fmt" + "time" +) + +const LATITUDE = float64(38.8895) +const LONGITUDE = float64(77.0352) + +func main() { + t := astrotime.NextSunrise(time.Now(), LATITUDE, LONGITUDE) + + tzname, _ := t.Zone() + fmt.Printf("The next sunrise at the Washington Monument is %d:%02d %s on %d/%d/%d.\n", t.Hour(), t.Minute(), tzname, t.Month(), t.Day(), t.Year()) +} +``` |