# How can I calculate GPS satellite's Latitude and Longitude if I have the elevation, the azimuth, the XYZ coordinates of the ground station

How can I calculate a GPS satellite's latitude and longitude if the elevation, the azimuth, and the XYZ coordinates of the ground GPS station are provided?

I have tried these questions:

but the answers are not consistent.

I would need a reference if it is available.

• As mentioned 8n the answer below, you need at least one more piece of information, like the distance to then satellite. If you don't want to guess, you can use three observations to compute the orbit, and get the distance from that. Dec 5, 2023 at 23:22

I have also been looking for how to perform this calculation for a few days. I think I found a solution that works, courtesy of EASA but copying here in case of link rot.

Inputs

• Observer latitude, $$\phi_o$$, (instead of XYZ coordinates you mentioned, which I guess was ECEF?)
• Observer longitude, $$\lambda_o$$
• Elevation angle, $$\theta$$
• Azimuth angle, $$\alpha$$
• Satellite altitude, $$h$$, you didn't mention needing this, but could assume about 20,000 km since GPS satellites are in MEO.

Some assumptions

• Spherical Earth with radius of 6371 km
• Negligible atmospheric effects
• Observer is on the surface

Outputs

• Latitude, $$\phi_s$$, and longitude, $$\lambda_s$$, below satellite

Input angles, including latitude and longitude should be in radians depending on software you use. Then perform these calculations:

1. $$\Psi = \frac{\pi}{2} - \theta - asin\left(\left(\frac{6371}{6371 + h}\right)cos\,\theta\right)$$
2. $$\phi_s = asin(sin\,\phi_o*cos\,\Psi + cos\,\phi_o*sin\,\Psi*cos\,\alpha)$$

3a) If either latitude>70$$^\circ$$ and $$tan\,\Psi*cos(\alpha)>tan(\frac{\pi}{2}-\phi_o)$$ or latitude<-70$$^\circ$$ and $$tan\,\Psi*cos(\alpha+\pi)>tan(\frac{\pi}{2}+\phi_o)$$:

$$\lambda_s = \lambda_o + \pi + asin(\frac{sin\,\Psi*sin\,\alpha}{cos\,\phi_s})$$

3b) Otherwise:

$$\lambda_s = \lambda_o + asin(\frac{sin\,\Psi*sin\,\alpha}{cos\,\phi_s})$$

Python Implementation

import numpy as np

def calculate_nadir(observer_lat, observer_lon, satellite_alt, elevation, azimuth):
# Constants

# Convert angles from degrees to radians

# Calculate intermediate angle
SSP_lat = np.arcsin(np.sin(observer_lat_rad) * np.cos(psi_alt) +

else:

return np.degrees(SSP_lat), np.degrees(SSP_lon)

# Example inputs
observer_latitude = 85  # Replace with your observer latitude
observer_longitude = -10  # Replace with your observer longitude
satellite_altitude = 20000  # Replace with the satellite orbital altitude in kilometers
elevation_angle = 80  # Replace with the elevation angle in degrees
azimuth_angle = -120  # Replace with the azimuth angle in degrees

# Calculate nadir latitude and longitude
satellite_altitude,
elevation_angle, azimuth_angle)

# (Optional) Check results using Skyfield API
import skyfield.api as sapi
earth_obj = planets['earth']
surface_loc = earth_obj + sapi.wgs84.latlon(observer_latitude* sapi.N, observer_longitude * sapi.E)

For the example above Skyfield calculates angles of 79.989604$$^\circ$$ and 240.001123$$^\circ$$ for the elevation and azimuth respectively. If greater accuracy is needed, it could be obtained by using the above as a first guess and then using a bisection type approach with Skyfield to get the matching latitude and longitude.