Sun Position Calculator

(drajmarsh.bitbucket.io)

87 points | by sanbor 8 hours ago

14 comments

  • sanbor 8 hours ago
    • observationist 8 hours ago
      Awesome, thanks for the backup link.

      Amazing visualizer!

  • teraflop 54 minutes ago
    Cool demo!

    I notice that the stars don't seem to be rendered correctly. If you zoom out, you can see the sun's position relative to the stars. As you scroll the date slider through the course of a year, the sun should make a complete 360-degree revolution around the ecliptic. Or, when the camera view is locked to the sun, the stars should appear to revolve relative to the sun.

    Instead, the sun appears motionless against the stars, regardless of the time of year. (If the demo used actual star positions, I would be able to point to how the sun was in the wrong constellation for a given date. But the starfield is randomly generated, so you have to actually observe the sun in motion to see the bug.)

  • jborichevskiy 48 minutes ago
    Relatedly, has anyone seen tooling or approaches to calculate shadows behind particular hills and mountains, depending on the season and time of day? The sunset calculation for Boulder Colorado is quite inaccurate as we are in the foothills with mountains to the west. I've been pondering how to calculate this precisely.
    • antognini 29 minutes ago
      You would basically want to calculate the solar altitude angle (or, equivalently the zenith angle): https://en.wikipedia.org/wiki/Solar_zenith_angle

      Given the mountains, the sun would appear to set when it descends below some altitude angle. Given the equation in the wikipedia article you'd then just solve for the hour angle. (You'd then have to use your latitude to convert the local solar time to Mountain Standard Time.)

  • netsharc 6 hours ago
    Some friends flew eastwards from New York to Singapore on a direct flight (it's one of the longest flights). I wondered what their experience of sunrises and sunsets were (they departed 10PM), I've noted down the times but haven't plotted it...

    Later this year I'm flying from Europe to the West Coast of Canada, and it seems I'll be in daylight for the entirity of the flight (departing 2PM local, landing 4PM local after a 10 hour flight).

    Edit: well, FR24 has a handy flight tracking that includes the daylight progression: https://www.flightradar24.com/data/flights/sq23#3de5a306

    So they flew 18 hours and experienced a full daylight cycle, arriving just before the second sunrise...

    • frikk 6 hours ago
      I flew from central US to western asia (via moscow) and it was an interesting experience for the reasons you mentioned. I think I left early Saturday morning local time and arrived Sunday evening local time. I saw a sunrise, sunset, sunrise, sunset in 18 hours of travel time.
      • Obscurity4340 5 hours ago
        I wonder what the physical toll on a man exprriencing three consecutive solar days?
  • sllabres 48 minutes ago
    I would say this is the prettiest interface I've seen for explaining seasons, analemma, solstice, ... to someone or experimenting myself.

    Thanks for the find!

  • paxys 4 hours ago
    Neat. Similar to https://www.suncalc.org, which also lets you zoom to the neighborhood level. Very useful to figure out when/where sunlight will hit your house.
    • leonidasv 2 hours ago
      There's also https://shademap.app/ for that, also useful (with 3D buildings!). Used it before buying my condo and it was spot-on.
  • samcheng 5 hours ago
    This is a cool visualization. I wonder if it uses the excellent solpos.c library from NREL as the core engine?

    https://www.nrel.gov/grid/solar-resource/solpos

  • sanbor 8 hours ago
    I recommend activating "Show Illuminating Sun Beam" under "Explanatory tools" by clicking the graduation cap icon in the top right corner.
  • Nora23 3 hours ago
    This is great for photographers planning golden hour shoots. The neighborhood-level zoom is particularly useful.
  • recallingmemory 6 hours ago
    Rate limit for this resource has been exceeded
  • wumms 6 hours ago
    Love it. Needs a moon.
  • fennec-posix 8 hours ago
    This is incredibly cool!
  • mannanj 8 hours ago
    I've been wanting to make a little circadian rhythm graphic based on the sun, would love to have a graphic like this to support it. If Andrew Marsh is listening, would love to create something to extend what I have (Preview at sun-taupe.vercel.app)
    • layman51 7 hours ago
      This is really cool! The clock on your page reminded me too of some sites that show a "real solar" time based on your location where solar noon corresponds to 12:00 PM.
  • abicklefitch 8 hours ago
    [dead]