Calculating straight-line distance between cities

  • Thread starter Nathanael
  • Start date
In summary, the formula for finding the straight-line distance between two cities with given longitude/latitude coordinates is B = √(B₁² + B₂²), where B₁ = 2Rsin(θ/2) and B₂ = 2Rsin(φ/2). This formula assumes that the distance between lines of longitude is the same from equator to pole, which may not be accurate for all cases. An alternative formula that takes into account the difference in longitude and latitude coordinates is B = 2Rcos(Φ)sin(|θ₂ - θ₁|/2) or B = 2Rsin(|Φ₂ - Φ₁|/2). These formulas can be further
  • #1
Nathanael
Homework Helper
1,650
246
Suppose we know the (longitude/latitude) coordinates of two cities and we want to find the straight-line distance between them. Call this distance B.

Would this be correct?

##B=\sqrt{B_1^2+B_2^2}##
##B_1=2R\sin(\theta / 2)##
##B_2=2R\sin(\phi / 2)##
Where:
R is the Earth's radius
θ and Φ are the difference between the longitude/latitude coordinates respectively.

Seems correct to me, but I have an astronomy lab where the coordinates of two cities are given and the (straight-line) distance between them is given, but it doesn't agree with my formula above.
 
Physics news on Phys.org
  • #2
Off the top of my head, I should have expected the latitude to be included in the calculation for the distance between lines of longitude. Your formula seems to assume that the distance between lines of longitude is the same from equator to pole. (no spherical effects) I did all this once in a Nav course and once in a propagation programme for HF broadcasting but it's all gone!
At first, I thought "great circle" but, of course, for Astronomy, you really do want the straight line distance.
 
  • #3
Are you looking for the "straight-line" distance across the curved surface of the Earth (the distance you'd cover if you walked from one city straight towards the other) or the straight-line path that goes through the earth?

Either way, the same ##\theta## value corresponds to different distances according to how far from the poles you are. You're not taking that effect into account.
 
  • Like
Likes sophiecentaur
  • #4
I doubt it would be that, because the formula is symmetric in ##\theta## and ##\phi## but their roles in the spherical coordinates are not symmetric. If ##\theta## is the azimuth then it relates to a smaller circle (non-great circle) than ##\phi##.

I think the correct formula will be based on doing the 3D geometry to work out the angle ##\angle C_1OC_2## where ##C_1,C_2## are the locations of the two cities on the sphere and ##O## is the centre. Then the distance is just ##R \angle C_1OC_2##.

Edit: I just saw Nugatory's post. I had assumed by 'straight line' you meant the great circle distance, but as he points out, you may mean the straight line in ##\mathbb{R}^3##, for which a different formula would apply, but again I would not expect it to be symmetric in ##\theta,\phi##.
 
  • #5
Ok, thanks everyone. Yes I meant the straight-line distance through space, not the curved path along the surface.

Let us use ##Φ_1## ##θ_1## and ##Φ_2## ##θ_2## for each city. (Φ is latitude so Φ=0 is on the equator.)

If Φ_1 = Φ_2, it would be:
##B=2R\cos(Φ)\sin\big(\frac{\left |θ_2-θ_1\right |}{2}\big)##

If θ_1 = θ_2 it would be:
##B=2R\sin\big(\frac{\left |Φ_2-Φ_1\right |}{2}\big)##

I'll have to think more about how to put it together when both coordinates are different. I can't use pythagoreans theorem as I don't believe they would be perpendicular (unless φ=0 for one of the cities).

Thanks again, I'll think about it.
 
  • #6
The coordinates of ##C_i## are ##z_i=R\cos\phi_i,\ x_i=R\sin\phi_i\cos\theta_i,\ y_i=R\sin\phi_i\sin\theta_i##.
The straight line distance will be

$$d=\sqrt{(z_2-z_1)^2+(y_2-y_1)^2+(x_2-x_1)^2}$$

Substituting the formulas from the first line into that gives the answer. I imagine some simplification is possible.

Further, although this isn't what you're after, the great circle distance will be

$$R\sin^{-1}\frac{d}{2R}$$
 
Last edited:
  • Like
Likes sophiecentaur
  • #7
Good point, converting to cartesian then using pythaogrean is a straightforward solution, thanks Andrew.
 

FAQ: Calculating straight-line distance between cities

1. How is straight-line distance between cities calculated?

Straight-line distance between cities is calculated using the Pythagorean Theorem. This theorem states that the square of the hypotenuse (longest side) of a right triangle is equal to the sum of the squares of the other two sides. In this case, the two sides represent the distance of each city from a reference point, and the hypotenuse represents the straight-line distance between the two cities.

2. What is the reference point used in calculating straight-line distance between cities?

The reference point used in calculating straight-line distance between cities is usually the center of the Earth, also known as the geographic center. This point is used because it provides a consistent and accurate measurement for all locations on Earth.

3. How accurate is the calculated straight-line distance between cities?

The calculated straight-line distance between cities is generally accurate, but it may not be 100% precise. This is because the Earth is not a perfect sphere and the reference point used may vary slightly. However, for most practical purposes, the calculated distance is accurate enough.

4. Can the curvature of the Earth affect the calculated straight-line distance between cities?

Yes, the curvature of the Earth can affect the calculated straight-line distance between cities. As mentioned before, the Earth is not a perfect sphere and this curvature can cause slight variations in the calculated distance. However, this effect is minimal and can be considered negligible for most practical purposes.

5. Is there a difference between straight-line distance and driving distance between cities?

Yes, there is a difference between straight-line distance and driving distance between cities. Straight-line distance is the shortest distance between two points on a map, while driving distance takes into account the actual route and roads that need to be taken to reach the destination. This means that the driving distance may be longer than the straight-line distance, especially if there are obstacles such as mountains or bodies of water between the two cities.

Back
Top