Let me give a slightly better answer. If you visit
http://ssd.jpl.nasa.gov/horizons.cgi with these parameters:
you'll see the Sun's astrometric right ascension and declination for a
48 hour period.
Let's look at one of the results and see what it tells us:
Date__(UT)__HR:MN R.A._(ICRF/J2000.0)_DEC
**********************************************
$$SOE
2016-Nov-13 00:00 15 13 30.08 -17 57 18.0
This says the sun's declination is 17$^{\circ}$57'18.0" which means
the sun is (almost) directly overhead at that latitude.
The right ascension is 15h13m30.08s which means the sun is (almost)
directly overhead where the local sidereal time is this value.
To compute local sidereal time we first use
http://aa.usno.navy.mil/faq/docs/GAST.php to get GMST (I'm using the
approximation):
GMST = 18.697374558 + 24.06570982441908 D
To get D, the number of days since the year 2000, I used Unix's date
command as follows, and used other commands to finish the calculation:
: per http://aa.usno.navy.mil/faq/docs/GAST.php we compute the number of
: days since 2000 January 1, 12h UT (not 0h UT)
date -d '2000-01-01 12:00 UTC' +%s;: result is 946728000
date -d '2016-11-13 00:00 UTC' +%s;: result is 1478995200
: take the difference and convert result to days for formula
perl -le 'use POSIX; printf("%.10f\n", (1478995200-946728000)/86400)'
: result above is 6160.5 (trailing digits are 0)
: computing GMST and modding to get result between 0 and 24
perl -le 'use POSIX; printf("%.10f\n", fmod(18.697374558 + 24.06570982441908*6160.5,24))'
: result above is 3.5027478917
: convert solar RA to decimal
perl -le 'use POSIX; printf("%.10f\n", 15+13/60+30.08/3600)'
: result above is 15.2250222222
: how many hours east of GMST is the Sun (in degrees)? 1h = 15 degrees
perl -le 'use POSIX; printf("%.10f\n", (15.2250222222-3.5027478917)*15)'
: result above is 175.8341149575
: converting to minutes and seconds, we first find seconds from fractional part
perl -le 'use POSIX; printf("%.10f\n", 0.8341149575*3600)'
: result above is 3003 rounded to nearest second
: and now minutes/seconds from 3003 seconds total
perl -le 'use POSIX; printf("%.10f %.10f\n", floor(3003/60), 3003%60)'
: result above is 50 and 3
So you would think the Sun is overhead at 17$^{\circ}$57'18.0'' south
latitude (south because the declination is negative) and longitude
175$^{\circ}$50'03"E (east because longitude is positive) at 00:00 UTC
on 2016-Nov-13. Let's use HORIZONS to see if this is true (it turns
out it won't be, so we'll use a minute on either side of 2016-Nov-13
00:00 UTC to see what happens):
We can confirm the Sun's RA matches local sideral time within 1 second
of 00:00UTC from these lines in the output:
Date__(UT)__HR:MN:SC.fff R.A. DEC Azi Elev Sid_Time
2016-Nov-13 00:00:00.000 * 15 13 30.08 -17 57 18.0 104.6639 89.7692 15 13 29.2615
2016-Nov-13 00:00:01.000 * 15 13 30.08 -17 57 18.0 104.9166 89.7730 15 13 30.2643
You'll notice the local sidereal time jumps from being 0.82 seconds
behind the sun's right ascension to 0.18 seconds ahead of the sun's
right ascension in the one second period (showing the two matched
sometime within that second, probably at 00:00:00.82 or so).
However, the Sun's highest position (noted by HORIZONS as 't' for
transit) occurs a little later:
Date__(UT)__HR:MN:SC.fff R.A. DEC Azi Elev Sid_Time
2016-Nov-13 00:00:56.000 * 15 13 30.23 -17 57 18.6 178.5844 89.9415 15 14 25.4148
2016-Nov-13 00:00:57.000 *t 15 13 30.24 -17 57 18.6 182.4651 89.9415 15 14 26.4176
2016-Nov-13 00:00:58.000 * 15 13 30.24 -17 57 18.6 186.3230 89.9412 15 14 27.4203
when the local sideral time is almost a minute ahead of the sun's
right ascension. What's going on here?
Since the Earth is an ellipsoid, and not a sphere, it turns out that
"up", the direction perpendicular to a location on Earth, is NOT
directly away from the center of the Earth (it turns out gravity acts
in a direction that is neither towards the center of the Earth nor
perpendicular to the surface, but that's not relevant for this
question): see http://www.oc.nps.edu/oc2902w/c_mtutor/shape/shape4.htm
for details.
If you want really accurate calculations you'll have to use
http://naif.jpl.nasa.gov/naif/tutorials.html 's
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/surfnm_c.html
function.
Although this doesn't cause the discrepancy above, another
consideration is a location's elevation above the surface of the
Earth, which can also have slight effect (since "up" isn't always
towards the zenith). Happily, one thing you can ignore is refraction,
since refraction at the zenith is effctively zero.
My http://test.barrycarter.info/sunstuff.html is a very approximate
representation of where the Sun is overhead and is generated by
https://github.com/barrycarter/bcapps/blob/master/bc-sun-always-shines.pl