<?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 How to calculate position in a clockwise manner? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-calculate-position-in-a-clockwise-manner/m-p/1355747#M75776</link>
    <description>&lt;P&gt;I have data with X/Y data that plots and I'm trying to get it to look like so:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sort.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/87742i66EB92E1E120047A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sort.png" alt="Sort.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've tried near analysis, and it gets me close but doesn't label them in a clockwise manner. Is there any geoprocessing tool or arcpy process that I'm overlooking that will accomplish this?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2023 16:31:29 GMT</pubDate>
    <dc:creator>Davec43</dc:creator>
    <dc:date>2023-12-01T16:31:29Z</dc:date>
    <item>
      <title>How to calculate position in a clockwise manner?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-calculate-position-in-a-clockwise-manner/m-p/1355747#M75776</link>
      <description>&lt;P&gt;I have data with X/Y data that plots and I'm trying to get it to look like so:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sort.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/87742i66EB92E1E120047A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sort.png" alt="Sort.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've tried near analysis, and it gets me close but doesn't label them in a clockwise manner. Is there any geoprocessing tool or arcpy process that I'm overlooking that will accomplish this?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 16:31:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-calculate-position-in-a-clockwise-manner/m-p/1355747#M75776</guid>
      <dc:creator>Davec43</dc:creator>
      <dc:date>2023-12-01T16:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate position in a clockwise manner?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-calculate-position-in-a-clockwise-manner/m-p/1355805#M75781</link>
      <description>&lt;P&gt;You can write your own, but I doubt there's any general purpose tool for this.&lt;/P&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;atan2&lt;/FONT&gt; function takes dy &amp;amp; dx parameters, but that's counter-clockwise from 3-o'clock,&lt;BR /&gt;so you'd need to reverse the sign and rotate.&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 17:29:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-calculate-position-in-a-clockwise-manner/m-p/1355805#M75781</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2023-12-01T17:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate position in a clockwise manner?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-calculate-position-in-a-clockwise-manner/m-p/1355995#M75800</link>
      <description>&lt;P&gt;slow week&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aoi  # a square
array([[  0.00,   5.00],
       [  5.00,  10.00],
       [ 10.00,   5.00],
       [  5.00,   0.00],
       [  0.00,   5.00]])

def geom_angles(a, fromNorth=False):
    """Polyline/segment angles.

    Parameters
    ----------
    a : array-like
        A Geo array or a list of arrays representing the polyline shapes.
    """
    out = []
    dxy = a[1:] - a[:-1]
    ang = np.degrees(np.arctan2(dxy[:, 1], dxy[:, 0]))
    if fromNorth:
        ang = np.mod((450.0 - ang), 360.)
    return ang
    

geom_angles(aoi, fromNorth=False)  # -- option 1
array([ 45.00, -45.00, -135.00,  135.00])

geom_angles(aoi, fromNorth=True)  # -- option 2
array([ 45.00,  135.00,  225.00,  315.00])

cent = np.mean(aoi[:-1])  # -- now from the center of the points
vals = aoi - cent  # -- angles from the center

vals 
array([[ -5.00,   0.00],
       [  0.00,   5.00],
       [  5.00,   0.00],
       [  0.00,  -5.00],
       [ -5.00,   0.00]])

geom_angles(vals, fromNorth=False)
array([ 45.00, -45.00, -135.00,  135.00])

geom_angles(vals, fromNorth=True)
array([ 45.00,  135.00,  225.00,  315.00])&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 01 Dec 2023 21:32:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-calculate-position-in-a-clockwise-manner/m-p/1355995#M75800</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-12-01T21:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate position in a clockwise manner?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-calculate-position-in-a-clockwise-manner/m-p/1356229#M75832</link>
      <description>&lt;P&gt;Thanks Dan!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 11:30:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-calculate-position-in-a-clockwise-manner/m-p/1356229#M75832</guid>
      <dc:creator>Davec43</dc:creator>
      <dc:date>2023-12-04T11:30:39Z</dc:date>
    </item>
  </channel>
</rss>

