1

I have two known points (A and B) on latitude / longitude coordinates. Certainly I know the distance between A and B in meters.

I have third point C with unknown coordinates, but I know the distance between AC and BC in meters.

Is it possible to get the lat/lon coordinates of point C with math formula?


Here is an example:

The all known distances between coordinate points are:

AB = 120.9234 meters AC = 226.7206 meters BC = 213.1376 meters

The known coordinates of A and B point:

A lat = 47.49784; A lon = 19.08939;

B lat = 47.49893; B lon = 19.08941;

and I calculated all angles of triangle in deg: B: 80.341932306607 A: 31.722055823679 C: 67.936011869714

and I measured the result what I looking for in map: Lat: 47.498575374822 Lon: 19.09129858017

but I like to use a math formula to get these two coordinates of point C using the upper input values.

5
  • On a plane or on a sphere or on an ellipsoid? Commented Jul 21, 2017 at 12:01
  • The formula can be work on a plane because the distances are very low, 10-100 meters only. I just don't want to change the coordinate system for the math formula if it is possible, and I want to get the result in lat/lon. Commented Jul 21, 2017 at 12:10
  • Sorry, I modified vanishing point to vertex on the title. Commented Jul 21, 2017 at 13:01
  • So you know all the distances? (AB, AC, BC) Commented Jul 21, 2017 at 14:03
  • Yes. I know all distances between all 3 points in meters. And not just distances, I know all angles in degree or radian if required. I just want to know the coordinates of third point. Commented Jul 21, 2017 at 14:08

3 Answers 3

1

Assuming you know AB, AC, and BC, then the answer is yes. It requires trigonometry. The following assumes a flat plane and that points A anb B are not on the same line of latitude or longitude. To get the lat/long of C you need to figure out the ΔX and ΔY from a known point (let's use A).

You're going to need the value of the angle θ, which is 90-a-λ

Let ΔXB and ΔYB be the lat/long difference from A to B (both of which have known coordinates). From basic trigonometry we know that sin(λ) = ΔYB/AB. Therefore λ = arcsin(ΔYB/AB).

By the Law of Cosines cos(a) = (AB²+AC²-BC²)/(2*AB*AC), which means a = arccos((AB²+AC²-BC²)/(2×AB×AC))

Therefore θ = 90 - arccos((AB²+AC²-BC²)/(2×AB×AC)) - arcsin(ΔYB/AB)

With θ calculated, we're back to basic trigonometry again: sin(θ)= ΔX/AC and cos(θ) = ΔY/AC. Therefore ΔX = sin(θ)×AC and ΔY = cos(θ)×AC. Just add those values to the coordinates of A, and you have your answer.

enter image description here

TLDR version:

  • C(x) = A(x) + AC × sin(90 - arccos((AB²+AC²-BC²)/(2×AB×AC)) - arcsin((A(y)-B(y))/AB))
  • C(y) = A(y) + AC × cos(90 - arccos((AB²+AC²-BC²)/(2×AB×AC)) - arcsin((A(y)-B(y))/AB))
1
  • I implemented this formula, and the result is close to the measured values but not exactly same. Commented Jul 21, 2017 at 16:15
0

I trying the formula, and the result is close to the answer, but something wrong.

I have coordinates of A and B points:

        $Ax = 47.497846896196;
        $Ay = 19.089394211769;

        $Bx = 47.498934174013;
        $By = 19.089415669441;

x is latitude, y is longitude.

The distance between A and B is

        120.9047 meters

This is counted by simple formula. If I use MySQL GLength(), I got another values, but I think the trigonometry formula is good too.

Counting:

        $DxAB = ($Ax - $Bx); = -0.0010872778169997
        $DyAB = ($Ay - $By); = -2.1457671998348E-5

        $Lambda = asin($DyAB / $AB); = -1.774759128334E-7

        $aAngle = acos((pow($AB, 2) + pow($AC, 2) - pow($BC, 2)) / (2 * ($AC * $AB))); = 1.0422581825838

        $Theta = deg2rad(90 - rad2deg($aAngle) - rad2deg($Lambda)); = 0.52853832168699

        $DX = asin($Theta); = 0.55687780990758
        $DY = acos($Theta); = 1.0139185168873

        $Cx = $DX + $Ax; = 48.054724706104
        $Cy = $DY + $Ay; = 20.103312728656

but the result we measured is:

        47.498575374822 and 19.09129858017

While I have 2 different list of distances between points (counted by trigonometry and by database GLength()) the output of formulas are not exactly same as we measured:

Distances between input coords by trigonometry:

        $AB = 120.9047;
        $AC = 164.3976;
        $BC = 146.9635;

distances between (same) coords by database handler:

        $AB = 120.9234;
        $AC = 226.7206;
        $BC = 213.1376;

I understand why we can got different distances.

The result of this formula if using database handler's distances as input:

        $Cx = $DX + $Ax; = 47.893151605351
        $Cy = $DY + $Ay; = 20.264885829409

This result is closer than the previous one, but not valid. Maybe something wrong in my side?

6
  • I think I screwed up. sin(θ)=ΔX/AC , therefore ΔX = AC×sin(θ) I'll go fix that now. Commented Jul 21, 2017 at 17:50
  • One more thing maybe help to found the problem. The "real" difference between the lat/lon coordinates of point A and point C is 0.00072847862600156 and 0.0019043684010001. But the difference using the formula is 0.3953047091551 and 1.1754916176398 Commented Jul 21, 2017 at 18:32
  • The answer is always 2 points
    – FelixIP
    Commented Jul 21, 2017 at 18:41
  • Maybe the error is getting introduced with the conversions back and forth to and from radians? Try running the whole thing using only degrees or using only radians. Commented Jul 21, 2017 at 18:52
  • I removed the conversion from the formula $Theta = ((M_PI / 2) - ($aAngle) - ($Lambda)); but the result is exactly same than before. Commented Jul 21, 2017 at 19:05
0

I cancelled latitude and longitude coordinates as inputs, and I would like to solve a simple example with any unit.

Image with result what I want to get

I have all inputs on the image, but no Cx and Cy. What is the best method to get these data as accurate result? I tried to implement formulas to programming language, but not always returned acceptable result. I have non 90 degree, non equilateral triangles only.

thanks!

1
  • You need the acute angle between either AC or BC and the x-axis. Then you can use basic trigonometry to figure out the ΔX and ΔY with regards to either B or A. I'm not sure where the error is in the formulas I wrote out above, but it should work once the errors are removed. Another option is to use the intersection of 2 circles method described here: math.stackexchange.com/questions/256100/… Commented Jul 24, 2017 at 14:01

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.