VS:EllipseEllipseIntersect/ja
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
指定した2つの楕円の交点数と座標を計算します。
FUNCTION EllipseEllipseIntersect(
upperLeft1 :REAL;
lowerRight1 :REAL;
upperLeft2 :REAL;
lowerRight2 :REAL;
VAR int1 :REAL;
VAR int2 :REAL;
VAR int3 :REAL;
VAR int4 :REAL) : INTEGER;
def vs.EllipseEllipseIntersect(upperLeft1, lowerRight1, upperLeft2, lowerRight2): return (INTEGER, int1, int2, int3, int4)
Parameters
upperLeft1 REAL 楕円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