<?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: in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892629#M164157</link>
    <description>Correction - I forgot a line of code:&lt;BR /&gt;
&lt;BR /&gt;
(defun get-arcmid (enam / elst st-ang ed-ang rad cpt p1 p2 midpt)&lt;BR /&gt;
    (setq elst (entget enam)&lt;BR /&gt;
            st-ang (cdr (assoc 50 elst))&lt;BR /&gt;
            ed-ang (cdr (assoc 51 elst))&lt;BR /&gt;
            rad (cdr (assoc 40 elst))&lt;BR /&gt;
            cpt (cdr (assoc 10 elst))&lt;BR /&gt;
            p1 (polar cpt st-ang rad)&lt;BR /&gt;
            p2 (polar cpt ed-ang rad)&lt;BR /&gt;
            midpt (polar p1 (angle p1 p2) (/ (distance p1 p2) 2))&lt;BR /&gt;
            midpt (polar cpt (angle cpt midpt) rad)&lt;BR /&gt;
    )&lt;BR /&gt;
    midpt&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Phillip Kenewell&lt;BR /&gt;
CAD Systems Technician&lt;BR /&gt;
Air Gage Company&lt;BR /&gt;
pkenewell@airgage.com&lt;BR /&gt;
&lt;BR /&gt;
Phil Kenewell &lt;PKENEWELL&gt; wrote in message&lt;BR /&gt;
news:7snqdh$fuf3@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Here's a quick and simple method using (polar):&lt;/PKENEWELL&gt;</description>
    <pubDate>Mon, 27 Sep 1999 13:15:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>1999-09-27T13:15:17Z</dc:date>
    <item>
      <title>Getting Arc-midpoint in an easy way..</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892627#M164155</link>
      <description>Hi there !&lt;BR /&gt;
Is there some easy, reliable method of getting the coords for a midpoint&lt;BR /&gt;
on an arc. I tried to do it this way:&lt;BR /&gt;
&lt;BR /&gt;
1) Get the start-angle (DXF-code 50)&lt;BR /&gt;
2) get the end-angle (DXF-code 51)&lt;BR /&gt;
3) Get the radius (DXF-code 40)&lt;BR /&gt;
4) Get the center-point (DXF-code 10)&lt;BR /&gt;
&lt;BR /&gt;
From this data I just calculate the point using the Polar-function, like&lt;BR /&gt;
this:&lt;BR /&gt;
&lt;BR /&gt;
(setq Coords(polar Center (+ (/ (- endangle startangle) 2) startangle)&lt;BR /&gt;
radius ))&lt;BR /&gt;
&lt;BR /&gt;
This works, if the angles are in the 1:st and second quadrants, but I&lt;BR /&gt;
encounter problems if the arc-span is between the 4:th and 1:st&lt;BR /&gt;
quadrant..&lt;BR /&gt;
&lt;BR /&gt;
Thanx !&lt;BR /&gt;
&lt;BR /&gt;
/Erik</description>
      <pubDate>Mon, 27 Sep 1999 12:54:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892627#M164155</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-09-27T12:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Arc-midpoint in an easy way..</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892628#M164156</link>
      <description>Here's a quick and simple method using (polar):&lt;BR /&gt;
