Finding Latitude and Longitude of a person or of where a picture was taken this is my first post on the Astronomy stack exchange site. Please let me know how this question is based on y'all's generally accepted criteria for a good question as well as possible improvements.

In my AP comp sci class we were given pretty much total freedom to come up with a project, I remembered hearing about it being possible to calculate a person's position or the position a picture was taken based on time of day and the position of the Sun, that is, longitudinal and latitudinal position. For the picture, I heard Sun position was determined through some implementation of shadows in the picture. I thought this was cool and decided to look into it. I found an article written by a prominent UCLA physicist and a well-researched Wikipedia page. I understand what the Wikipedia page requires in regards to values for calculations and what the equations calculate, but I do not understand how to implement them to find longitudinal and latitudinal location, nor do I understand why it has rectangular equatorial coordinates as that is not included in the three-step explanation in the Wikipedia page intro at the top.

For the UCLA report, I understand none of it except for the matrix mathematics and manipulations, and I'm sketchy on those at best, but I do not understand all the coordinate systems that it mentions nor how to implement them to achieve my objective.

So my question comes down to this: Can anyone clarify the equations, their purpose, their implementation, how to convert an answer to longitude and latitude for either the Wikipedia page or the UCLA report?

OR

If you can explain how to find the latitude and longitude of a picture or person. If you choose to explain, I do need equations or an explanation that I can turn into equations.

Please suggest question revisions and whether this should be posted on a different Stackexchange forum. Thanks.
EDIT: It turns out I answered this question earlier (in a slightly different format):

Cancelling out earth rotation speed, Altazimuth mount

Imagine you are at 35N,106W at 5h local sidereal time.

The celestial north pole is at (0,90) in the celestial frame and
(0,35) in your frame.

The point (5h,0) is (75,0) in the celestial sphere (1h = 15 degrees),
and (180,55) in your frame

The point (11h,0) is (165,0) in the celestial sphere and (90,0)
(setting in the east) in your frame.

Converting to rectangular coordinates, we need the matrix that does this:

{0,0,1} -&gt; {Cos[35 Degree], 0, Sin[35 Degree]}

{Cos[75*Degree],Sin[75*Degree],0} -&gt; {-Sin[35 Degree], 0, Cos[35 Degree]}

{Sin[-75*Degree],Cos[75*Degree],0} -&gt; {0,1,0}


or, generalizing a bit (lst = local sidereal time as an angle, lat =
latitude, notice that lon is irrelevant since we're using local
sidereal time)

{0,0,1} -&gt; {Cos[lat], 0, Sin[lat]}

{Cos[lst],Sin[lst],0} -&gt; {-Sin[lat], 0, Cos[lat]}

{-Sin[lst],Cos[lst],0} -&gt; {0,1,0}


Solving (Mathematica):

m0 = Table[a[i,j],{i,1,3},{j,1,3}]

(* Some simplifying assumptions, intentionally avoiding corner cases *)

conds = {-Pi/2 &lt; dec &lt; Pi/2, -Pi/2 &lt; lat &lt; Pi/2, 0 &lt; ra &lt; 2*Pi, -Pi &lt; lst &lt; Pi}

m = Simplify[m0 /. Solve[{
 m0.{0,0,1} == {Cos[lat], 0, Sin[lat]},
 m0.{Cos[lst],Sin[lst],0} == {-Sin[lat], 0, Cos[lat]},
 m0.{-Sin[lst],Cos[lst],0} == {0,1,0}
},Flatten[m0]],conds]

m = m[[1]]


This gives us

$
   \left(
   \begin{array}{ccc}
-\cos (\text{lst}) \sin (\text{lat}) &amp; -\sin (\text{lat}) \sin (\text{lst})
  &amp; \cos (\text{lat}) \\
-\sin (\text{lst}) &amp; \cos (\text{lst}) &amp; 0 \\
\cos (\text{lat}) \cos (\text{lst}) &amp; \cos (\text{lat}) \sin (\text{lst}) &amp;
  \sin (\text{lat}) \\
   \end{array}
   \right)
$

The inverse of this matrix:

$
   \left(
   \begin{array}{ccc}
-\cos (\text{lst}) \sin (\text{lat}) &amp; -\sin (\text{lst}) &amp; \cos
  (\text{lat}) \cos (\text{lst}) \\
-\sin (\text{lat}) \sin (\text{lst}) &amp; \cos (\text{lst}) &amp; \cos (\text{lat})
  \sin (\text{lst}) \\
\cos (\text{lat}) &amp; 0 &amp; \sin (\text{lat}) \\
   \end{array}
   \right)
$

will transform rectangular azimuth and elevation back to right
ascension and declination and right ascension. This would be an
interesting alternative approach to this problem, but I won't be using
it.

OK, if we convert right ascension and declination to rectangular
coordinates, multiply by the first matrix above and convert the result
back to spherical coordinates, we will have azimuth and
elevation. Let's do that...

The spherical coordinates for (ra,dec) are:

{Cos[dec] Cos[ra], Cos[dec] Sin[ra], Sin[dec]}


Multiplying by the matrix, we get

$
   \{\sin (\text{dec}) \cos (\text{lat})-\cos (\text{dec}) \sin (\text{lat})
\cos (\text{lst}-\text{ra}),-\cos (\text{dec}) \sin
(\text{lst}-\text{ra}),\cos (\text{dec}) \cos (\text{lat}) \cos
(\text{lst}-\text{ra})+\sin (\text{dec}) \sin (\text{lat})\}
$

(note that lst-ra is sometimes called the "hour angle", which would
simplify the above)

Converting back to spherical coordinates and simplifying:

{x,y,z} = Simplify[m.{Cos[dec] Cos[ra], Cos[dec] Sin[ra], Sin[dec]},conds]

(* NOTE: the use of single argument arctangent here introduces
ambiguity, and the final answer must compensate for this *)

az = Simplify[ArcTan[y/x],conds]

el = Simplify[ArcSin[z],conds]


yielding:

$
   \text{azimuth}=-\tan ^{-1}\left(\frac{\cos (\text{dec}) \sin
(\text{lst}-\text{ra})}{\sin (\text{dec}) \cos (\text{lat})-\cos
(\text{dec}) \sin (\text{lat}) \cos (\text{lst}-\text{ra})}\right)
$

$
   \text{elevation}=\sin ^{-1}(\cos (\text{dec}) \cos (\text{lat}) \cos
(\text{lst}-\text{ra})+\sin (\text{dec}) \sin (\text{lat}))
$

Assuming I haven't made any mistakes, the next steps would be:


Converting local time to local sidereal time
Inverting these equations to get latitude and longitude from
azimuth, elevation, and time.


I may or may not edit this answer to add those steps, but this
hopefully provides a start.