VS:CircleCircleInters: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
 
m (1 revision)
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Finds the intersection of two circles. Returns FALSE if the circles do not intersect.
Finds the intersection of two circles.</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION CircleCircleIntersec(cenPt1X, cenPt1Y, cenPt1Z :REAL; cenPt2X, cenPt2Y, cenPt2Z :REAL; radius1 :REAL; radius2 :REAL; VAR pt1X, pt1Y, pt1Z :REAL; VAR pt2X, pt2Y, pt2Z :REAL) :BOOLEAN;
FUNCTION CircleCircleInters(cenPt1:VECTOR; cenPt2:VECTOR; radius1:REAL; radius2:REAL; VAR pt1:VECTOR; VAR pt2:VECTOR) : BOOLEAN;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 23: Line 22:
<lineList ident=1>
<lineList ident=1>
<line>
<line>
cenPt1X, cenPt1Y, cenPt1Z
cenPt1
REAL
VECTOR


</line>
</line>
<line>
<line>
cenPt2X, cenPt2Y, cenPt2Z
cenPt2
REAL
VECTOR


</line>
</line>
Line 43: Line 42:
</line>
</line>
<line>
<line>
pt1X, pt1Y, pt1Z
pt1
REAL
VECTOR
Output parameter.
 
</line>
</line>
<line>
<line>
pt2X, pt2Y, pt2Z
pt2
REAL
VECTOR
Output parameter.
 
</line>
</line>
</lineList>
</lineList>
</params>
</params>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<return>
<remark></remark>
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<sample></sample>
This has been renamed &#034;CircleCircleInters&#034;, VW 13+ (82099)
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
<pre>PROCEDURE Example;
VAR
  cen_pt1, cen_pt2 :VECTOR;
  Radius1, Radius2, startAng1, startAng2, sweepAng1, sweepAng2, fuzz :REAL;
  pt1, pt2 :VECTOR;
 
  PROCEDURE ArcInfo(h :HANDLE; VAR cen_pt :VECTOR; VAR startAng, sweepAng, Radius :REAL);
  BEGIN
      Hcenter(h, cen_pt.x, cen_pt.y);
      GetArc (h, startAng, sweepAng);
      IF GetType(h) = 6 THEN Radius := Hperim(h) / Deg2Rad(sweepAng) ELSE
      IF GetType(h) = 89 THEN Radius := 5729.28 / ((100 * Hangle(h)) / Hlength(h));
  END;
 
BEGIN
  CallTool(-205); ArcInfo(FSActLayer, cen_pt1, startAng1, sweepAng1, Radius1);
  CallTool(-205); ArcInfo(FSActLayer, cen_pt2, startAng2, sweepAng2, Radius2);
  IF CircleCircleInters(cen_pt1, cen_pt2, Radius1, Radius2, .1, pt1, pt2) THEN BEGIN
      Locus(pt1.x, pt1.y);
      Locus(pt2.x, pt2.y);
  END;
END;
RUN(Example);</pre></code>
 
</sample>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: from All Versions
Availability: from Vectorworks 2014


This is drop-in function.
</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
</seeAlso>


</vwDoc>
</vwDoc>

Latest revision as of 17:35, 18 September 2013

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Finds the intersection of two circles.

FUNCTION CircleCircleInters(
cenPt1 :VECTOR;
cenPt2 :VECTOR;
radius1 :REAL;
radius2 :REAL;
VAR pt1 :VECTOR;
VAR pt2 :VECTOR) : BOOLEAN;
def vs.CircleCircleInters(cenPt1, cenPt2, radius1, radius2):
    return (BOOLEAN, pt1, pt2)

Parameters

cenPt1 VECTOR
cenPt2 VECTOR
radius1 REAL
radius2 REAL
pt1 VECTOR
pt2 VECTOR

Version

Availability: from Vectorworks 2014