top | item 39024115

(no title)

qurashee | 2 years ago

Twenty-three years ago, during my daily trips to the university campus, I had the exact same idea. However, I became distracted by calculating the position of the sun and delved into astronomical algorithms, which led me to never complete it. Kudos to you, that's really impressive!

discuss

order

Amithv|2 years ago

The hard part was obtaining information such as solar azimuth, altitude, declination, hour angle, etc without using external APIs. Spent around 5 days implementing backend.

antgiant|2 years ago

Way too late now, but to help others this fancy Excel sheet provided by NOAA is awesome! It implements all of these equations in Excel and is pretty easily portable to your programming language of choice. https://gml.noaa.gov/grad/solcalc/calcdetails.html

P.S. Using this has made it clear to me how bad most sunrise/sunset calculators actually are.

manchego|2 years ago

For anyone wanting to do this calculation yourself, this site is really good: https://www.aa.quae.nl/en/reken/zonpositie.html

I've previously used the formulas on this site to calculate the altitude/azimuth of the Sun and all the planets from a given lat/long/time on Earth.

addandsubtract|2 years ago

Getting lost on the 0.1% edge cases or improvements is why I never finish side projects, either.

berkes|2 years ago

I don't always manage to adhere to my own advise here. But talking to "customers" really solves this.

Half these customers can't be bothered by the edge cases that I've been poring over for nights. The other half puts forward edge cases that I've never been aware of. Some of which are critical to their work-flow. Many are implemented in mere minutes. "Wow. That saves us 30 minutes typing over prices, every day!".

As an engineer I love to find solutions. But as an entrepeneur I really must understand the problem and scope. that 0.1% edge cases is hardly ever part of the success.

ngcazz|2 years ago

Writing the level editor for my raycaster is why I never wrote my raycaster

chippiewill|2 years ago

I don't think getting the position of the sun is an edge case, it's a fundamental capability for the product to work at all