# Determining XY coordinates from quadrilateral measurements

• bstones
In summary, the conversation discusses the method of trilateration for determining the XY coordinates of 3 corner points of a quadrilateral shape based on known lengths of the sides of that shape. The lengths of all 4 sides of the shape and both cross lengths are provided. The conversation also mentions the use of statistical techniques for solving this type of problem and the importance of considering uncertainties when using this method. The conversation ends with a proposed calculation method using the angle formulas for triangles.

#### bstones

I'm trying to determine the XY coordinates of 3 corner points of a quadrilateral shape based on known lengths of the sides of that shape. I know the lengths of all 4 sides of the shape as well as the lengths of both cross lengths (effectively making two adjacent triangles). I've attached a picture to indicate the lengths of the triangles / quadrilateral shape as well as the corner of the shape that would serve as the origin of the system. I would like to find the coordinates of the 3 other corners of the shape in respect to the known XY coordinates of the origin. Any assistance would be greatly appreciated.

#### Attachments

• Photo Aug 31, 12 15 00 AM.jpg
15.4 KB · Views: 502
Welcome to PF;
Lets label the corners clockwise, starting from the origin, O P Q R so we can talk about them.

Point O is easy: O=(0,0) ;)

Draw the x-axis along one side ... say you pick OR ... you know |OR| = C so point R will be (C,0)

That was easy ... the way to get the rest is with the triangles - for instance, if you knew θ = ∠QOR then you could find Q = (Ecosθ, Esinθ).

Since you know all three sides of that triangle, you can use the cosine rule to find θ.
Repeat for ∠PRO.

Last edited:
Surely if you got a bunch of rods with the lengths given, you would rebuild the shape in only one way?

It is over-determined but it can be solved directly from a subset of the information.
The main problem is that the axis choice is underspecified. You also need to know the orientation of the axis wrt the figure.

Where is the need for a statistical method?
(Trilateration is for measuring with error - the uncertainties here are between 0.3% and 0.1% over 2-4m so maybe the 5mm uncertainty is important?)

No trilateration is not for measuring error. It cannot measure error.

It is a valid positioning system or method of solving a triangle, from whence its name.
Knowledge of the lengths of all three sides completely determine any triangle.
However, very often, redundant observations are taken to improve acuracy.

No trilateration is not for measuring error.
Never said it was.
It cannot measure error.
Never said it could. ;)

The measurements are given to the nearest cm - uncertainties are not specified (we don't know how accurate the measurements are[*]) so guess about 0.5cm[**] uncertainties.
That does seem a tad large ... but still of the order of 1:100. It may be easier just to remeasure to the nearest mm if more accuracy is needed.

We'll have to get feedback to see how important the uncertainties are to this particular problem.

It remains that it is possible to find the coordinates of the points directly from the measurements. If uncertainties are somewhat important, then they can be found from the undergrad rules of thumb.

I wonder how much extra accuracy you'd gain - there are three measurements associated with each point.

------------------------

[*] maybe the measurements were taken with a laser rangefinder between built-in reference studs: it just happened to come to whole cms to nanometer accuracy and OP did not feel the need to put in all the trailing zeros. Unlikely admittedly...
[**] over-estimate: it suggests that we think that 32% of repeat measurements would differ from this one by more than 5mm or something.

Trilateration is for measuring with error

OK, I read this too quickly, but it is still incorrect.

The set of measurements is still overdetermined.

You can use trilateration for measurement without regard to error and still solve the triangles when you have measured all three sides.

Further as you point out we don't know the conditions of measurement of these distances since they could be slant measurements. The OP certainly doesn't mention that they are all in the plane of the XY axes.

Studiot said:
OK, I read this too quickly, but it is still incorrect.

The set of measurements is still overdetermined.
Never said it wasn't.
You can use trilateration for measurement without regard to error and still solve the triangles when you have measured all three sides.
OK - the paper you reference stresses the error thing. If you do it without error, doesn't it reduce to triangulation?
Further as you point out we don't know the conditions of measurement of these distances since they could be slant measurements. The OP certainly doesn't mention that they are all in the plane of the XY axes.
Considering the context, not too unreasonable an assumption (all measurements in the same plane). Real life is messy. Shall wee see what OP says?

Triangulation is the solution of triangles using the angles and at least one measured length.

Trilateration is the solution using measured lengths only (no angles).
In navigation it is often called the 'rho-rho method' or range-range method.

Until the advent of modern EDM, triangulation was the method of choice and was more accurate than trilateration.

I remember writing Fortran programs in the 1970s for both methods, and their statistical adjustment when overdetermined.

Sorry all and thank you much for the help.

D is the Y axis with C (roughly) being the X axis.

0.5cm accuracy should be acceptable.

In that case, O=(0,0) and P=(0,D) right off - you only need to fine the other two.

You can use angles θ=∠OPR and λ=∠POQ
You know all the sides of those triangles: so draw them out separately - how to continue should be clear.
eg. R=(Fsinθ,Fcosθ)

If uncertainties in the measurements are important, you'll need to do something to take them into account.
Whenever you use an uncertainty in a calculation - the uncertainty changes.

Just calculate the angles of triangles using the angle formulas given here:
http://en.wikipedia.org/wiki/Triangle#Sine.2C_cosine_and_tangent_rules

From there, it should fall into place...

angle1:acos((e^2+c^2-b^2)/(2*e*c));
angle2:acos((f^2+c^2-d^2)/(2*f*c));

cornerABx:cos(angle1)*e;
cornerABy:sin(angle1)*e;