# Calculate Coordinates on the Beeline between two Coordinates on a Spheroid/Ellipsoid (Earth)

I have two coordinates of locations on the earth and want to calculate points in between these two coordinates on the Beeline, for example the coordinate in the middle or at 10%.

I am able to do this on a plane. However, I am not sure how to do this on a spheroid or ellipsoid. It doesn't need to be 100% accurate, but the planar version is definitely not good enough.

As asked by Ian Turton, I tried a planar formula, in Java this could look like this (taken from jts):

``````  public Coordinate pointAlong(double segmentLengthFraction)
{
Coordinate coord = new Coordinate();
coord.x = p0.x + segmentLengthFraction * (p1.x - p0.x);
coord.y = p0.y + segmentLengthFraction * (p1.y - p0.y);
return coord;
}
``````

I had a look at JTS as well, but I could only find a planar (`LineSegment#pointAlong`) version for this, not sure if they offer a different version?

• what language are you using? what have you tried so far? Jul 3, 2019 at 9:35
• @IanTurton as mentioned in the question, I tried for example `LineSegment#pointAlong`, which uses a planar approach. I am using Java, but I am not necessarily looking for a language specific solution. I am looking for an algorithm or formula. That's why I didn't mention any language specifics and did not add any language specific tags. A solution in Java would be fine for me, but a general formula would be great as well. Jul 3, 2019 at 10:32
• I added a code example @IanTurton, but I am not sure if this improves the question, as this is obviously not the correct approach? Jul 3, 2019 at 10:36
• Robin have you tried geograpiclib, which has code for geodesics on an ellipsoid?geographiclib.sourceforge.io/2009-03/geodesic.html Jul 3, 2019 at 10:37
• @HansErren this looks really promising, I will have a look thanks! Jul 3, 2019 at 10:49

``````    * C. F. F. Karney, Transverse Mercator with an accuracy of a few nanometers, J. Geodesy 85(8), 475–485 (Aug. 2011); preprint arXiv:1002.1417; addenda.