VS:EllipseEllipseIntersect/ja: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision: 2015 VS Reference JP E)
No edit summary
Line 11: Line 11:
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION EllipseEllipseIntersect(upperLeft1:REAL; lowerRight1:REAL; upperLeft2:REAL; lowerRight2:REAL; VAR int1:REAL; VAR int2:REAL; VAR int3:REAL; VAR int4:REAL) : INTEGER;
FUNCTION EllipseEllipseIntersect(upperLeft1:POINT; lowerRight1:POINT; upperLeft2:POINT; lowerRight2:POINT; VAR int1:POINT; VAR int2:POINT; VAR int3:POINT; VAR int4:POINT) : INTEGER;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 24: Line 24:
<line>
<line>
upperLeft1
upperLeft1
REAL
POINT
楕円1の左上の座標
楕円1の左上の座標
</line>
</line>

Revision as of 07:39, 28 April 2016

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

Description

指定した2つの楕円の交点数と座標を計算します。

FUNCTION EllipseEllipseIntersect(
upperLeft1 :POINT;
lowerRight1 :POINT;
upperLeft2 :POINT;
lowerRight2 :POINT;
VAR int1 :POINT;
VAR int2 :POINT;
VAR int3 :POINT;
VAR int4 :POINT) : INTEGER;
def vs.EllipseEllipseIntersect(upperLeft1, lowerRight1, upperLeft2, lowerRight2):
    return (INTEGER, int1, int2, int3, int4)

Parameters

upperLeft1 POINT 楕円1の左上の座標
lowerRight1 REAL 楕円1の右下の座標
upperLeft2 REAL 楕円2の左上の座標
lowerRight2 REAL 楕円2の右下の座標
int1 REAL 交点1の座標
int2 REAL 交点2の座標
int3 REAL 交点3の座標
int4 REAL 交点4の座標

Return Value

交点数の数を返します。返り値がnの場合、最初からn個までの点が有効な値です。
例えば、返り値が1の場合、交点1の座標の座標は有効な値ですが、交点2、3、4の座標は無効です。返り値が3の場合、交点1、2、3の座標の座標は有効な値ですが、交点4の座標は無効です。

Example

PROCEDURE Example;
VAR
	h1, h2 :HANDLE;
	upperLeft1, lowerRight1 :POINT;
	upperLeft2, lowerRight2 :POINT;
	int1, int2, int3, int4 :POINT;
	num :INTEGER;
BEGIN
	CallTool(-205); h1 := FSActLayer;
	CallTool(-205); h2 := FSActLayer;
	GetBBox(h1, upperLeft1.x, upperLeft1.y, lowerRight1.x, lowerRight1.y);
	GetBBox(h2, upperLeft2.x, upperLeft2.y, lowerRight2.x, lowerRight2.y);
	num := EllipseEllipseIntersect(upperLeft1, lowerRight1, upperLeft2, lowerRight2, int1, int2, int3, int4);
	Message(num);
	Locus(int1.x, int1.y);
	Locus(int2.x, int2.y);
	Locus(int3.x, int3.y);
	Locus(int4.x, int4.y);
END;
RUN(Example);

Version

Availability: from VectorWorks10.0