Given the line between points 1 and 2, what is the change in angle to point 3?

41 Views Asked by At

I have polylines in an database table.

enter image description here

  ASSET_ID VERTEX_NUM          X          Y ANGLE_CHANGE
---------- ---------- ---------- ---------- ------------
        10          1     118.56        3.8         null
        10          2     118.62       1.03         null
        10          3     121.93       1.03            ?

        20          1     123.59       1.19         null
        20          2     124.21       1.02         null
        20          3     124.85        .96            ?
        20          4     125.49       1.01            ?
        20          5     126.11       1.16            ?
        20          6      126.7       1.41            ?
        20          7     127.24       1.75            ?
        20          8     127.26       2.16            ? --I chose to put this point in the screenshot just because the change in angle is large. So it was easy to illustrate what I'm looking for (lots of room for markup).
        20          9     127.36       2.56            ?
        20         10     127.52       2.94            ?
        20         11     127.75       3.29            ?
        20         12     128.03       3.59            ?

        30          1     129.84       1.26         null
        30          2     133.26       2.88         null

I want to determine what the "change in angle" is from point to point.

In other words, given a line between points 1 and 2, how can I calculate the change in angle to point 3?


Here's the sample data in a publicly available database, for anyone who's interested. You can scroll to the bottom of the page and hit the ellipses to see the full table.

1

There are 1 best solutions below

0
On

The change in angle (in degrees) at point $i$ is

$ \Delta \theta_i = \dfrac{180^\circ}{\pi} \left( \tan^{-1} \dfrac{ y_{i+1} - y_i}{x_{i+1} - x_i } - \tan^{-1} \dfrac{ y_i - y_{i-1} } { x_i - x_{i-1} } \right)$