# How to calculate distance from the International Space Station given coordinates?

How would one calculate how far away a point is (latitude/longitude) from the international space station given its latitude/longitude/altitude? The distance would be direct as if drawing a straight line from the two points, even if on the other side of the Earth.

• Maybe convert your location and the location of ISS into rectangular coordinates? – peterwhy Aug 31 '15 at 20:55
• If you want it to be very precise, you also need to know the radius of Earth at both points. IOW distance from the center of Earth rather than the altitude. – Jyrki Lahtonen Aug 31 '15 at 21:03

If $r$ is the distance from the Earth's centre, $\phi$ is the longitude in radians (increasing from zero at Greenwich as one goes eastwards) and $\theta$ is the latitude in radians (increasing from zero at the Equator as one goes northwards), then the $(x,y,z)$ coordinates are given by:
$$p(r,\phi, \theta) = r(\cos \phi \cos \theta, \cos \phi \sin \theta, \sin \phi)$$
Given two sets of coordinates $(r_k,\phi_k, \theta_k)$, the distance is given by $\|p(r_1,\phi_1, \theta_1)-p(r_2,\phi_2, \theta_2)\|$.
In your case, we can take $r_1=R$, $r_2=R+A$, where $R$ is the radius of the Earth (I'm assuming a nice sphere, of course) and $A$ is the altitude of the station above the surface of the Earth.
• $p$ is a function $p:[0,\infty) \times [0,2 \pi] \times [-\pi,\pi] \to \mathbb{R}^3$. The $k$ is $1$ or $2$ and just selects one of a pair of coordinates. – copper.hat Aug 31 '15 at 22:29
• I'm not sure what you are having issues with. Just substitute the various values in and compute. The radius of the Earth is about 6,400km, the ISS is about 400km above the surface, so $r_1 =6400, r_2 = 6800$. Then substitute the longitudes & latitudes (in radians) to compute the $(x,y,z)$ coordinates of the two points and then compute the Euclidean distance between the two points. – copper.hat Aug 31 '15 at 22:42