function CompGauss &AP &BP &X = ( local N1,N1,N,K,K1,M,L,I,J1,J local V,S local G=#() local C= #(#(),#(),#(),#(),#()) N=5 N1=N-1 for K=1 to N1 do ( if (CompAbs AP[K][K])<= 0 then ( K1=K+1 for M=K1 to N do ( if (CompAbs AP[M][K])<=0 then ( for L=1 to N do ( V=AP[K][L] AP[K][L]=AP[M][L] AP[M][L]=V ) ) ) V=BP[K] BP[K]=BP[M] BP[M]=V ) G[K]=CompDiv1 BP[K] AP[K][K] K1=K+1 for I=K1 to N do ( BP[I]=CompSub BP[I] (CompMul AP[I][K] G[K]) for J1=K to N do ( J=N-J1+K C[K][J]=CompDiv1 AP[K][J] AP[K][K] AP[I][J]=CompSub AP[I][J] (CompMul AP[I][K] C[K][J]) ) ) ) M=N X[M]=CompDiv1 BP[M] AP[M][M] do ( M=M-1 S=Complex 0. 0. for L=M to N1 do ( S=CompSum S (CompMul C[M][L+1] X[L+1]) ) X[M]=CompSub G[M] S ) while M>1 ) -- CompGauss function EExecPG &out_prm1 &out_prm2 in_prm1 in_prm2 Att_1 Att_2 Sg1 Sg2 FM = ( local Conica local KF local KFC local A,B,C,D,EE,F local AA,BB,CC,XX1,XX2,YY1,YY2 local X1,Y1,X2,Y2,Z,Dx,Dy,Dva,MDva,Four local Pa,Pb,C1,C2 local Xt,Yt,WT local R1,R2,R3,R4,R5,R6,R local AA1= #(#(),#(),#(),#(),#()) local BB1=#(1,2,3,4,5) local X=#(1,2,3,4,5) if ((in_prm1==undefined) or (in_prm2==undefined)) then return false CreateCopy &conica in_prm2 conica.FAtt=CopyAtt in_prm2.FAtt kf=2000. kfc=Complex kf 0.0 DVA=Complex 2.0 0.0 MDVA=Complex -2.0 0 Four=Complex 4.0 0.0 if (in_prm1.OB=="O") and (in_prm2.OB=="Y") then ( if IsSobstv in_prm1 then ( AA1[1][1]=CompMul Conica.PR1.X Conica.PR1.X AA1[1][2]=CompMul Conica.PR1.X Conica.PR1.Y AA1[1][3]=CompMul Conica.PR1.Y Conica.PR1.Y AA1[1][4]=CompMul Conica.PR1.X (Complex Conica.PR1.W 0.) AA1[1][5]=CompMul Conica.PR1.Y (Complex Conica.PR1.W 0.) BB1[1]=CompMul (CompNeg KFC) (Complex Conica.PR1.W 0.) AA1[2][1]=CompMul Conica.PR2.X Conica.PR2.X AA1[2][2]=CompMul Conica.PR2.X Conica.PR2.Y AA1[2][3]=CompMul Conica.PR2.Y Conica.PR2.Y AA1[2][4]=CompMul Conica.PR2.X (Complex Conica.PR2.W 0.) AA1[2][5]=CompMul Conica.PR2.Y (Complex Conica.PR2.W 0.) BB1[2]=CompMul (CompNeg KFC) (Complex Conica.PR2.W 0.) AA1[3][1]=CompMul Conica.PR3.X Conica.PR3.X AA1[3][2]=CompMul Conica.PR3.X Conica.PR3.Y AA1[3][3]=CompMul Conica.PR3.Y Conica.PR3.Y AA1[3][4]=CompMul Conica.PR3.X (Complex Conica.PR3.W 0.) AA1[3][5]=CompMul Conica.PR3.Y (Complex Conica.PR3.W 0.) BB1[3]=CompMul (CompNeg KFC) (Complex Conica.PR3.W 0.) AA1[4][1]=CompMul Conica.PR4.X Conica.PR4.X AA1[4][2]=CompMul Conica.PR4.X Conica.PR4.Y AA1[4][3]=CompMul Conica.PR4.Y Conica.PR4.Y AA1[4][4]=CompMul Conica.PR4.X (Complex Conica.PR4.W 0.) AA1[4][5]=CompMul Conica.PR4.Y (Complex Conica.PR4.W 0.) BB1[4]=CompMul (CompNeg KFC) (Complex Conica.PR4.W 0.) AA1[5][1]=CompMul Conica.PR5.X Conica.PR5.X AA1[5][2]=CompMul Conica.PR5.X Conica.PR5.Y AA1[5][3]=CompMul Conica.PR5.Y Conica.PR5.Y AA1[5][4]=CompMul Conica.PR5.X (Complex Conica.PR5.W 0.) AA1[5][5]=CompMul Conica.PR5.Y (Complex Conica.PR5.W 0.) BB1[5]=CompMul (CompNeg KFC) (Complex Conica.PR5.W 0.) CompGauss &AA1 &BB1 &X; A=X[1] B=X[2] C=X[3] D=X[4] EE=X[5] F=Complex KF 0. X1=in_Prm1.X1 Y1=in_Prm1.Y1 X2=in_Prm1.X2 Y2=in_Prm1.Y2 DX=CompSub X2 X1 DY=CompSub Y2 Y1 if Abs (X1.Re-X2.Re)>Eps then ( -- ?????????????? ?????? Z=CompSub (CompMul X1 Y2) (CompMul Y1 X2) AA=CompSum (CompSum (CompMul A (CompSqr DX)) (CompMul (CompMul B DX) DY)) (CompMul C (CompSqr DY)) BB=CompSum (CompSum (CompSub (CompMul MDVA (CompMul C (CompMul Z DY))) (CompMul B (CompMul Z DX))) (CompMul D (CompSqr DX))) (CompMul EE (CompMul DX DY)) CC=CompSum (CompMul Z (CompSub (CompMul C Z) (CompMul EE DX ))) (CompMul F (CompSqr DX )) MBB=CompNeg BB DD=CompSub (CompSqr BB) (CompMul Four (CompMul AA CC)) RR=CompMul DVA AA XX1=CompDiv1 (CompSub MBB (CompSqrt DD)) RR XX2=CompDiv1 (CompSum MBB (CompSqrt DD)) RR YY1=CompDiv1 (CompSub (CompMul XX1 DY) Z) DX YY2=CompDiv1 (CompSub (CompMul XX2 DY) Z) DX ) else ( Z=CompSub (CompMul Y1 X2) (CompMul X1 Y2) AA=CompSum (CompSum (CompMul A CompSqr DX) (CompMul B (CompMul DY DX))) (CompMul C (CompSqr DY)) BB=CompSum (CompSum (CompSub (CompMul MDVA (CompMul A (CompMul Z DX))) (CompMul B (CompMul Z DY))) (CompMul D(CompMul DY DX))) (CompMul EE (CompSqr DY)) CC=CompSum (CompMul F (CompSqr DY)) (CompMul Z (CompSub (CompMul A Z) (CompMul D DY))) MBB=CompNeg BB RR=CompMul DVA AA DD=CompSub (CompSqr BB) (CompMul Four (CompMul AA CC)) YY1=CompDiv1 (CompSub MBB (CompSqrt DD)) RR YY2=CompDiv1 (CompSum MBB (CompSqrt DD)) RR XX1=CompDiv1 (CompSub (CompMul YY1 DX) Z) DY XX2=CompDiv1 (CompSub (CompMul YY2 DX) Z) DY ) TOPoint_Create &pa XX1 YY1 1 Att_1 TOPoint_Create &pb XX2 YY2 1 Att_2 AddInc pa in_prm1 AddInc pa in_prm2 AddInc pb in_prm1 AddInc pb in_prm2 if IsReal Pa then ( EExecCX &C1 pa in_prm1 Att5 1 1 "0" EExecCX &C2 pb in_prm1 Att5 1 1 "0" if C1.C.ReEps) or ((Abs A.Im)> Eps) then ( YY1=Complex 1. 0. R1=CompNeg (CompMul B YY1) R2=CompMul (CompSqr B) (CompSqr YY1) R3=CompMul Four (CompMul A (CompMul C (CompSqr YY1))) R4=CompSub R1 (CompSqrt (CompSub R2 R3)) XX1=CompDiv1 R4 (CompMul DVA A ) TOPoint_Create &pa XX1 YY1 0 Att_1 R4=CompSum R1 (CompSqrt (CompSub R2 R3)) XX1=CompDiv1 R4 (CompMul DVA A ) TOPoint_Create &pb XX1 YY1 0 Att_2 ) else ( XX1=Complex 1. 0. YY1=Complex 0. 0. TOPoint_Create &pa XX1 YY1 0 Att_1 YY1=Complex 1. 0. XX1=CompDiv1 (CompNeg (CompMul C YY1)) B TOPoint_Create &pb XX1 YY1 0 Att_1 ) AddInc pa in_prm1 AddInc pa in_prm2 AddInc pb in_prm1 AddInc pb in_prm2 CreateCopy &out_prm1 pa out_prm1.FAtt=CopyAtt Att_1 CreateCopy &out_prm2 pb out_prm2.FAtt=CopyAtt Att_2 --out_prm1.AssignParents([in_Prm1,in_Prm2]); --out_prm2.AssignParents([in_Prm1,in_Prm2]); ) ) else ( TOEmpty_Create &Out_Prm1 Att_1 TOEmpty_Create &Out_Prm2 Att_2 --out_prm1.AssignParents([in_Prm1,in_Prm2]); --out_prm2.AssignParents([in_Prm1,in_Prm2]); ) Result=true ) -- EExecPG