0
$\begingroup$

I need to find a point between two geolocations g1 and g2 (defined by longitude/latitude in radians). Let's say a positive integer n:

  • if n = 1, I'm looking for the middle point m1 between g1 and g2.
  • if n = 2, I'm looking for the 'quarter' point m2 between g1 and g2 (middle point between g1 and m1.
  • ...

For the middle point, I found the following formula:

$$dLon = lon2 - lon1$$ $$Bx = cos(lat2) \times cos(dLon)$$ $$By = cos(lat2) \times sin(dLon)$$

$$lat3 = atan2(sin(lat1) + sin(lat2), \sqrt{(cos(lat1) + Bx} \times (cos(lat1) + Bx) + By \times By))$$ $$lon3 = lon1 + atan2(By, cos(lat1) + Bx)$$

So I could simply reuse this formula (n) times to solve this problem, but maybe there is a way to do it in one operation, while reducing the complexity of the computation?

$\endgroup$
1
  • $\begingroup$ You can try adapting the section formula to your question. $\endgroup$
    – Toby Mak
    Commented Jul 14, 2019 at 13:22

1 Answer 1

0
$\begingroup$

Try the answer to this question about finding a point along the great circle between two points on a sphere. In the notation of the answer, I think you are setting $a’ = a/2^n$ where $a$ is the distance between the points (which the answer calculates).

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .