Searching is easy to find terminator line (frontier between day and night) or the position of the sun in the sky given a position on the earth and a time; but I can't find how to obtain where is the zenith of the sun given a date (and time).

I need to obtain the center of the illuminated zone of the earth (latitude and longitude) at a given time. (Well, actually I need the opposite, the Nadir, but with one you can calculate easily the other).

Any knows the function?

Thank you.

  • $\begingroup$ You can compute the sun's altitude/azimuth for any point on Earth, so it seems computing the nadir/zenith should be easy? I think I might be misunderstanding the question. There are plenty of sites that show day/night, including my test.barrycarter.info/sunstuff.html $\endgroup$
    – user21
    Nov 19, 2014 at 13:24

1 Answer 1


What you're looking for is the latitude and longitude of the subsolar point.

Calculating it with accuracy is somewhat complicated. Here is a python library that has routines to do it for you: http://rhodesmill.org/pyephem/

You could also possibly query this information from other sites.

If you really want to work it out on your own, I suggest "Spherical Astronomy" by Robin M. Green published by Cambridge University Press as a starting point.

  • $\begingroup$ PyEphem is fantastic. You can do so many things with it. Calculate the positions of all important celestial bodies, at arbitrary times, with just a few lines of Python code. Awesome. $\endgroup$ Jun 23, 2015 at 23:55
  • $\begingroup$ Also finding this answer helpful, but as an update, it looks like PyEphem is recommending to now use rhodesmill.org/skyfield $\endgroup$
    – cchapman
    Jan 8, 2021 at 20:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .