<?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: Converting projected coordinates to polar coordinates in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Converting-projected-coordinates-to-polar-coordinates/m-p/345843#M12022</link>
    <description>&lt;P&gt;I believe the centroid macro returns x/y centroids in whatever the units the x/y were in the original map.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some of the SAS maps have long &amp;amp; lat variables, in addition to the x &amp;amp; y variables, that you would need to make use of ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the old traditional maps (in the maps library), such as maps.states, the x/y are projected values, and would not be much use to you. If you pre-process this map, and replace the projected x/y with the long/lat variables (which are in radians), then the centroid macro will return x/y in radians, and you could use the tip in the previous comment to convert to degrees.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the new GfK maps (in the mapsgfk library), such as mapsgfk.us_states, the x/y are also projected values, and would not be much use to you either. If you pre-process this map, and replace the projected x/y with the long/lat variables (which are in degrees), then the centroid macro will return x/y in degrees.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2017 17:20:07 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2017-03-30T17:20:07Z</dc:date>
    <item>
      <title>Converting projected coordinates to polar coordinates</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Converting-projected-coordinates-to-polar-coordinates/m-p/343294#M11898</link>
      <description>&lt;P&gt;Hi ,&lt;BR /&gt;I have a small query related to the output of %centroid macro. I need to know the units of the X-Y output from %centroid. Actually I want latitude &amp;amp; longitude of the centroid. For those reasons, I need to convert X-Y coordinates to polar coordinates. Do you have any idea how can I convert output form %centroid macro to polar coordinates?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 14:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Converting-projected-coordinates-to-polar-coordinates/m-p/343294#M11898</guid>
      <dc:creator>Kishore_Kumar</dc:creator>
      <dc:date>2017-03-22T14:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Converting projected coordinates to polar coordinates</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Converting-projected-coordinates-to-polar-coordinates/m-p/343963#M11939</link>
      <description>&lt;P&gt;the conversion from cartesian to polar coordinate systems is an easy trig problem for SAS.&amp;nbsp; I am not sure this is what you want, because i am not sure what %CENTROID produces, but the following will convert back and forth.&amp;nbsp; Remember SAS uses radians as the measure of the angle so you may need to convert from degrees if you start at polar coords.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x y;
datalines;
12 5
5 12
run;
data wantpolar;
   set have;
   r = sqrt(x**2 +y**2);
   alpha=atan(y/x); /* angle in radians */
   degrees = alpha*(180/constant('pi')); /* radians to degrees */
   * Polar to cartesian;
   x1 = r*cos(alpha);
   y1 = r*sin(alpha);
   run;
proc print data=wantpolar;
   run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Mar 2017 06:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Converting-projected-coordinates-to-polar-coordinates/m-p/343963#M11939</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2017-03-24T06:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Converting projected coordinates to polar coordinates</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Converting-projected-coordinates-to-polar-coordinates/m-p/345843#M12022</link>
      <description>&lt;P&gt;I believe the centroid macro returns x/y centroids in whatever the units the x/y were in the original map.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some of the SAS maps have long &amp;amp; lat variables, in addition to the x &amp;amp; y variables, that you would need to make use of ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the old traditional maps (in the maps library), such as maps.states, the x/y are projected values, and would not be much use to you. If you pre-process this map, and replace the projected x/y with the long/lat variables (which are in radians), then the centroid macro will return x/y in radians, and you could use the tip in the previous comment to convert to degrees.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the new GfK maps (in the mapsgfk library), such as mapsgfk.us_states, the x/y are also projected values, and would not be much use to you either. If you pre-process this map, and replace the projected x/y with the long/lat variables (which are in degrees), then the centroid macro will return x/y in degrees.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 17:20:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Converting-projected-coordinates-to-polar-coordinates/m-p/345843#M12022</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2017-03-30T17:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Converting projected coordinates to polar coordinates</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Converting-projected-coordinates-to-polar-coordinates/m-p/346431#M12033</link>
      <description>Thanks everyone for replying back. The answers were really helpful. Thanks</description>
      <pubDate>Sat, 01 Apr 2017 20:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Converting-projected-coordinates-to-polar-coordinates/m-p/346431#M12033</guid>
      <dc:creator>Kishore_Kumar</dc:creator>
      <dc:date>2017-04-01T20:05:27Z</dc:date>
    </item>
  </channel>
</rss>

