www.gusucode.com > smith圆图matlab源码程序 > smith/calledit4.m

    function calledit4(h_edit1,h_edit2,h_edit3)
l=str2double(get(h_edit3,'string'));
af=(l/0.125)*pi/2;

m=str2double(get(h_edit1,'string'));
n=str2double(get(h_edit2,'string'));
x1=(m^2-1+n^2)/(m^2+2*m+1+n^2);
y1=2*n/(m^2+2*m+1+n^2);
rr=sqrt(x1^2+y1^2);
disp(double(rr));

if y1>=0
    bt=acos(x1/rr);
else
    bt=2*pi-acos(x1/rr);
end

st=bt-af;
x2=rr*cos(st)
y2=rr*sin(st)
xxx=(1-(x2^2+y2^2))/((1-x2)^2+y2^2);
yyy=(2*y2)/((1-x2)^2+y2^2);
disp(xxx)
disp(yyy)
hold on
plot(x2,y2,'ok')

if x2>=0
x3=0:0.01:x2;
y3=y2/x2*x3;
hold on
plot(x3,y3,'k');
end
if x2<0
x3=x2:0.01:0;
y3=y2/x2*x3;
hold on
plot(x3,y3,'k');
end

if y1>=0
    cc=(pi-bt)/(4*pi)
else
    cc=(3*pi-bt)/(4*pi)
end
dd=cc+l;
disp(cc)
disp(dd)