6

I have polyline vertices in an Excel 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?

2

3 Answers 3

8

You will get the desired 87 degrees (almost a right angle, almost vertical) with a simple formula

=ATAN2(<current X>-<previous X>;<current Y>-<previous Y>)*180/PI()

Like as

=ATAN2(C14-C13;D14-D13)*180/PI()

3
8

Assuming that your columns in Excel are A, B etc, the X, Y, ANGLE_CHANGE columns are C, D, E respectively and the first data row is number 2.

To find the angle you could use this formula for E3:

=ATAN((Y3-Y2)/(X3-X2))*(180/PI())

Select the cell E3 and drag the small handle down over the columns below.

This uses the ATAN function that returns its result in radians, needing to be multiplied by 180/Pi to give degrees.

0
0

I built on @harrymc and @JohnSUN's answers.

This is what I came up with:

enter image description here

Related:

What densification method does SDE.ST_Geometry use to approximate arcs as segments?

Determine if line has true curves via SQL (SDE.ST_GEOMETRY in Oracle)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .