<?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 Rotate, Scale Geometry Programmatically in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/rotate-scale-geometry-programmatically/m-p/663393#M3400</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to implement a way to rotate/scale a polygon graphic on the MapView and SceneView. I couldn't fine a way using the API to apply these transformations to the geometries so I have tried different approaches, all of them involve modifying the vertices to calculate the position of each vertex after the transformation in order to obtain the new geometry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My first implementation uses the WPF RotateTransform/ScaleTransform class to transform each individual point using a specific angle and the center of the polygon as the CenterX, CenterY of the transformations. The rotate method receives all the points in screen coordinates, so I have to convert the MapPoints using the&amp;nbsp;LocationToScreen method and after getting the result I convert back to MapPoint using the ScreenToLocation(MapView) and ScreenToBaseSurface (SceneView).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the second implementation I don't use the WPF Transform class, instead I use&amp;nbsp; &lt;A href="https://stackoverflow.com/questions/13695317/rotate-a-point-around-another-point"&gt;trigonometry &lt;/A&gt;to get the position of each point after the rotation using the center of the polygon as anchor point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both approaches&amp;nbsp;seems&amp;nbsp;to rotate the polygon, however, it isn't working fine. The position of the polygon changes, the center should stay in the same place. The geometry gets deformed after a few rotations.&lt;/P&gt;&lt;P&gt;Any help will be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2018 19:27:10 GMT</pubDate>
    <dc:creator>ArnelLedo</dc:creator>
    <dc:date>2018-10-03T19:27:10Z</dc:date>
    <item>
      <title>Rotate, Scale Geometry Programmatically</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/rotate-scale-geometry-programmatically/m-p/663393#M3400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to implement a way to rotate/scale a polygon graphic on the MapView and SceneView. I couldn't fine a way using the API to apply these transformations to the geometries so I have tried different approaches, all of them involve modifying the vertices to calculate the position of each vertex after the transformation in order to obtain the new geometry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My first implementation uses the WPF RotateTransform/ScaleTransform class to transform each individual point using a specific angle and the center of the polygon as the CenterX, CenterY of the transformations. The rotate method receives all the points in screen coordinates, so I have to convert the MapPoints using the&amp;nbsp;LocationToScreen method and after getting the result I convert back to MapPoint using the ScreenToLocation(MapView) and ScreenToBaseSurface (SceneView).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the second implementation I don't use the WPF Transform class, instead I use&amp;nbsp; &lt;A href="https://stackoverflow.com/questions/13695317/rotate-a-point-around-another-point"&gt;trigonometry &lt;/A&gt;to get the position of each point after the rotation using the center of the polygon as anchor point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both approaches&amp;nbsp;seems&amp;nbsp;to rotate the polygon, however, it isn't working fine. The position of the polygon changes, the center should stay in the same place. The geometry gets deformed after a few rotations.&lt;/P&gt;&lt;P&gt;Any help will be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2018 19:27:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/rotate-scale-geometry-programmatically/m-p/663393#M3400</guid>
      <dc:creator>ArnelLedo</dc:creator>
      <dc:date>2018-10-03T19:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate, Scale Geometry Programmatically</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/rotate-scale-geometry-programmatically/m-p/663394#M3401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got this working fine. The main issue was that I was applying the transformations to screen coordinates instead of transforming the real map point (LatLong). After that both approaches worked fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 14:34:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/rotate-scale-geometry-programmatically/m-p/663394#M3401</guid>
      <dc:creator>ArnelLedo</dc:creator>
      <dc:date>2018-10-16T14:34:50Z</dc:date>
    </item>
  </channel>
</rss>

