<?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: How to rotate a polyline on a given xy pivot point in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518874#M13309</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: MichaelMelaku&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Jerry. I'll have to try out ur suggested approach. Well, i tried to implement the ITransform2D interface which as per the documentation applies for ArcGIS Server. It is to transform features including rotate, scale and move and all. I couldn't find a neat example so far.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 May 2011 03:40:36 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2011-05-24T03:40:36Z</dc:date>
    <item>
      <title>How to rotate a polyline on a given xy pivot point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518873#M13308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jbarry&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Found this question on the &lt;/SPAN&gt;&lt;A href="http://www.facebook.com/ESRIDeveloperNetwork"&gt;EDN facebook&lt;/A&gt;&lt;SPAN&gt; page:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;A href="http://www.facebook.com/profile.php?id=652845514"&gt;Michael Melaku&lt;/A&gt;&lt;BR /&gt; Seriously???&amp;nbsp; Aiight, i'm hanging on a problem. In a Silverlight Application on&amp;nbsp; ArcGIS Server 10, I'm trying to rotate a polyline with a certain defined&amp;nbsp; angle over a defined vertex, xy. Anyone with a clue? Thanks a zillion.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe someone has some advice for Michael.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(Second, I'm not really into Silverlight yet, so I don't know if they've got some nifty coarse-grained geometry stuff one function call away, but if what you needed was some brute-force trig-based formula that I'm sure could be done client-side, see the attached text file.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]6777[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 23:47:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518873#M13308</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-05-23T23:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a polyline on a given xy pivot point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518874#M13309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: MichaelMelaku&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Jerry. I'll have to try out ur suggested approach. Well, i tried to implement the ITransform2D interface which as per the documentation applies for ArcGIS Server. It is to transform features including rotate, scale and move and all. I couldn't find a neat example so far.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 03:40:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518874#M13309</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-05-24T03:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a polyline on a given xy pivot point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518875#M13310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To avoid too much formula, you can also use a CompositeTransform:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
public static class GeometryExtension
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static Polyline Rotate(this Polyline polyline, double rotation, MapPoint fixPoint)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var transform = new CompositeTransform {Rotation = rotation, CenterX = fixPoint.X, CenterY = fixPoint.Y};
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var output = new Polyline();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach(var path in polyline.Paths)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pc = new ESRI.ArcGIS.Client.Geometry.PointCollection();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var mapPoint in path)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pc.Add(mapPoint.Transform(transform));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output.Paths.Add(pc);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return output;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static MapPoint Transform(this MapPoint mapPoint, Transform transform)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var point = transform.Transform(new System.Windows.Point(mapPoint.X, mapPoint.Y));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new MapPoint(point.X, point.Y);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you can rotate a polyline by code like : var result = myPolyline.Rotate(angle, fixPoint);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:38:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518875#M13310</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T22:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a polyline on a given xy pivot point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518876#M13311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jbarry&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;To avoid too much formula, you can also use a CompositeTransform:&lt;BR /&gt; Then you can rotate a polyline by code like : var result = myPolyline.Rotate(angle, fixPoint);&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;Thanks Dominique!!&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yeah, I figured there was probably an easier way than the raw math approach.&amp;nbsp;&amp;nbsp; Ok, I'm stepping out of the way now.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;Michael&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Glad to see you joined the forums here.&amp;nbsp; I hope you find them useful.&amp;nbsp; There are thousands of folks here from around the world who can help and thousands of posts here already you can search on.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 19:33:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518876#M13311</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-05-24T19:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a polyline on a given xy pivot point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518877#M13312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Barry, thanks Dominique&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I could rotate the polyline using the raw math algo i got from u, barry. Dominique snippet is quite neat so i will replace it. Problem continues thou. The polyline being rotated follows a certain buffer. So consider it like the pivot point for the rotation is the a point buffered at a radius exactly equal to the the length of the polyline. The funny part is that as it rotates, the tip of the polyline touches the buffer graphics at some points and falls inside the buffer at some points. I realized the buffered graphics is not a perfect circle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea? The last resort would be to have sort of a spegetti implementation having geometry service and finding the coordinate the elongated polyline touches the buffer graphics, take the new XY, redraw the polyline with the pivot point (x0, y0) to the new point (x1, y1).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Folks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2011 07:13:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518877#M13312</guid>
      <dc:creator>MichaelMelaku</dc:creator>
      <dc:date>2011-05-29T07:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to rotate a polyline on a given xy pivot point</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518878#M13313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jbarry&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks Barry, thanks Dominique&lt;BR /&gt;&lt;BR /&gt;I could rotate the polyline using the raw math algo i got from u, barry. Dominique snippet is quite neat so i will replace it. Problem continues thou. The polyline being rotated follows a certain buffer. So consider it like the pivot point for the rotation is the a point buffered at a radius exactly equal to the the length of the polyline. The funny part is that as it rotates, the tip of the polyline touches the buffer graphics at some points and falls inside the buffer at some points. I realized the buffered graphics is not a perfect circle.&lt;BR /&gt;&lt;BR /&gt;Any idea? The last resort would be to have sort of a spegetti implementation having geometry service and finding the coordinate the elongated polyline touches the buffer graphics, take the new XY, redraw the polyline with the pivot point (x0, y0) to the new point (x1, y1).&lt;BR /&gt;&lt;BR /&gt;Thanks Folks.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Michael.&amp;nbsp;&amp;nbsp; Hopefully it's just me, but I read your reply a few times and I'm struggling to visualize what you've described.&amp;nbsp; Once I think I'm getting it, the next sentence derails me.&amp;nbsp;&amp;nbsp;&amp;nbsp; Is this something you can draw as a mockup and include here?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 20:55:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-rotate-a-polyline-on-a-given-xy-pivot-point/m-p/518878#M13313</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-05-31T20:55:16Z</dc:date>
    </item>
  </channel>
</rss>

