# How to calculate the ECEF coordinates of a satellite given its elevation and azimuth angle, plus the coordinates of a reference object on Earth

So I am looking for a way to 'reverse engineer' satellite ECEF coordinates given its angles of elevation and azimuth and given the coordinates of an object on Earth serving as a reference ground. The satellite is from the Galileo constellation (MEO). Ideally, the solution should be represented as

[x, y, z]=elaz2coords(el, az, xe, ye, ze),

where elaz2coords encapsulates the set of equations which transform coordinates. If someone could point me towards such a set of equations or towards a procedure towards deriving such a set, I would appreciate it greatly.

• Welcome to space! Have you searched this site for similar questions? Sep 29, 2022 at 13:45
• @OrganicMarble, the closes to my question I found was this. Other questions I saw usually go in different direction, how to calculate azimuth and elevation from satellite coordinates Sep 29, 2022 at 13:46
• You need range (distance) in addition to elevation and azimuth. Sep 29, 2022 at 15:34
• @DavidHammen, you are absolutely right. I found some resources where elevation and azimuth are given as a function of satellite and ground reference point coordinates (opposite from what I am searching for), and from those equations it was rather clear that another equation is missing, which is the one for range. Sep 29, 2022 at 20:04

## 2 Answers

There isn't enough information to obtain the position. Those five numbers define a line, not a point. Azimuth and elevation tell you in what direction the satellite is, but not how far away it is. You can either get more measurements, or cheat.

If you get another line of sight from a far away observer at the same time, you can calculate where the lines cross, and that is where your target is. Of course, given experimental error, there won't actually be a point where they exactly cross, but you can compute the point nearest to both (or as many more as you can get) lines in a least-squares sense. If you make some other kind of observation, such as radar rather than optical, even if it's from the same place, you can get a second curve or surface with which to intersect your line of sight.

Cheating means assuming the result of some other measurement based on some constraint you think is obeyed, such as a circular orbit with a known semimajor axis, which gives you a sphere on which the satellite must lie, and you can find the intersection of the line of sight with that sphere. This also has errors, because real satellites feel many perturbing forces which make their orbits differ from ideal Keplerian ellipses in many different and rapidly changing ways, so whatever idealized orbit you assume they're in will also be inaccurate.

• With the (often good) assumption that a satellite isn't actively maneuvering, you could also make many az/el measurements from the same location to derive the orbit Sep 30, 2022 at 0:53
• @ErinAnne true, but that involves a lot more effort, and is not a project that beginners should try to start with. Sep 30, 2022 at 17:06

As Ryan C and David Hammen pointed out to me, the original proposal is under-defined, as it lacks at least one more piece of information. Thus, one should be able to obtain the triplet of ECEF (geocentric) coordinates $$(x^{(s)}, y^{(s)}, z^{(s)})$$ given the elevation, $$\varepsilon_r^{(s)}$$, azimuth, $$\alpha_r^{(s)}$$, line-of-sight distance (a.k.a. range or slanted range) between the reference object on Earth and the observed satellite, $$\rho_r^{(s)}$$, together with the coordinates of the reference object on Earth, $$\vec{r}_{r}$$. The latter can be either in ECEF [$$(x_{r}, y_{r}, z_{r})$$] or geodetic (latitude, $$\lambda_r$$, longitude, $$\varphi_r$$, and altitude $$H_r$$) coordinates. Given this pair of triplets, $$(\varepsilon_r^{(s)}, \alpha_r^{(s)}, \rho_r^{(s)})$$ & $$\vec{r}_{r}$$, and the relationships given here and here, the following set of equations can be constructed: $$dz = cos(\lambda)cos(\varepsilon)cos(\alpha)+sin(\lambda)sin(\varepsilon)$$ $$dx = \frac{dz\times cos(\varphi)cos(\lambda)-cos(\varepsilon)\left[ sin(\varphi)sin(\lambda)sin(\alpha)+cos(\varphi)cos(\alpha) \right]}{sin(\lambda)}$$ $$dy = \frac{cos(\varepsilon)sin(\alpha)+dx\times sin(\varphi)}{cos(\varphi)}$$

Since $$\vec{r}_{r}$$ can be inter-converted between geodetic and ECEF (geocentric) coordinates, as shown in this Wikipedia post, with minor complication of calculating the latitude, which requires either an approximation or an iterative solution, then given $$(\lambda_r, \varphi_r, H_r)$$ one can obtain $$(x_r, y_r, z_r)$$ and vice-versa. Given $$(x_r, y_r, z_r)$$ (regardless of its origin [i.e. direct input or derived from geodetic coordinates]) and the solutions from the system of the equations above, $$(dx, dy, dz)$$, one can find the ECEF coordinates of the satellite as: $$x^{(s)}=x_r+\rho_r^{(s)}dx$$ $$y^{(s)}=y_r+\rho_r^{(s)}dy$$ $$z^{(s)}=z_r+\rho_r^{(s)}dz$$

In the meantime, I've also realized that MATLAB has a bunch of tools that can do this and related conversions (e.g. aer2ecef, aer2geodetic, ecef2geodetic, etc), but it is also good to know for myself how these transformations operate internally.

• yes, adding the slant range will do nicely. one more thing you may want to include is Earth's oblateness, which complicates the relationship between the geodetic inputs and the geocentric outputs. you mentioned it, but haven't put it in your formulas yet, so I recommend you try it out. thanks for visiting space exploration stack exchange, and stay around if you like! Oct 4, 2022 at 23:17
• @RyanC, thanks for the warm welcome. Just to make sure we use the same nomenclature, what do you mean by oblateness? In conversion between geocentric and geodetic, one can calculate latitude iteratively, and depending on the iterative scheme a parameter $N$ may be involved, which takes into account the eccentricity of the Earth, $e$ (its square, in fact), which is also a function of flattening $f=1-\frac{A_{semi-minor}}{A_{semi-major}}$, $e^2=f(1+\frac{A_{semi-minor}}{A_{semi-major}})$ Is then $f$ the oblateness you refer to? Oct 6, 2022 at 20:27