&lt;BR /&gt;
(defun get-arcmid (enam / elst st-ang ed-ang rad cpt p1 p2 midpt)&lt;BR /&gt;
    (setq elst (entget enam)&lt;BR /&gt;
            st-ang (cdr (assoc 50 elst))&lt;BR /&gt;
            ed-ang (cdr (assoc 51 elst))&lt;BR /&gt;
            rad (cdr (assoc 40 elst))&lt;BR /&gt;
            cpt (cdr (assoc 10 elst))&lt;BR /&gt;
            p1 (polar cpt st-ang rad)&lt;BR /&gt;
            p2 (polar cpt ed-ang rad)&lt;BR /&gt;
            midpt (polar p1 (angle p1 p2) (/ (distance p1 p2) 2))&lt;BR /&gt;
    )&lt;BR /&gt;
    midpt&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Phillip Kenewell&lt;BR /&gt;
CAD Systems Technician&lt;BR /&gt;
Air Gage Company&lt;BR /&gt;
pkenewell@airgage.com&lt;BR /&gt;
&lt;BR /&gt;
Erik Nilsson &lt;ERIK.NILSSON&gt; wrote in message&lt;BR /&gt;
news:37EF68EB.5FD4D65D@systeam.se...&lt;BR /&gt;
&amp;gt; Hi there !&lt;BR /&gt;
&amp;gt; Is there some easy, reliable method of getting the coords for a midpoint&lt;BR /&gt;
&amp;gt; on an arc. I tried to do it this way:&lt;/ERIK.NILSSON&gt;</description>
      <pubDate>Mon, 27 Sep 1999 13:09:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892628#M164156</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-09-27T13:09:21Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892629#M164157</link>
      <description>Correction - I forgot a line of code:&lt;BR /&gt;
&lt;BR /&gt;
(defun get-arcmid (enam / elst st-ang ed-ang rad cpt p1 p2 midpt)&lt;BR /&gt;
    (setq elst (entget enam)&lt;BR /&gt;
            st-ang (cdr (assoc 50 elst))&lt;BR /&gt;
            ed-ang (cdr (assoc 51 elst))&lt;BR /&gt;
            rad (cdr (assoc 40 elst))&lt;BR /&gt;
            cpt (cdr (assoc 10 elst))&lt;BR /&gt;
            p1 (polar cpt st-ang rad)&lt;BR /&gt;
            p2 (polar cpt ed-ang rad)&lt;BR /&gt;
            midpt (polar p1 (angle p1 p2) (/ (distance p1 p2) 2))&lt;BR /&gt;
            midpt (polar cpt (angle cpt midpt) rad)&lt;BR /&gt;
    )&lt;BR /&gt;
    midpt&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Phillip Kenewell&lt;BR /&gt;
CAD Systems Technician&lt;BR /&gt;
Air Gage Company&lt;BR /&gt;
pkenewell@airgage.com&lt;BR /&gt;
&lt;BR /&gt;
Phil Kenewell &lt;PKENEWELL&gt; wrote in message&lt;BR /&gt;
news:7snqdh$fuf3@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Here's a quick and simple method using (polar):&lt;/PKENEWELL&gt;</description>
      <pubDate>Mon, 27 Sep 1999 13:15:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892629#M164157</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-09-27T13:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Arc-midpoint in an easy way..</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892630#M164158</link>
      <description>I believe Phil's code is essentially the same as mine. However, I chose to&lt;BR /&gt;
forgo the extra checking he did. Basically, I just calculate the start point&lt;BR /&gt;
of the arc and a pply a midpoint snap to it. Hope it helps. P.S. There is no&lt;BR /&gt;
error checking what so ever in this code.&lt;BR /&gt;
&lt;BR /&gt;
(defun c:test()&lt;BR /&gt;
  (setq elist (entget (car (entsel)))&lt;BR /&gt;
   rad (cdr (assoc 40 elist))&lt;BR /&gt;
   cen (cdr (assoc 10 elist))&lt;BR /&gt;
   ang (cdr (assoc 50 elist))&lt;BR /&gt;
   mid (osnap (polar cen ang rad) "_mid")&lt;BR /&gt;
  )&lt;BR /&gt;
  (princ mid)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
Erik Nilsson &lt;ERIK.NILSSON&gt; wrote in message&lt;BR /&gt;
news:37EF68EB.5FD4D65D@systeam.se...&lt;BR /&gt;
&amp;gt; Hi there !&lt;BR /&gt;
&amp;gt; Is there some easy, reliable method of getting the coords for a midpoint&lt;BR /&gt;
&amp;gt; on an arc. I tried to do it this way:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; 1) Get the start-angle (DXF-code 50)&lt;BR /&gt;
&amp;gt; 2) get the end-angle (DXF-code 51)&lt;BR /&gt;
&amp;gt; 3) Get the radius (DXF-code 40)&lt;BR /&gt;
&amp;gt; 4) Get the center-point (DXF-code 10)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; From this data I just calculate the point using the Polar-function, like&lt;BR /&gt;
&amp;gt; this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (setq Coords(polar Center (+ (/ (- endangle startangle) 2) startangle)&lt;BR /&gt;
&amp;gt; radius ))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; This works, if the angles are in the 1:st and second quadrants, but I&lt;BR /&gt;
&amp;gt; encounter problems if the arc-span is between the 4:th and 1:st&lt;BR /&gt;
&amp;gt; quadrant..&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanx !&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; /Erik&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/ERIK.NILSSON&gt;</description>
      <pubDate>Mon, 27 Sep 1999 13:45:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892630#M164158</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-09-27T13:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Arc-midpoint in an easy way..</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892631#M164159</link>
      <description>Erik,&lt;BR /&gt;
