<?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: Polar acting wierd in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5500084#M143965</link>
    <description>&lt;P&gt;The (polar) function uses its 'ang' argument [to quote Help about it] "...in radians &lt;EM&gt;relative to the world &lt;SPAN class="__Override"&gt;X&lt;/SPAN&gt; axis&lt;/EM&gt;. Angles increase in the &lt;EM&gt;counterclockwise&lt;/EM&gt; direction, independent of the current construction plane."&amp;nbsp; You appear to be going for angles measured &lt;EM&gt;clockwise&lt;/EM&gt;, and from 0 as being &lt;EM&gt;upward&lt;/EM&gt;, but in (polar)'s terms, that's 90 degrees.&amp;nbsp; Try:&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;(setq endangp (* PI (/ &lt;STRONG&gt;(- 90.0 endang)&lt;/STRONG&gt; 180.0))); endang in WCS radians&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;</description>
    <pubDate>Mon, 09 Feb 2015 14:19:13 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2015-02-09T14:19:13Z</dc:date>
    <item>
      <title>Polar acting wierd</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499106#M143959</link>
      <description>&lt;P&gt;Ok, I'm not sure what is going on here but in my program using polar anything over 45 deg polar starts to go backwards. &amp;nbsp;For example if 60 deg is entered it gives me and angle at 30 deg. &amp;nbsp;Yet in a test I made in the same program it works fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the section of my program that im talking about:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(setq pltinrad (+ tankdiam 8))&lt;BR /&gt;(setq pltoutrad (+ tankdiam (+ 8 (nth rn RSPDEPTH))))&lt;BR /&gt;(setvar 'clayer "Radial Trim1")&lt;BR /&gt;(command "CIRCLE" TANKCTR pltinrad)&lt;BR /&gt;(setvar 'clayer "Radial Trim2")&lt;BR /&gt;(command "CIRCLE" TANKCTR pltoutrad)&lt;BR /&gt;(setq lninpt1 (list TANKTOCXXL (+ TANKTOCYL pltinrad)))&lt;BR /&gt;(setq lnoutpt1 (list TANKTOCXXL (+ TANKTOCYL pltoutrad)))&lt;BR /&gt;(setvar 'clayer "Radial Trim3")&lt;BR /&gt;(command "line" lninpt1 lnoutpt1 "")&lt;BR /&gt;(setq endang (- (nth rn RSPEORIENT) (nth rn RSPSORIENT)))&lt;/P&gt;&lt;P&gt;;; TEST&lt;BR /&gt;(setq ang 0)&lt;BR /&gt;(repeat 9&lt;BR /&gt;(setq endangp (* PI (/ ang 180.0)))&lt;BR /&gt;(setq lninpt2 (polar TANKCTR endangp pltinrad))&lt;BR /&gt;(setq lnoutpt2 (polar TANKCTR endangp pltoutrad))&lt;BR /&gt;(prompt "\n ang: ")&lt;BR /&gt;(princ ang)&lt;BR /&gt;(prompt "\n")&lt;BR /&gt;(prompt "\n endangp: ")&lt;BR /&gt;(princ endangp)&lt;BR /&gt;(prompt "\n")&lt;BR /&gt;(setvar 'clayer "Pipe2")&lt;BR /&gt;(command "line" lninpt2 lnoutpt2 "")&lt;BR /&gt;(setq ang (+ ang 10))&lt;BR /&gt;)&lt;BR /&gt;;; End TEST&lt;/P&gt;&lt;P&gt;(setq endangp (* PI (/ endang 180.0)))&lt;BR /&gt;(setq lninpt2 (polar TANKCTR endangp pltinrad))&lt;BR /&gt;(setq lnoutpt2 (polar TANKCTR endangp pltoutrad))&lt;BR /&gt;(setq mirang (/ endang 2))&lt;BR /&gt;(setq mirangp (+ (/ (* mirang PI) 180) (/ PI 4)))&lt;BR /&gt;(setq mirlnpt (polar TANKCTR mirangp pltoutrad))&lt;BR /&gt;(setvar 'clayer "Radial Trim4")&lt;BR /&gt;(command "line" lninpt2 lnoutpt2 "")&lt;BR /&gt;(prompt "\n endang: ")&lt;BR /&gt;(princ endang)&lt;BR /&gt;(prompt "\n")&lt;BR /&gt;(prompt "\n endangp: ")&lt;BR /&gt;(princ endangp)&lt;BR /&gt;(prompt "\n")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at 60 deg. the output is drawing4 and :&lt;/P&gt;&lt;P&gt;ang: 60&lt;BR /&gt;endangp: 1.0472&lt;/P&gt;&lt;P&gt;endang: 60.0&lt;BR /&gt;endangp: 1.0472&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at 45 deg. the output is&amp;nbsp;&lt;SPAN&gt;drawing4-2 and :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ang: 40&lt;BR /&gt;endangp: 0.698132&lt;BR /&gt;ang: 50&lt;BR /&gt;endangp: 0.872665&lt;BR /&gt;endang: 45.0&lt;BR /&gt;endangp: 0.785398&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone explane what is going on?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Feb 2015 05:16:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499106#M143959</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-08T05:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Polar acting wierd</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499119#M143960</link>
      <description>Maybe relevant: turn off the object snap: (setvar 'osmode 0) if not others also.</description>
      <pubDate>Sun, 08 Feb 2015 06:39:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499119#M143960</guid>
      <dc:creator>stevor</dc:creator>
      <dc:date>2015-02-08T06:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Polar acting wierd</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499252#M143961</link>
      <description>&lt;P&gt;Thank you for replying but I have it turned off at the begining of the program as well as projmode set to 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(command "PROJMODE" 0)&lt;BR /&gt;(command "OSNAP" "OFF")&lt;/P&gt;</description>
      <pubDate>Sun, 08 Feb 2015 16:03:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499252#M143961</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-08T16:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Polar acting wierd</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499522#M143962</link>
      <description>&lt;P&gt;When you say "when 60 degrees is entered," what does that mean?&amp;nbsp; I don't see anything asking the User to enter an angle.&amp;nbsp; Is that the 'endang' variable coming from just above the TEST part?&amp;nbsp; If so, you don't include anything about the lists from which it's calculating that value&amp;nbsp;-- could there be something wrong with those?&amp;nbsp; And what is 'mirang' for?&amp;nbsp; It doesn't seem to be used for anything -- does that matter?&amp;nbsp; Your description of drawing4 shows that for 60 degrees, 60 appears to be returned, not 30 as indicated at the top of the Post.&amp;nbsp; Can you post something like&amp;nbsp;side-by-side images of what you &lt;EM&gt;want&lt;/EM&gt;&amp;nbsp;compared to&amp;nbsp;what you're &lt;EM&gt;getting&lt;/EM&gt; instead, pointing to what's wrong in the latter?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Feb 2015 00:03:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499522#M143962</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-02-09T00:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Polar acting wierd</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499565#M143963</link>
      <description>&lt;P&gt;The inputs are coming from an excel document.&amp;nbsp; For now I’m entering 0 for the first angle and 45, 60 ect for the second angle.&amp;nbsp; They will be changing depending on the size that the user wants.&amp;nbsp; This is just one small portion of a much larger program. &amp;nbsp;The ’mirang’ &amp;nbsp;is supposed to be the mid point of the other 2 angles, the added (/ PI 4) I put to make it work for the 45 degrees I was working with at the start don’t know why lol.&amp;nbsp; I can fix it when I figure out what is wrong.&amp;nbsp; Since you asked me all this I tried a few more angles and I find the only one that works is the 45 degrees. I really don’t know what is going on with this.&amp;nbsp; If I try 40 it puts the line at 50. &amp;nbsp;I’ll try posting a few more images with the test taken out so you can see the results better.&lt;/P&gt;&lt;P&gt;Test1 40 degrees&lt;/P&gt;&lt;P&gt;Test2 45 degrees&lt;/P&gt;&lt;P&gt;Test3 50 degrees&lt;/P&gt;&lt;P&gt;To give you a bigger picture of what I’m doing I’ll post an image of what this section of the program makes, with 45 degrees entered anyway lol.&amp;nbsp; I was close to finishing it when I decided to change the size to check the placement of some of the items.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Feb 2015 01:25:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499565#M143963</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-09T01:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Polar acting wierd</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499566#M143964</link>
      <description>&lt;P&gt;It will only let be post 3 attachments so here is the finished one at 45 degrees.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Feb 2015 01:26:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5499566#M143964</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-09T01:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Polar acting wierd</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5500084#M143965</link>
      <description>&lt;P&gt;The (polar) function uses its 'ang' argument [to quote Help about it] "...in radians &lt;EM&gt;relative to the world &lt;SPAN class="__Override"&gt;X&lt;/SPAN&gt; axis&lt;/EM&gt;. Angles increase in the &lt;EM&gt;counterclockwise&lt;/EM&gt; direction, independent of the current construction plane."&amp;nbsp; You appear to be going for angles measured &lt;EM&gt;clockwise&lt;/EM&gt;, and from 0 as being &lt;EM&gt;upward&lt;/EM&gt;, but in (polar)'s terms, that's 90 degrees.&amp;nbsp; Try:&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;(setq endangp (* PI (/ &lt;STRONG&gt;(- 90.0 endang)&lt;/STRONG&gt; 180.0))); endang in WCS radians&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;</description>
      <pubDate>Mon, 09 Feb 2015 14:19:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5500084#M143965</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-02-09T14:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Polar acting wierd</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5500428#M143966</link>
      <description>&lt;P&gt;Thank you so much. &amp;nbsp;I &amp;nbsp;cann't believe I forgot that lol.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Feb 2015 17:11:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polar-acting-wierd/m-p/5500428#M143966</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-09T17:11:35Z</dc:date>
    </item>
  </channel>
</rss>

