Coordinate of ends of a irregular polygon

210 Views Asked by At

I have a list of line lengths and angles, but only the angles between line $n$ and $n-1$, and I can't find a single expression to get the coordinate that works for all cases.

I tried $ \sum{\sqrt{\frac{L^2 -c^2}{\tan(\sum{\theta})^2+1}}} $ and similar expressions but they all assume triangles can be constructed for each out of straight line functions, which is not the case, any help is appreciated.

1

There are 1 best solutions below

2
On BEST ANSWER

In the diagram below, $A$, $B$ and $C$ are three consecutive vertices of your polygonal. Suppose you know angles $\theta_A$ (made by line $AB$ with the $x$ axis) and $\varphi_B$ (angle between $AB$ and $BC$), as well as the coordinates of $A$ and $B$ and the length $L_{BC}$ of ${BC}$. The angle $BC$ forms with the $x$ axis is $\theta_B=\varphi_B+\theta_A-\pi$ and the coordinates of $C$ can thus be found from $$ x_C=x_B+L_{BC}\cos\theta_B,\quad y_C=y_B+L_{BC}\sin\theta_B. $$ You can then recursively compute the coordinates of all vertices, given the coordinates of the first two.

enter image description here