geographic math

55 Views Asked by At

I want to calculate distance from a given latitude and longitude on the earth to the special position of satellite. I have the lat and long and altitude of satellite. thanks in advance

1

There are 1 best solutions below

0
On

The longitudes and latitudes are in fact the $\theta$ and $\phi$ of the spherical coordinates as shown below $$x = rcos \theta cos \phi$$ $$y = rsin \theta cos \phi$$ $$z = rsin \phi$$

Hence the Cartesian coordinates of the location on the ground is (R is the radius of the earth):

$$x_1 = R cos \theta_1 cos \phi_1$$ $$y_1 = R sin \theta_1 cos \phi_1$$ $$z_1 = R sin \phi_1$$

While those of the satellite are (h is the altitude of the satellite): $$x_2 = (R + h) cos \theta_2 cos \phi_2$$ $$y_2 = (R + h) sin \theta_2 cos \phi_2$$ $$z_2 = (R + h) sin \phi_2$$

Then the distance between the two locations is $$D = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}$$