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!
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.
Thanks for posting this, honestly the 0.1% scare me sometimes on technical project. I think you're right, just gotta talk to my customers directly if they even care about it.
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.
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.
> P.S. Using this has made it clear to me how bad most sunrise/sunset calculators actually are.
That may just be a function of how you define "sunrise" and "sunset". It is never as simple as "when the sun hits the horizon", but something about some number of arc minutes from something something.
I'm not sure what you mean by external APIs but is there a reason you're not using SunCalc[1] on the client to process the route after it's returned from the routing engine?
You should team up with the people who wrote zonopjebakkes/seatsinthesun, which is used for finding bars and cafes that have terraces that are still in the sun, mostly useful in late summer afternoons as the evenings are getting shorter and cooler.
Thanks for this link - I'm amazed to see it even has an approximation for my city based on buildings (Detroit.)
This is really useful tool for photography. On Android, I also use Sun Surveyor to determine when the sun is hitting the right side of a building, but it doesn't show the shadows cast by other buildings!
I recently took a bus over the Andes and was congratulating myself on choosing a seat on the shady side. Then I realized that in the southern hemisphere the sun is in the north and I had outsmarted myself.
Yes. There are is mnemonic phrase in german to tell where the sun is in morning/noon/evening which contains "sun is never seen in the north" - which just not work on the southern hemisphere.
Interesting because the sun rises and sets from the north (NE, NW) during the summer in the northern hemisphere. The effect is more pronounced the farther north of the equator you are and Germany is quite far north.
> Then I realized that in the southern hemisphere the sun is in the north
That's not exactly true. South of the tropic of capricorn, the sun is in the north at noon. Between the equator and the tropic of capricorn the sun could be slightly towards the north or south or directly overhead at noon depending on the season. As for sunrise and sunset the sun could be just about anywhere if you go south enough and the season is right. At the south pole in summer, the sun just runs 360 degrees around, floating slightly above the horizon, and daylight is 24 hours long. If you are standing 1km from the south pole, you will see the sun in the south direction at midnight and in the north direction at noon. And if you go just further from the south pole, e.g. to Patagonia in summer (i.e. now) the sun rises and sets close to the south and goes around to the north at mid-day. Daylight is close to 20 hours long. It's similar to the south pole situation except when the sun gets close to exact south it dips below the horizon for a few hours and you have a short-lived few hours of darkness. But you do see the sun in the southeast at sunrise and southwest at sunset.
Yep, my bedroom has windows to the south and east, which means here in New Zealand I should not expect any afternoon & evening sun that room. However, currently in summer when the sun is close to setting I get a few minutes of evening sun through the southern window, due to sun setting slightly southwest.
South in French is sud, while noon is indeed midi. However, the two words are the same in Latin (meridies, lit. midday, as in p.m. = post meridiem, etc.), so probably in some of the other Romance languages they do match?
Comments (210) 98 threads
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.
Continue this thread — 3 replies
P.S. Using this has made it clear to me how bad most sunrise/sunset calculators actually are.
That may just be a function of how you define "sunrise" and "sunset". It is never as simple as "when the sun hits the horizon", but something about some number of arc minutes from something something.
Continue this thread — 4 replies
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.
[1] https://www.npmjs.com/package/suncalc
[1] https://shademap.app/@37.75153,-119.53737,12.65679z,16416003...
This is really useful tool for photography. On Android, I also use Sun Surveyor to determine when the sun is hitting the right side of a building, but it doesn't show the shadows cast by other buildings!
That's not exactly true.
South of the tropic of capricorn, the sun is in the north at noon.
Between the equator and the tropic of capricorn the sun could be slightly towards the north or south or directly overhead at noon depending on the season.
As for sunrise and sunset the sun could be just about anywhere if you go south enough and the season is right.
At the south pole in summer, the sun just runs 360 degrees around, floating slightly above the horizon, and daylight is 24 hours long. If you are standing 1km from the south pole, you will see the sun in the south direction at midnight and in the north direction at noon.
And if you go just further from the south pole, e.g. to Patagonia in summer (i.e. now) the sun rises and sets close to the south and goes around to the north at mid-day. Daylight is close to 20 hours long. It's similar to the south pole situation except when the sun gets close to exact south it dips below the horizon for a few hours and you have a short-lived few hours of darkness. But you do see the sun in the southeast at sunrise and southwest at sunset.
Continue this thread — 2 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.