<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Determine the angle between two intersecting lines - Counter-Clockwise direction in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/determine-the-angle-between-two-intersecting-lines/m-p/735247#M5007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response Dan, &lt;/P&gt;&lt;P&gt;I have added points on the image to show where the start- or end-points are. The start- and end-points correspond with where the line feature touches the boundary of the polygon circle. However, in the data, the start- and end-points do not follow a particular pattern or direction. &lt;/P&gt;&lt;P&gt;For my purposes, it doesn't matter if I am comparing a start-point of line1 to an end-point of line2. All that matters is that the point of line1 is being compared to the point of line2 that is first encountered going counter-clockwise around the circle's perimeter.&lt;/P&gt;&lt;P&gt;In the Picture in my edited post I would want to compare the two points with the arrow drawn between them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Aug 2016 18:08:16 GMT</pubDate>
    <dc:creator>JoeD</dc:creator>
    <dc:date>2016-08-02T18:08:16Z</dc:date>
    <item>
      <title>Determine the angle between two intersecting lines - Counter-Clockwise direction</title>
      <link>https://community.esri.com/t5/developers-questions/determine-the-angle-between-two-intersecting-lines/m-p/735244#M5004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everyone:&lt;/P&gt;&lt;P&gt;I am trying to determine the angle between two intersecting lines. However, I need the angle to be from the start point of line1 to the start- or end-point of line2 - whichever is the next point going in a counter-clockwise direction around the circle's perimeter (see diagram at bottom of question).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My steps so far have been:&lt;/P&gt;&lt;P&gt;1) I found the intersection points and saved them to a point file&lt;/P&gt;&lt;P&gt;2) I created a 10cm buffer around the points (0.1 metres)&lt;/P&gt;&lt;P&gt;3) I clipped line1 and line2 to the buffer&lt;/P&gt;&lt;P&gt;4) I calculated the start- and end-points of line1 and line2 as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor("line", ('X0a','Y0a','X1a','Y1a', "SHAPE@")) as cursor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = row[4].firstPoint.X&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = row[4].firstPoint.Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[2] = row[4].lastPoint.X&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[3] = row[4].lastPoint.Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/P&gt;&lt;P&gt;5) I created separate fields and calculated their values as:&lt;/P&gt;&lt;P style="margin-bottom: 1em; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dx = !X1a!-!X0a!&lt;/P&gt;&lt;P style="margin-bottom: 1em; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dy = !Y1a!-!Y0a!&lt;/P&gt;&lt;P style="margin-bottom: 1em; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dxa= !X1b!-!X0b!&lt;/P&gt;&lt;P style="margin-bottom: 1em; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dya= !Y1b!-!Y0b!&lt;/P&gt;&lt;P style="margin-bottom: 1em; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r = math.sqrt(math.pow(!dx!, 2) + math.pow(!dy!, 2))&lt;/P&gt;&lt;P style="margin-bottom: 1em; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ra = math.sqrt(math.pow(!dxa!, 2) + math.pow(!dya!, 2))&lt;/P&gt;&lt;P style="margin-bottom: 1em; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c = math.asin(abs((dx&lt;EM&gt;dya - dy&lt;/EM&gt;dxa))/(r*ra)) / math.pi * 180&lt;/P&gt;&lt;P style="margin-bottom: 1em; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;c is the angle between the points, however, it is not always the angle I need. I need the angle from a point on line1 to the nearest point on line2 going counter-clockwise around the circle's perimeter.&lt;/P&gt;&lt;P style="margin-bottom: 1em; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;There is probably a really easy&amp;nbsp; solution for this, but, I just haven't been able to figure it out. Any help is greatly appreciated.&lt;/P&gt;&lt;P style="margin-bottom: 1em; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;I am using ArcGIS 10.2.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/214280_Capture.JPG" style="width: 620px; height: 462px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 16:33:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/determine-the-angle-between-two-intersecting-lines/m-p/735244#M5004</guid>
      <dc:creator>JoeD</dc:creator>
      <dc:date>2016-08-02T16:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the angle between two intersecting lines - Counter-Clockwise direction</title>
      <link>https://community.esri.com/t5/developers-questions/determine-the-angle-between-two-intersecting-lines/m-p/735245#M5005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forgive me for not wanting to dive back into the tedium of this math, but perhaps you can use something from this thread: &lt;A href="https://community.esri.com/thread/171158"&gt;Calculating angles using ArcGIS Desktop 10.2 &lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 16:48:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/determine-the-angle-between-two-intersecting-lines/m-p/735245#M5005</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-08-02T16:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the angle between two intersecting lines - Counter-Clockwise direction</title>
      <link>https://community.esri.com/t5/developers-questions/determine-the-angle-between-two-intersecting-lines/m-p/735246#M5006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a few points on the image or directional arrows to we know where start and end points are&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 16:48:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/determine-the-angle-between-two-intersecting-lines/m-p/735246#M5006</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-08-02T16:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the angle between two intersecting lines - Counter-Clockwise direction</title>
      <link>https://community.esri.com/t5/developers-questions/determine-the-angle-between-two-intersecting-lines/m-p/735247#M5007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response Dan, &lt;/P&gt;&lt;P&gt;I have added points on the image to show where the start- or end-points are. The start- and end-points correspond with where the line feature touches the boundary of the polygon circle. However, in the data, the start- and end-points do not follow a particular pattern or direction. &lt;/P&gt;&lt;P&gt;For my purposes, it doesn't matter if I am comparing a start-point of line1 to an end-point of line2. All that matters is that the point of line1 is being compared to the point of line2 that is first encountered going counter-clockwise around the circle's perimeter.&lt;/P&gt;&lt;P&gt;In the Picture in my edited post I would want to compare the two points with the arrow drawn between them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 18:08:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/determine-the-angle-between-two-intersecting-lines/m-p/735247#M5007</guid>
      <dc:creator>JoeD</dc:creator>
      <dc:date>2016-08-02T18:08:16Z</dc:date>
    </item>
  </channel>
</rss>