&lt;BR /&gt;
Since you asked for an easy way, how about:&lt;BR /&gt;
&lt;BR /&gt;
(setq mpnt (osnap (cadr (entsel "\nSelect arc: ")) "mid"))&lt;BR /&gt;
&lt;BR /&gt;
This will work for any arc with the midpoint in any quadrant.&lt;BR /&gt;
--&lt;BR /&gt;
Dave E&lt;BR /&gt;
&lt;BR /&gt;
Erik Nilsson &lt;ERIK.NILSSON&gt; wrote in article&lt;BR /&gt;
&amp;lt;37EF68EB.5FD4D65D@systeam.se&amp;gt;...&lt;BR /&gt;
&amp;gt; Hi there !&lt;BR /&gt;
&amp;gt; Is there some easy, reliable method of getting the coords for a midpoint&lt;BR /&gt;
&amp;gt; on an arc. I tried to do it this way:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; 1) Get the start-angle (DXF-code 50)&lt;BR /&gt;
&amp;gt; 2) get the end-angle (DXF-code 51)&lt;BR /&gt;
&amp;gt; 3) Get the radius (DXF-code 40)&lt;BR /&gt;
&amp;gt; 4) Get the center-point (DXF-code 10)&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; From this data I just calculate the point using the Polar-function, like&lt;BR /&gt;
&amp;gt; this:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; (setq Coords(polar Center (+ (/ (- endangle startangle) 2) startangle)&lt;BR /&gt;
&amp;gt; radius ))&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; This works, if the angles are in the 1:st and second quadrants, but I&lt;BR /&gt;
&amp;gt; encounter problems if the arc-span is between the 4:th and 1:st&lt;BR /&gt;
&amp;gt; quadrant..&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Thanx !&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; /Erik&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt;&lt;/ERIK.NILSSON&gt;</description>
      <pubDate>Mon, 27 Sep 1999 20:58:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892631#M164159</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-09-27T20:58:25Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892632#M164160</link>
      <description>Nicely done! I'm gonna have to start paying more attention to this group.&lt;BR /&gt;
&lt;BR /&gt;
David Doane &lt;LECTRO-MECH&gt; wrote in message&lt;BR /&gt;
news:01bf092a$b32228e0$4456d2d0@lms-1...&lt;BR /&gt;
&amp;gt; Erik,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Since you asked for an easy way, how about:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (setq mpnt (osnap (cadr (entsel "\nSelect arc: ")) "mid"))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; This will work for any arc with the midpoint in any quadrant.&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Dave E&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Erik Nilsson &lt;ERIK.NILSSON&gt; wrote in article&lt;BR /&gt;
&amp;gt; &amp;lt;37EF68EB.5FD4D65D@systeam.se&amp;gt;...&lt;BR /&gt;
&amp;gt; &amp;gt; Hi there !&lt;BR /&gt;
&amp;gt; &amp;gt; Is there some easy, reliable method of getting the coords for a midpoint&lt;BR /&gt;
&amp;gt; &amp;gt; on an arc. I tried to do it this way:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; 1) Get the start-angle (DXF-code 50)&lt;BR /&gt;
&amp;gt; &amp;gt; 2) get the end-angle (DXF-code 51)&lt;BR /&gt;
&amp;gt; &amp;gt; 3) Get the radius (DXF-code 40)&lt;BR /&gt;
&amp;gt; &amp;gt; 4) Get the center-point (DXF-code 10)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; From this data I just calculate the point using the Polar-function, like&lt;BR /&gt;
&amp;gt; &amp;gt; this:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; (setq Coords(polar Center (+ (/ (- endangle startangle) 2) startangle)&lt;BR /&gt;
&amp;gt; &amp;gt; radius ))&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; This works, if the angles are in the 1:st and second quadrants, but I&lt;BR /&gt;
&amp;gt; &amp;gt; encounter problems if the arc-span is between the 4:th and 1:st&lt;BR /&gt;
&amp;gt; &amp;gt; quadrant..&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Thanx !&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; /Erik&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;/ERIK.NILSSON&gt;&lt;/LECTRO-MECH&gt;</description>
      <pubDate>Mon, 27 Sep 1999 21:55:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892632#M164160</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-09-27T21:55:38Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892633#M164161</link>
      <description>Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Sometimes the more advanced programmers look deeper than they really need&lt;BR /&gt;
