Skip to content

Repository files navigation

sun_calc

CI Status

A Ruby library, translated from the SunCalc JavaScript library, for calculating sun positions, sunlight phases, moon positions, and lunar phase for a given time and location.

Installing

gem install sun_calc

Using

require'sun_calc'SunCalc.sun_position(Time.now,59.3345,18.0662)#=> {:azimuth=>0.5724083892517442, :altitude=>0.6713233729313038}

The library shares a similar API as the JavaScript library.

JavaScriptRuby
getPositionsun_position
getTimessun_times
addTimeadd_sun_time
getMoonPositionmoon_position
getMoonTimesmoon_times

Maintainer

About

Library for calculating sun/moon positions and phases

Topics

Resources

Stars

10 stars

Watchers

33 watching

Forks

Releases

Packages

Used by

Contributors

Languages