Okay, so I for some reason am just drawing a blank on this. I’m trying to come up with a coordinate for a point, based on information that I know. I’ll try to diagram it:
a
___________________________
| |
| AB AD |
| |
b| | d
| |
| |
| BC CD |
|___________________________|
c
Alright, so what I will know in each of these instances is the bearing of each of the sides of the polygon (a, b, c, d) and so also the angle at each corner (AB, BC, CD, AD). I also will know the XY coordinates for one of the corners, and the lengths of the two sides opposite the known corner. What I need to find is the coordinates of the corner opposite of the known corner’s position.
For example, if I know the position of AB, I will also know the lengths of sides c and d, and the bearings of all four sides. I need to calculate the XY position of CD.
My brain tells me this should be relatively trivial, but then craps out as I try to think my way through it for some reason.
What kind of answer are you looking for? For instance, you could do something like use trigonometry (the Law of Cosines/Sines) to calculate the length of one of the other two sides, say b. Then, starting from your known point AB, you go for a known distance at a known bearing to get to BC, and then similarly to get to CD from BC.
Taking the x axis as reference, a bearing θ corresponds to the direction of the unit vector (cos θ, sin θ). To get from the point AB with coordinates (x[sub]0[/sub], y[sub]0[/sub]) to AD, you have to add the vector a*(cos θ[sub]a[/sub], sin θ[sub]a[/sub]), so the position of AD is (x[sub]0[/sub] + acos θ[sub]a[/sub], y[sub]0[/sub] + asin θ[sub]a[/sub]).
Don’t start with the point whose coordinates you know. Start with the point between the two sides you know, and determine all of the points relative to that one. Once you find the coordinates of the known point relative to that one, you’ll be able to solve all of them absolutely.
If I assume arbitrary coordinates for the target point, then project to the two other corners, I can then intersect to reach the known position, then simply shift my coordinates to match the known values.