to.  &lt;G&gt;&lt;BR /&gt;
--&lt;BR /&gt;
Dave D&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo &lt;FRANKO&gt; wrote in article&lt;BR /&gt;
&amp;lt;7sopgi$l8h5@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
&amp;gt; Nicely done! I'm gonna have to start paying more attention to this group.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; David Doane &lt;LECTRO-MECH&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:01bf092a$b32228e0$4456d2d0@lms-1...&lt;BR /&gt;
&amp;gt; &amp;gt; Erik,&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Since you asked for an easy way, how about:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; (setq mpnt (osnap (cadr (entsel "\nSelect arc: ")) "mid"))&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; This will work for any arc with the midpoint in any quadrant.&lt;BR /&gt;
&amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; Dave E&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Erik Nilsson &lt;ERIK.NILSSON&gt; wrote in article&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;lt;37EF68EB.5FD4D65D@systeam.se&amp;gt;...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Hi there !&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Is there some easy, reliable method of getting the coords for a&lt;BR /&gt;
midpoint&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; on an arc. I tried to do it this way:&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; 1) Get the start-angle (DXF-code 50)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; 2) get the end-angle (DXF-code 51)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; 3) Get the radius (DXF-code 40)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; 4) Get the center-point (DXF-code 10)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; From this data I just calculate the point using the Polar-function,&lt;BR /&gt;
like&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; this:&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; (setq Coords(polar Center (+ (/ (- endangle startangle) 2)&lt;BR /&gt;
startangle)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; radius ))&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; This works, if the angles are in the 1:st and second quadrants, but I&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; encounter problems if the arc-span is between the 4:th and 1:st&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; quadrant..&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Thanx !&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; /Erik&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt;&lt;/ERIK.NILSSON&gt;&lt;/LECTRO-MECH&gt;&lt;/FRANKO&gt;&lt;/G&gt;</description>
      <pubDate>Tue, 28 Sep 1999 00:13:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892633#M164161</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-09-28T00:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Arc-midpoint in an easy way..</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892634#M164162</link>
      <description>To deal with angles you need always&lt;BR /&gt;
to get into consideration the 2pi factor.&lt;BR /&gt;
&lt;BR /&gt;
When you try to find the midpoint, you're&lt;BR /&gt;
calling (polar ctrpt (/ (+ a1 a2) 2) r) where &lt;BR /&gt;
a1 and a2 are starting and ending angle of an arc.&lt;BR /&gt;
Here, would we add 2pi to one of angles, the result&lt;BR /&gt;
will differ by 1 pi, which is what's causing an error&lt;BR /&gt;
for you.&lt;BR /&gt;
&lt;BR /&gt;
To deal with angles, I often use the function to &lt;BR /&gt;
confine the periodic value to some given interval,&lt;BR /&gt;
for example:&lt;BR /&gt;
&lt;BR /&gt;
(defun make-pi (a) ; make it be in [-pi,pi] interval&lt;BR /&gt;
 (while (&amp;lt; a (- pi))&lt;BR /&gt;
   (setq a (+ a pi pi)))&lt;BR /&gt;
 (while (&amp;gt; a pi)&lt;BR /&gt;
   (setq a (- a pi pi)))&lt;BR /&gt;
 a )&lt;BR /&gt;
&lt;BR /&gt;
Now it's safe to code&lt;BR /&gt;
&lt;BR /&gt;
 (defun midang (a1 a2) &lt;BR /&gt;
   (+ a2 (/ (make-pi (- a1 a2)) 2)))&lt;BR /&gt;
&lt;BR /&gt;
and&lt;BR /&gt;
&lt;BR /&gt;
 (polar ctrpt (midang a1 a2) r)&lt;BR /&gt;
&lt;BR /&gt;
So the key here is changing the angle value&lt;BR /&gt;
to right interval _before_ dividing it by 2,&lt;BR /&gt;
which could otherwise introduce a pi size error&lt;BR /&gt;
(just what happened for you in that case).&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
&lt;BR /&gt;
On Mon, 27 Sep 1999 14:54:03 +0200, Erik Nilsson&lt;BR /&gt;
&lt;ERIK.NILSSON&gt; wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;Hi there !&lt;BR /&gt;
&amp;gt;Is there some easy, reliable method of getting the coords for a midpoint&lt;BR /&gt;
&amp;gt;on an arc. I tried to do it this way:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;1) Get the start-angle (DXF-code 50)&lt;BR /&gt;
&amp;gt;2) get the end-angle (DXF-code 51)&lt;BR /&gt;
&amp;gt;3) Get the radius (DXF-code 40)&lt;BR /&gt;
&amp;gt;4) Get the center-point (DXF-code 10)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;From this data I just calculate the point using the Polar-function, like&lt;BR /&gt;
&amp;gt;this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;(setq Coords(polar Center (+ (/ (- endangle startangle) 2) startangle)&lt;BR /&gt;
&amp;gt;radius ))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;This works, if the angles are in the 1:st and second quadrants, but I&lt;BR /&gt;
&amp;gt;encounter problems if the arc-span is between the 4:th and 1:st&lt;BR /&gt;
&amp;gt;quadrant..&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Vlad   http://www.netvision.net.il/php/vnestr/&lt;/ERIK.NILSSON&gt;</description>
      <pubDate>Wed, 29 Sep 1999 00:06:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892634#M164162</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-09-29T00:06:21Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892635#M164163</link>
      <description>Thanx all of U !&lt;BR /&gt;
