1

I have an arc described by three points: arc center, starting point, ending point.

In order to calculate intermediate points of the arc, I would normally use the parametrized equation.

x(t) = x(center) + radius * cos(a0 + a*t)

y(t) = y(center) + radius * sin(a0 + a*t)

being a = a1 - a0; a1 = ending angle; a0 = starting angle.

t goes from 0 (starting point) to 1 (ending point).

The problem is that my points are not described in a cartesian system (x,y), but using WSG84 (latitude and longitude).

How can I calculate intermediate points like this?

My first attempt was going from LLA to ECEF like explained here (using 0 as altitude).

Then I parametrized the arc in 3D space like explained here.

I had to calculate the three vectors and parametrized equation becomes (the same of the link but in C++ and just for an arc instead of the whole circumference:

tPoint.x = ecefCenter.x + radius * (v1.x * cos(angleStart + (angleEnd - angleStart)*t) + v2.x * sin(angleStart+ (angleEnd - angleStart)*t));
tPoint.y = ecefCenter.y + radius * (v1.y * cos(angleStart+ (angleEnd - angleStart)*t) + v2.y * sin(angleStart+ (angleEnd - angleStart)*t));
tPoint.z = ecefCenter.z + radius * (v1.z * cos(angleStart+ (angleEnd - angleStart)*t) + v2.z * sin(angleStart+ (angleEnd - angleStart)*t));

I calculate arc points with it and then come back ECEF to LL.

Results are not bad but there is some approximation in any of the steps, it is not exact.

The three original points:

9:03:34.012863:          Daniel testing, turn center latitude:
9:03:34.012926:          42.4292
9:03:34.012984:          Daniel testing, turn center longitude:
9:03:34.013016:          -6.91824
9:03:34.013062:          Daniel testing, start latitude of turn:
9:03:34.013092:          42.4422
9:03:34.013127:          Daniel testing, start longitude of turn:
9:03:34.013150:          -6.89639
9:03:34.013192:          Daniel testing, end latitude of turn:
9:03:34.013218:          42.45
9:03:34.013247:          Daniel testing, end longitude of turn:
9:03:34.013267:          -6.91908

Starting and ending point, as obtained from parametrization:

9:03:34.014212:          42.4422
9:03:34.014236:          -6.89639

9:03:34.016545:          42.4499
9:03:34.016570:          -6.91662

Here you can see the problem graphically.

1 Answer 1

0

You need to reproject to a local projection that is cartesian, make the calculations and then project back to WGS84.

4
  • Thank you for your comment. I tried that before doing it like explained here: microem.ru/files/2012/08/GPS.G1-X-00006.pdf (WGS84 to ECEF), using 0 as altitude. The problem becomes 3D but I was able to parametrize the arc like here: stackoverflow.com/questions/27714014/… , and then coming back ECEF to WGS84. In some point of the process, I am losing precision, so the end point calculated is some seconds different. Is there any more direct/exact way? Oct 27, 2017 at 8:03
  • 2
    can you add that to the question and may be some example points/parameters
    – Ian Turton
    Oct 27, 2017 at 8:04
  • Done, I didn't post it at first as so much information may look intimidatory. I have to add that I am not confident about the console log messages, first point looks exactly the same but maybe some decimals later it is not. Oct 27, 2017 at 8:34
  • The problem was not in the conversion but in the arc parametric equation, I corrected it, and now WGS84-->ECEF-->calculations-->WGS84 gives proper results. Nov 2, 2017 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.