# Distance on a 2-sphere

1. Jan 13, 2005

### homology

Okay, say you're given two points on a sphere, using the metric tensor how do you find the distance between the two points? (along the geodesic connecting them)

By the way, I know how to do it with just plain old vectors in R^3, but I'd like try doing it with the metric tensor.

Thanks,

Kevin

2. Jan 13, 2005

### pervect

Staff Emeritus
Well, if you have the equation of the geodesic, it's fairly easy. Let's suppose the coordinates are x1 and x2, probably lattitude and longitude. Suppose our geodesic is a curve that has coordinates $$\mbox{x^1(\lambda)}$$ , $$\mbox{x^2(\lambda)}$$ i.e
these two functions are the paramaterized geodesic. You can think of $$\mbox{\lambda}$$ as being a time parameter if you envision an object actually moving along the geodesic. Then to get the distance, you just have to integrate

$$\int_{lambda} d \lambda \sqrt{\Sigma_{ij} (g_{ij} {(\frac{d x^i}{d \lambda})(\frac{d x^j}{d \lambda}) )}$$

where $$\mbox{\lambda}$$ varies from the starting point of the geodesic to the ending point

Expanding out the sum over i,j in the square root for expositional purposes, we write
$$\int_{lambda} d \lambda \sqrt{g_{11} (\frac{dx^1}{d\lambda})^2 + 2 g_{12} \frac{dx^1}{d\lambda} \frac{dx^2} {d\lambda} + g_{22} (\frac{dx^2}{d\lambda})^2}$$

If you don't have the equation for the geodesic, you have to solve the differential equations for geodesic motion

$$\frac{d^2 x^u}{d \lambda^2} + \Gamma^u{}_{ab}(\frac{dx^a}{d \lambda})(\frac{dx^b}{d \lambda})$$

3. Jan 14, 2005

### homology

well the geodesic is going to be part of a great circle so I should probably just try to parameterize it...Thanks, I'll try it out.