This helped a lot !&lt;BR /&gt;
&lt;BR /&gt;
/Erik N&lt;BR /&gt;
&lt;BR /&gt;
Vladimir Nesterovsky wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; To deal with angles you need always&lt;BR /&gt;
&amp;gt; to get into consideration the 2pi factor.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; When you try to find the midpoint, you're&lt;BR /&gt;
&amp;gt; calling (polar ctrpt (/ (+ a1 a2) 2) r) where&lt;BR /&gt;
&amp;gt; a1 and a2 are starting and ending angle of an arc.&lt;BR /&gt;
&amp;gt; Here, would we add 2pi to one of angles, the result&lt;BR /&gt;
&amp;gt; will differ by 1 pi, which is what's causing an error&lt;BR /&gt;
&amp;gt; for you.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; To deal with angles, I often use the function to&lt;BR /&gt;
&amp;gt; confine the periodic value to some given interval,&lt;BR /&gt;
&amp;gt; for example:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (defun make-pi (a) ; make it be in [-pi,pi] interval&lt;BR /&gt;
&amp;gt;  (while (&amp;lt; a (- pi))&lt;BR /&gt;
&amp;gt;    (setq a (+ a pi pi)))&lt;BR /&gt;
&amp;gt;  (while (&amp;gt; a pi)&lt;BR /&gt;
&amp;gt;    (setq a (- a pi pi)))&lt;BR /&gt;
&amp;gt;  a )&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Now it's safe to code&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  (defun midang (a1 a2)&lt;BR /&gt;
&amp;gt;    (+ a2 (/ (make-pi (- a1 a2)) 2)))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; and&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  (polar ctrpt (midang a1 a2) r)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; So the key here is changing the angle value&lt;BR /&gt;
&amp;gt; to right interval _before_ dividing it by 2,&lt;BR /&gt;
&amp;gt; which could otherwise introduce a pi size error&lt;BR /&gt;
&amp;gt; (just what happened for you in that case).&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; HTH&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; On Mon, 27 Sep 1999 14:54:03 +0200, Erik Nilsson&lt;BR /&gt;
&amp;gt; &lt;ERIK.NILSSON&gt; wrote:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;Hi there !&lt;BR /&gt;
&amp;gt; &amp;gt;Is there some easy, reliable method of getting the coords for a midpoint&lt;BR /&gt;
&amp;gt; &amp;gt;on an arc. I tried to do it this way:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;1) Get the start-angle (DXF-code 50)&lt;BR /&gt;
&amp;gt; &amp;gt;2) get the end-angle (DXF-code 51)&lt;BR /&gt;
&amp;gt; &amp;gt;3) Get the radius (DXF-code 40)&lt;BR /&gt;
&amp;gt; &amp;gt;4) Get the center-point (DXF-code 10)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;From this data I just calculate the point using the Polar-function, like&lt;BR /&gt;
&amp;gt; &amp;gt;this:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;(setq Coords(polar Center (+ (/ (- endangle startangle) 2) startangle)&lt;BR /&gt;
&amp;gt; &amp;gt;radius ))&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;This works, if the angles are in the 1:st and second quadrants, but I&lt;BR /&gt;
&amp;gt; &amp;gt;encounter problems if the arc-span is between the 4:th and 1:st&lt;BR /&gt;
&amp;gt; &amp;gt;quadrant..&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Vlad   http://www.netvision.net.il/php/vnestr/&lt;/ERIK.NILSSON&gt;</description>
      <pubDate>Wed, 29 Sep 1999 13:30:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getting-arc-midpoint-in-an-easy-way/m-p/892635#M164163</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>1999-09-29T13:30:10Z</dc:date>
    </item>
  </channel>
</rss>

