SunCalc is a tiny dependency-free JavaScript library for calculating solar and lunar information for any location and time. It provides sun altitude and azimuth together with sunrise, sunset, twilight, and other sunlight phases. Moon calculations include position, rise and set times, distance, and illuminated phase. Version 2 rebuilt the astronomy around higher-order models from Jean Meeus and validates results against authoritative astronomical references. Typical rise and set errors are around 15 seconds, with substantially improved positional accuracy over the earlier release. It ships as a modern ES module while retaining bundled support for CommonJS and direct browser use.
Features
- Sun position calculations
- Sunrise, sunset, and twilight times
- Moon position and distance
- Moonrise, moonset, and lunar phase
- High-precision astronomical models
- ES module, CommonJS, and browser support
Categories
LibrariesLicense
BSD LicenseFollow SunCalc
Other Useful Business Software
Ship Agents Faster
Gemini Enterprise Agent Platform lets you rapidly build, scale, govern and optimize production-ready agents grounded in your organization's data. The platform enables developers to build custom or pre-built agents for virtually any use case. New customers get $300 in free credits.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of SunCalc!