# Calculate the distance between two points on a sphere (earth) going through the earth?

I can see the formula and name of the term for the distance between any two points on a sphere when going around the surface of the sphere is the great-circle distance, or orthodromic distance.

What is the calculation for the distance between any two points on a sphere going directly through the sphere?

• couldn't you solve that using simple 3D pythagoras? Aug 2, 2020 at 10:33
• @IanTurton maybe, I don't quite know what that is though! Is that an equation or some software? Aug 2, 2020 at 10:36
• @IanTurton thanks very much. Just checking is `dz+dz` meant to be `dz*dz` Aug 2, 2020 at 10:55
• The equation can be found here. It has to take angles into considerations
– JGH
Aug 2, 2020 at 12:13
• GIS generally operates on a sheroid, and doesn't generally bore through the Earth (and if it does, it has to use a spheroid), so this is more of a pure Mathematics question. Aug 2, 2020 at 12:16

First, calculate the great circle distance, G, using your GIS or spherical trigonometry (or look for various questions on this site).

Then calculate the angular distance, α = G / R. (R is globe radius.)

Finally, use those to calculate chord length, L = 2 R sin (α / 2).

One source: mathworld.wolfram.com/CircularSegment.

Or, use the Tunnel_distance equation, as suggested by JGH.

• Hi @Martin F thanks very much! I tried it, and the answer I get is identical to the starting value for G ? Aug 3, 2020 at 22:17
• here's my R code `G = 5.25; R = 6371; α = G / R; 2 * R * (sin(α / 2))` Aug 3, 2020 at 22:18
• Your G is small to have any meaningful difference. If G smaller than 11km then it can be assumed to be flat. Aug 4, 2020 at 14:01