S11=PolarToRect(0.70,-57)
S11 = 0.381247325 - 0.587069398i
S12=PolarToRect(0.04,47)
S12 = 0.027279934 + 0.029254148i
S21=PolarToRect(10.5,136)
S21 = -7.553067904 + 7.29391289i
S22=PolarToRect(0.79,-33)
S22 = 0.662549749 - 0.430264838i
A=Conj(S11)
A = 0.381247325 + 0.587069398i
Arg(A)
Ans = 57
Abs(A)
Ans = 0.7
' stab factor
delta=S11*S22-S12*S21
delta = 0.419424405 - 0.531018898i
Abs(delta)
Ans = 0.676681536
Arg(delta)
Ans = -51.69661455
k=(1-Abs(S11)^2-Abs(S22)^2+Abs(delta)^2) / (2*Abs(S12*S21))
k = 0.409283216
Cin=Conj(S11-Conj(S22)*delta)/ (Abs(S11)^2-Abs(delta)^2 )
Cin = -3.897594728 + 12.949512775i
Rin=Abs( S12*S21 / ( Abs(S11)^2-Abs(delta)^2 ) )
Rin = 13.08325689
Abs(Cin)
Ans = 13.523354827
Arg(Cin)
Ans = 106.75094833
Rout=Abs( S12*S21 / ( Abs(S22)^2-Abs(delta)^2 ) )
Rout = 2.527043907
Cout=Conj(S22-Conj(S11)*delta)/ (Abs(S22)^2-Abs(delta)^2 )
Cout = 1.14860386 + 2.852229548i
Abs(Cout)
Ans = 3.074817754
Arg(Cout)
Ans = 68.065163428