Distance between points on Earth So the problem is this: 
 Assuming the surface of the Earth
is a sphere of circumference 40, 000 kilometers, estimate the distance between
Philadelphia and Paris.
I'm uncertain how to do this problem. I haven't done these kinds of question before, but besides doing some geometry of the earth how am I supposed to solve this? How do you go about using the latitude and longitude coordinates? 
 A: One approach using more familiar methods might be:


*

*calculate the radius of the earth using the $2\pi r$ expression for the circumference

*longitude $\lambda$ and latitude $\phi$ on a sphere radius $r$ correspond to the coordinates $\left(r \cos(\phi) \cos(\lambda), r \cos(\phi) \sin(\lambda), r \sin(\phi)\right)$ with the origin at the centre of the sphere (remember that W is negative $\lambda$)

*you can find the angle between two points using the dot product, dividing by the product of their magnitudes (i.e. by $r^2$) and then taking the arccosine

*you can find the corresponding great circle arc length distance by multiplying the angle (in radians) by the radius, i.e. $r \theta$      


Apparently the real world (non-spherical) answer is just under $6000$km so if you are not close to that then there may be an error
A: Two methods are listed here for obtaining the great-circle distance on a sphere:


*

*distance $=R*\cos^{-1}(\cos(\phi_1)\cos(\phi_2)\cos(\lambda_1-\lambda_2)+\sin(\phi_1)\sin(\phi_2))$

*distance $=2R\,\tan^{-1}(\frac{\sqrt a}{\sqrt {1-a}})$, where $a=\{[1-\cos(\phi_2-\phi_1)]+\cos(\phi_1)\cos(\phi_2)[1-\cos(\lambda_2-\lambda_1)]\}/2$


where $R$ is radius of the earth, $\lambda$ the longitude and $\phi$ the latitude.
The second one is Haversine formula and is faster than the first one if you write both formula into program subroutines.
