<?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: Tangent in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75024#M39188</link>
    <description>Thanks that was very helpful. And yes you are correct I should have said perpendicular to the tangent. &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_lol.gif" style="display : inline;" /&gt;</description>
    <pubDate>Tue, 07 Dec 2004 18:04:37 GMT</pubDate>
    <dc:creator>Red</dc:creator>
    <dc:date>2004-12-07T18:04:37Z</dc:date>
    <item>
      <title>Tangent</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75021#M39185</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;I created a detail callout that includes editable hotspots so that you can move the circle and have the line follow. Now the problem I'm running into is when I move the circle upward in the Y direction the line crosses through the circle. (See attached picture)&lt;BR /&gt;
&lt;BR /&gt;
I understand the reason behind the line going through the circle. The line end is determined by the radius of the circle and is added in the Y direction. Can someone please tell me if there is away for the line to stay tangent to that circle no matter what the size the circle maybe.&lt;BR /&gt;
&lt;BR /&gt;
 &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_question.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_question.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_question.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_question.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_question.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_question.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_question.gif" style="display : inline;" /&gt;&lt;/R&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/71228i265C515FF76F0791/image-size/large?v=v2&amp;amp;px=999" border="0" alt="tan.jpg" title="tan.jpg" /&gt;</description>
      <pubDate>Tue, 07 Dec 2004 15:54:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75021#M39185</guid>
      <dc:creator>Red</dc:creator>
      <dc:date>2004-12-07T15:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Tangent</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75022#M39186</link>
      <description>Or is there away to have it act like the current line tool does.&lt;BR /&gt;
&lt;BR /&gt;
(See attached picture)</description>
      <pubDate>Tue, 07 Dec 2004 16:21:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75022#M39186</guid>
      <dc:creator>Red</dc:creator>
      <dc:date>2004-12-07T16:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Tangent</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75023#M39187</link>
      <description>I assume you mean perpendicular to the tangent, based on your picture.&lt;BR /&gt;
&lt;BR /&gt;
You need to know the x, y of the circle center, and the x, y of the point where the line meets the horizontal line.&lt;BR /&gt;
&lt;BR /&gt;
Let's call them cpX, cpY, epX, epY. (ep: end point)&lt;BR /&gt;
&lt;BR /&gt;
You need to know the angle of that line. That's ng=ATN(rise/run) -&amp;gt; ng=ATN(ABS(cpY-epY)/ABS(cpX-epX)).&lt;BR /&gt;
&lt;BR /&gt;
Once you know that angle, you can adjust the start point of the line:&lt;BR /&gt;
&lt;BR /&gt;
(sp: start point, rds: radius)&lt;BR /&gt;
&lt;BR /&gt;
spX=cpX+rds*COS(ng)&lt;BR /&gt;
spY=cpY-rds*SIN(ng)&lt;BR /&gt;
&lt;BR /&gt;
This is for the quadrant you show in your first picture. For the others, you'll need to change whether you add or subtract the rds*COS(ng) &amp;amp; rds*SIN(ng). You can find out what quadrant you're in by seeing which is greater of cpX/epX and cpY/epY. There's probably a better way, but my trig is not great and I can only find such things by trial and error. I build such things in +X, +Y first, then see what breaks when I go to other quadrants. The basic idea is right.&lt;BR /&gt;
&lt;BR /&gt;
Then the line is LINE2 spX, spY, epX, epY, with a circle of CIRCLE2 cpX, cpY, rds.&lt;BR /&gt;
&lt;BR /&gt;
HTH, (and hope I didn't make a mistake!)</description>
      <pubDate>Tue, 07 Dec 2004 17:35:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75023#M39187</guid>
      <dc:creator>James Murray</dc:creator>
      <dc:date>2004-12-07T17:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Tangent</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75024#M39188</link>
      <description>Thanks that was very helpful. And yes you are correct I should have said perpendicular to the tangent. &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_lol.gif" style="display : inline;" /&gt;</description>
      <pubDate>Tue, 07 Dec 2004 18:04:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75024#M39188</guid>
      <dc:creator>Red</dc:creator>
      <dc:date>2004-12-07T18:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Tangent</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75025#M39189</link>
      <description>Maybe it's simpler not to use the ABS inside the ATN.&lt;BR /&gt;
The resulting angle from ATN function would be in range -90 to +90.&lt;BR /&gt;
You then use the following code to convert it to the range -90 to 270 ('cvng' is the converted angle):&lt;BR /&gt;
&lt;BR /&gt;
IF epX-cpX&amp;lt;0 THEN cvng=ng+180 ELSE cvng=ng&lt;BR /&gt;
&lt;BR /&gt;
Notice that, for calculation of SINs and COSs, the range -90 to 270 is the same as the range 0 to 360 (e.g., SIN (-45) = SIN (315)).&lt;BR /&gt;
This way, the script will 'know' the correct quadrant, by providing the proper negative or positive values for SINs and COSs.&lt;BR /&gt;
But beware: you must provide a conditional calculation of 'ng' when epX=cpX, to avoid division by zero when calculating the ATN.</description>
      <pubDate>Thu, 09 Dec 2004 18:23:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Tangent/m-p/75025#M39189</guid>
      <dc:creator>Durval</dc:creator>
      <dc:date>2004-12-09T18:23:21Z</dc:date>
    </item>
  </channel>
</rss>

