All Projects → porrey → Solar-Calculator

porrey / Solar-Calculator

Licence: LGPL-3.0 License
Calculates the sunrise and sunset for a given date and location (using GEO coordinates). This library uses the method outlined NOAA Solar Calculations Day spreadsheet found at http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html.

Programming Languages

C#
18002 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to Solar-Calculator

rust-sun
A Rust library for calculating sun positions
Stars: ✭ 31 (-13.89%)
Mutual labels:  sunrise, sunset
astro
自用天文算法,公历农历转换、八大行星位置、日出日落月出月落时间、节气物候时间等
Stars: ✭ 33 (-8.33%)
Mutual labels:  sunrise, sunset
beihu-geo
地理位置解析服务,可供爬虫使用!供参考学习!
Stars: ✭ 16 (-55.56%)
Mutual labels:  latitude, longitude
geolocation-php-api
This Geolocation PHP class connects to Google Maps API to find latitude/longitude or the address.
Stars: ✭ 71 (+97.22%)
Mutual labels:  latitude, longitude
PHPCoord
PHPCoord is a PHP library to aid in handling coordinates. It can convert coordinates for a point from one system to another and also calculate distance between points
Stars: ✭ 78 (+116.67%)
Mutual labels:  latitude, longitude
laravel-geoly
Perform fast and efficient radius searches on your Laravel Eloquent models.
Stars: ✭ 25 (-30.56%)
Mutual labels:  latitude, longitude
llttz
The easy way to get java TimeZone from latitude/longitude
Stars: ✭ 27 (-25%)
Mutual labels:  latitude, longitude
sunraster
A SunPy-affiliated package which provides tools to analyze data from spectral data from any solar mission.
Stars: ✭ 19 (-47.22%)
Mutual labels:  sunrise, solar
Positional
An elegant and colorful location information app for Android with Compass, Clock, Level, Sun, Moon, Trail Marker and many other features.
Stars: ✭ 72 (+100%)
Mutual labels:  latitude, longitude
haversine-js
JavaScript implementation of the Haversine formula
Stars: ✭ 12 (-66.67%)
Mutual labels:  latitude, longitude
go-sunrise
Go package for calculating the sunrise and sunset times for a given location
Stars: ✭ 42 (+16.67%)
Mutual labels:  sunrise, sunset
react-cartographer
Generic component for displaying Yahoo / Google / Bing maps.
Stars: ✭ 82 (+127.78%)
Mutual labels:  latitude, longitude
Vincenty-Excel
Thaddeus Vincenty's Direct and Inverse formulae for geodesic calculations in Excel (distance, azimuth, latitude, longitude).
Stars: ✭ 29 (-19.44%)
Mutual labels:  latitude, longitude
Daylight-Calendar-ICS
Daylight Calendar is a dynamically generated .ics calendar that you can host and subscribe to in Google Calendar, iCal, or other calendar software.
Stars: ✭ 22 (-38.89%)
Mutual labels:  sunrise, sunset
Sunscreen
🌅 A macOS app that sets your wallpaper based on sunrise and sunset.
Stars: ✭ 52 (+44.44%)
Mutual labels:  sunrise, sunset
sun
Simple library and application that shows sunset and sunrise based on your latitude,longitude
Stars: ✭ 23 (-36.11%)
Mutual labels:  sunrise, sunset
pikaz-location
定位插件(限中国)
Stars: ✭ 78 (+116.67%)
Mutual labels:  latitude, longitude
geodesy-php
Geodesy PHP - Port of some known geodesic/math functions for getting distance from a known point A to a known point B given their coordinates. It also supports conversion between units of length, Polar position to Cartesian coordinates, and different Reference Datums.
Stars: ✭ 26 (-27.78%)
Mutual labels:  latitude, longitude
Trilateration
Trilateration system using 3 latitude and longitude points, and 3 radius distances in PHP, C#, Java and Javascript
Stars: ✭ 22 (-38.89%)
Mutual labels:  latitude, longitude
astral
☀️ Go calculations for the position of the sun and moon.
Stars: ✭ 23 (-36.11%)
Mutual labels:  sunrise, sunset

Build Status

Nuget Nuget

Nuget Nuget

Solar-Calculator

Calculates the sunrise and sunset for a given date and location (using GEO coordinates). This library uses the method outlined NOAA Solar Calculations Day spreadsheet found at http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html.

Installing

Add this to your project in Visual Studio using NuGet Package Manager UI and ID SolarCalculator or using the Package Manager Console.

PM> Install-Package SolarCalculator

Sample Code

The sample code below shows how to initialize and call the Solar Calculator to get the sunrise and sunset for the given location.

Sunrise in Chicago

using System;
using Innovative.SolarCalculator;

// ***
// *** Geo coordinates of Oak Street Beach in Chicago, IL
// ***
// *** NOTE: the .Date is not necessary but is included to demonstrate that time input 
// *** does not affect the output. Time will be returned in the current time zone so it 
// *** will need to be adjusted to the time zone where the coordinates are from (there 
// *** are services that can be used to get time zone from a latitude and longitude position).
// ***
TimeZoneInfo cst = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");
SolarTimes solarTimes = new SolarTimes(DateTime.Now.Date, 41.9032, -87.6224);
DateTime sunrise = TimeZoneInfo.ConvertTimeFromUtc(solarTimes.Sunrise.ToUniversalTime(), cst);

// ***
// *** Display the sunrise
// ***
Console.WriteLine($"View the sunrise across Lake Michigan from Oak Street Beach in Chicago at {sunrise.ToLongTimeString()} on {sunrise.ToLongDateString()}.");

Sunset in Michigan

// ***
// *** Geo coordinates of Benton Harbor/Benton Heights in Michigan
// ***
TimeZoneInfo est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");              
SolarTimes solarTimes = new SolarTimes(DateTime.Now, 42.1543, -86.4459);
DateTime sunset = TimeZoneInfo.ConvertTimeFromUtc(solarTimes.Sunset.ToUniversalTime(), est);

// ***
// *** Display the sunset
// ***
Console.WriteLine($"View the sunset across Lake Michigan from Benton Harbor in Michigan at {sunset.ToLongTimeString()} on {sunset.ToLongDateString()}.");
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].