function Duga1 X1 Y1 Xc Yc R K &Xa &Ya &Sa &Ca &Prizn = ( Dx=(Xc-X1)*K; Dy=(Yc-Y1)*K; Dl=Sqrt (Sqr Dx + Sqr Dy); if (Abs Dl) <0 then ( Prizn="Inside"; return true; ) Prizn="Outside"; Ss=R/Dl; Sa=Dy/Dl; Ca=Dx/Dl; Da=ArcSin Ss ; if (Abs (Sqr Dl) - (Sqr R))<=Eps then ( Prizn="OnThe"; return true; ) if (Sqr Dl - Sqr R <=0) then ( Prizn="Inside"; return true; ) Dl1=Sqrt (Sqr Dl - Sqr R ); Al=ArcSin Sa ; if (Ca<0) then Al=-Al+PI; Al=Al-Da*K; Sa=Sin(Al); Ca=Cos(Al); Xa=X1+K*(Dl1*Ca); Ya=Y1+K*(Dl1*Sa); return true; ) -- Duga1 fn EExecP4_1 &out_prm1 &out_prm2 in_prm1 in_prm2 Att_1 Att_2 Sg1 Sg2= ( if ((in_prm1.OB==undefined) or (in_prm2.OB==undefined)) then return false; Result=true; CreateCopy &Y in_prm1 CreateCopy &X in_prm2 EExecPA &p2 Y Att0 Sg1 EExecDN &d2 X p2 Att0 Sg2 1 EExecP3 &out_prm2 &p4 d2 Y Att0 Att0 1 Sg1 EExecO0 &out_prm1 out_prm2 X Att0 1 Sg2 return Result; ) -- EExecP4_1 fn EExecP4 &Out_Prm1 &Out_Prm2 X Y Att1 Att2 Sg1 Sg2 FM = ( local X2,Y2,X1,Y1,X2,Y2,R,Xc,Yc,Dg,CC,S,C,Df,Dx,Dl,S1,C1,X4,Y4,X5,Y5,XX,YY X2 = Complex 0. 0. Y2 = Complex 0. 0. if ((X.OB==undefined) or (Y.OB==undefined)) then return false if ((X.OB=="P") and (Y.OB=="D")) then ( X1=X.X Y1=X.Y Xc=Y.Xc.Re Yc=Y.Yc.Re R=Y.R.Re X2.Re=0.; X2.Im=0. Y2.Re=0.; Y2.Im=0. if (X.W==1) then ( DG=Duga1 X1.Re Y1.Re Xc Yc R Sg2 &X2.Re &Y2.Re &Cc &Ss &Pr if ((Pr=="Outside") or (Pr=="Inside")) then ( EExecP4_1 &Out_Prm1 &Out_Prm2 Y X Att1 Att2 Sg2 Sg1 "0" return true ) if (Pr=="Inside") then ( if (Att1.Chk==1) then TOEmpty_Create &Out_Prm1 Att1 if (Att2.Chk==1) then TOEmpty_Create &Out_Prm2 Att2 return true ) if (Pr=="OnThe") then ( TOPoint_Create &Out_Prm2 X1 Y1 1 Att2 X5=Complex 0. 0. Y5=Complex 0. 0. X2=Complex Y.Xc.Re 0. Y2=Complex Y.Yc.Re 0. Dx=90. SCDP=SC X2.Re Y2.Re X1.Re Y1.Re &S &C &Dl Df=Fi 0. 1. S C Dx=Dx*PI/180.+Df X5.Re=X1.Re+(100.*Cos Dx)*Sg2; X5.Im=0. Y5.Re=Y1.Re+(100.*Sin Dx)*Sg2; Y5.Im=0. TOLine_Create &Out_Prm1 X1 Y1 1 X5 Y5 1 brn_UnLimited "sobstv" Att1 AddInc Out_Prm1 Out_Prm2 AddInc Y Out_Prm2 AddInc Out_Prm1 X return true ) TOPoint_Create &Out_Prm2 X2 Y2 1 Att2 TOLine_Create &Out_Prm1 X1 Y1 1 X2 Y2 1 brn_Limited "sobstv" Att1 AddInc Out_Prm1 Out_Prm2 AddInc Out_Prm1 X AddInc Y Out_Prm2 return true ) if (X.W==0) then ( Dl=Sqrt (Sqr X.X.Re +Sqr X.Y.Re) if (Dl>0.) then ( S1=X.Y.Re/Dl; C1=X.X.Re/Dl; ) Df=Fi 0. 1. S1 C1 if (Df<0.) then Df=2.*PI+Df Dx=Df+PI X5=Complex (Xc+100.*Cos Dx) 0. Y5=Complex (Yc+100.*Sin Dx) 0. X4=Complex (Xc-100.*Cos Dx) 0. Y4=Complex (Yc-100.*Sin Dx) 0. Dxx=R Val=Dxx/Sqrt (Sqr (X5.Re-X4.Re) +Sqr (Y5.Re-Y4.Re) )*Sg2 X3=Complex X4.Re+(Y5.Re-Y4.Re)*Val 0. Y3=Complex Y4.Re-(X5.Re-X4.Re)*Val 0. Val=100./Sqrt (Sqr (X5.Re-X4.Re) +Sqr (Y5.Re-Y4.Re)) X6=Complex X3.Re-Val*(X5.Re-X4.Re) 0. X7=Complex X3.Re+Val*(X5.Re-X4.Re) 0. Y6=Complex Y3.Re-Val*(Y5.Re-Y4.Re) 0. Y7=Complex Y3.Re+Val*(Y5.Re-Y4.Re) 0. TOLine_Create &Out_Prm1 X6 Y6 1 X7 Y7 1 brn_UnLimited "sobstv" Att1 SCDP=SC X1.Re Y1.Re X2.Re Y2.Re &S &C &Dl Df=Fi 0. 1. S C X3.Re=Xc Y3.Re=Yc Dx=Dx+PI/2. X5.Re=X3.Re+100.*Cos Dx X5.Im=0. Y5.Re=Y3.Re+100.*Sin Dx Y5.Im=0. X4.Re=X3.Re-100.*Cos Dx X4.Im=0. Y4.Re=Y3.Re-100.*Sin Dx Y4.Im=0. XX.Im=0. YY.Im=0. LL=LinLin X4.Re Y4.Re X5.Re Y5.Re X6.Re Y6.Re X7.Re Y7.Re XX.Re=LL.X YY.Re=LL.Y TOPoint_Create &Out_Prm2 XX YY 1 Att2 return true ) ) else if ((X.OB=="P") and (Y.OB=="P")) then ( TOPoint_Create &Out_Prm2 Y.X Y.Y 1 Att2 TOLine_Create &Out_Prm1 X.X X.Y 1 Y.X Y.Y 1 brn_Limited "sobstv" Att1 AddInc Out_Prm1 Out_Prm2 AddInc Out_Prm1 X AddInc Y Out_Prm2 return true ) else ( if (Att1.Chk==1) then TOEmpty_Create &Out_Prm1 Att1 if (Att2.Chk==1) then TOEmpty_Create &Out_Prm2 Att2 return true ) return true ) -- EExecP4