Skip to content
forked from mourner/suncalc

A tiny JavaScript library for calculating sun/moon positions and phases.

License

Notifications You must be signed in to change notification settings

vukicevic/suncalc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SunCalc

This is a refactored fork of SunCalc only returning calculated times.

SunCalc is a tiny BSD-licensed JavaScript library for calculating sunlight phases (times for sunrise, sunset, dusk, etc.) created by Vladimir Agafonkin (@mourner).

Most calculations are based on the formulas given in the excellent Astronomy Answers articles about position of the sun and the planets. You can read about different twilight phases calculated by SunCalc in the Twilight article on Wikipedia.

Reference

Sunlight times

SunCalc(/*Date*/ date, /*Number*/ latitude, /*Number*/ longitude)

Returns an object with the following properties

Property Description
sunrise sunrise
sunset sunset
dusk end of dusk twilights
.civil civil twilight
.nautical nautical twilights
.astronomical astronomical twilight (night begins)
dawn beginning of dawn twilights
.civil civil dawn
.nautical nautical dawn
.astronomical astronomical dawn (night ends)
antipodes
.nadir nadir (darkest moment of the night, sun is in the lowest position)
.zenith solar noon (sun is in the highest position)

Changelog

2.0.0

Forked from original, moon positions removed. Output reworked.

About

A tiny JavaScript library for calculating sun/moon positions and phases.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%