<?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: Strange behaviour with CIMPointSymbol.AddAngle() in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behaviour-with-cimpointsymbol-addangle/m-p/818074#M2686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This question has been resolved.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Both ship icon and polyline had correct orientation but had a projection missmatch ... stupid mistake, I'm sorry. Once I transformed polyline to matching projection and then rotated it, both lined up correctly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jul 2019 11:56:38 GMT</pubDate>
    <dc:creator>RichardReinicke</dc:creator>
    <dc:date>2019-07-12T11:56:38Z</dc:date>
    <item>
      <title>Strange behaviour with CIMPointSymbol.AddAngle()</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behaviour-with-cimpointsymbol-addangle/m-p/818073#M2685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I`m currently experiencing a strange behaviour with the SDK version 2.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I need to describe shortly what I'm trying to to. Inside my application I have a GPS position of a ship marked with an CIMPointSymbol inside the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;CIMCharacterMarker marker &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SymbolFactory&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Instance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ConstructMarker&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
    &lt;SPAN class="number token"&gt;66&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
    &lt;SPAN class="string token"&gt;"Schiff_real"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
    &lt;SPAN class="string token"&gt;"Regular"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
    _config&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ShipIconSize&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
    ColorFactory&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Instance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;BlackRGB&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; CIMCharacterMarker&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
marker&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ScaleSymbolsProportionally &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; SymbolFactory&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Instance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ConstructPointSymbol&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;marker&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Later in the application I'm rotating the symbol based on the ships movement direction which is also aquired from gps information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;_gpsPositionSymbol&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetAngle&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;targetCourseAngle&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where targetCourseAngle is the negative value of true heading. Of course I checked the provided value is okay and GetAngle gives correct value back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This first seemed to work fine in application but now I was adding a second feature to the app, showing the current ship heading as a short helper line in front of the ship icon. The polyline is created by two points where target point is calculated by distance and direction from current ship position&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; Polyline &lt;SPAN class="token function"&gt;CreatePolyline&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MapPoint startPoint&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt; direction&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt; distance&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;// First convert line of sight direction (heading) into angle from positive x axis to positive y axis&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt; theta &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;360&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; direction &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;90&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;// Calculate target point by direction and distance&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt; new_x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; startPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; distance &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; Math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Cos&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;theta &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; Math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PI &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;180&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt; new_y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; startPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; distance &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; Math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Sin&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;theta &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; Math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PI &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;180&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;// Construct target map point with input crs if available&lt;/SPAN&gt;
    MapPoint targetPoint &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MapPoint&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;MapPointBuilder&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateMapPoint&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;new_x&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; new_y&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;startPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;?&lt;/SPAN&gt; startPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; PolylineBuilder&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreatePolyline&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;List&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;MapPoint&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; startPoint&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; targetPoint &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; startPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting Polyline also seems to be correct, the displayed angle looks good! I also double checked the calculation by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; angle &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Atan2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;new_y &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; startPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; new_x &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; startPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;180&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; Math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PI&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with angle being positive degrees from positive x axis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if I display both symbol and heading line in the map, I have a slight shift in the directions. Symbol orientations and line direction are identical at full main directions 0°, 90°, 180°, 270° but diverge towards the middle of each quadrant. Please see the resulting effects in the attached images from east over south east to south.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't see any mistake in my code and the divergence really only occures in the middle of each quadrant.&lt;BR /&gt;&lt;BR /&gt;Can someone reproduce this behaviour or help me out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:40:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behaviour-with-cimpointsymbol-addangle/m-p/818073#M2685</guid>
      <dc:creator>RichardReinicke</dc:creator>
      <dc:date>2021-12-12T09:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behaviour with CIMPointSymbol.AddAngle()</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behaviour-with-cimpointsymbol-addangle/m-p/818074#M2686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This question has been resolved.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Both ship icon and polyline had correct orientation but had a projection missmatch ... stupid mistake, I'm sorry. Once I transformed polyline to matching projection and then rotated it, both lined up correctly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jul 2019 11:56:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/strange-behaviour-with-cimpointsymbol-addangle/m-p/818074#M2686</guid>
      <dc:creator>RichardReinicke</dc:creator>
      <dc:date>2019-07-12T11:56:38Z</dc:date>
    </item>
  </channel>
</rss>

