function test
N = 100;
a =- 3;b =-2;
x = 4;
thetaA = angle(a+b*1i);
thetaB = angle(a+x+b*1i);
thetaC = angle(a+x+(b+x)*1i);
thetaD = angle(a+(b+x)*1i);
jAB = b;
jBC = a+x;
jCD = b+x;
jDA = a;
[r0,theta0] = rc(thetaA,thetaB,jAB,N);
[r1,theta1] = rr(thetaB,thetaC,jBC,N);
[r2,theta2] = rc(thetaC,thetaD,jCD,N);
if thetaA*thetaD<0 &&abs(thetaA)>pi/2
thetaA = thetaA+2*pi;
end
[r3,theta3] = rr(thetaD,thetaA,jDA,N);
r = abs([r0,r1,r2,r3]);
theta = [theta0,theta1,theta2,theta3];
polar(theta,r)
function [r,theta] = rc(theta1,theta2,rj,N)
dtheta = (theta2-theta1)/N;
theta = theta1:dtheta:theta2;
r = rj*csc(theta);
function [r,theta] = rr(theta1,theta2,rj,N)
dtheta = (theta2-theta1)/N;
theta = theta1:dtheta:theta2;
r = rj*sec(theta);
大神,能加个qq吗。747914489
追答不好意思,没用Q。贴出来吧,让大家都来帮你。
本回答被提问者采纳极坐标
追答a=1;b=1;x=2;q=pi/6;%斜度为pi/6
A=[a a+x*cos(q+pi/2) a+x*cos(q+pi/4)*sqrt(2) a+x*cos(q) a];
B=[b b+x*sin(q+pi/2) b+x*sin(q+pi/4)*sqrt(2) b+x*sin(q) b];
plot(A,B)
axis([0 5 0 5])
不是没人帮你,是你的问题提的太模糊了。。。
大神,加我扣扣吧747914489