VS:EllipseEllipseIntersect/ja: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 34: Line 34:
<line>
<line>
upperLeft2
upperLeft2
REAL
POINT
楕円2の左上の座標
楕円2の左上の座標
</line>
</line>

Latest revision as of 07:40, 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 POINT 楕円1の右下の座標
upperLeft2 POINT 楕円2の左上の座標
lowerRight2 POINT 楕円2の右下の座標
int1 POINT 交点1の座標
int2 POINT 交点2の座標
int3 POINT 交点3の座標
int4 POINT 交点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