$lon_{Sat}=f(lon, lat, ht, el, az)$
Where:
- $lon$ Receiver longitude
- $lat$ Receiver latitude
- $ht$ Receiver height in metres (does not have a major effect but adding for completeness)
- $el$ Satellite elevation in degrees
- $az$ Satellite azimuth in degrees
$a = 6377.301243$ (Semi-Major Axis of Earth in Kilometres)
$f = \frac{1}{ 298.257223563}$ (Flattening of Earth)
$\rho = \frac{a \times (1 - f)}{\sqrt{1 - (2 - f) \times f \times \cos^{2}lat}}$
$x = 90 - el - \arcsin\left(\frac{(\rho + \frac{ht}{1000})}{42164^*}\right) \times \cos(el)$
Note: * The orbital radius in Kilometres
$y = \arccos\bigl(\cos(x) \times \cos(90 - lat) + \sin(90 - lat) \times \sin(x) \times \cos(az)\bigl)$
$z = \arcsin\left(\sin(x) \times \frac{\sin(az)}{\sin(y)}\right)$
$lon_{Sat} = (z + lon + 540) \bmod 360 - 180$ (Can be simplified to '$z + lon$', but this normalizes the values of longitude)
Gives me correct location of GNSS satellites (with the azimuth/elevation of satellites reported by Android GNSS sensor) when checked from https://in-the-sky.org/satmap.php.
Web based calculator using these formulas available here:
https://deeppradhan.heliohost.org/misc/satellite-calculator.htm