Area Swept by Vector
1 次查看(过去 30 天)
显示 更早的评论
I am looking to calculate the area swept by h{13}. That would be the area between h{14} and h{15}. How do I do this?
hold on
axis ([-20 20 -20 20])
axis off
P1=[-11,0];
P2=[-1,0];
h{1}=plot([P1(1) P2(1)],[P1(2) P2(2)],'LineWidth',5,'Color','black');
x=5*pi/8;
b=0:pi/40:x;
P7vct=nan(numel(b),2);
for k=1:numel(b)
Z=[4,0];
h{2}=viscircles(Z,5,'LineWidth',2,'LineStyle','--','Color','black');
A=[0,0];
h{3} = viscircles(A,1,'LineWidth',2,'Color','black');
PA=A+[cos(b(k)-(pi)),sin(b(k)-(pi))];
h{4}=viscircles(PA,.1,'Color','black');
B = [4-4*cos(2*asin(.25)),-4*sin(2*asin(.25))];
h{5} = viscircles(B,1,'LineWidth',2,'Color','green');
PB=B+[cos(-b(k)-(pi/2)),sin(-b(k)-(pi/2))];
h{6}=viscircles(PB,.1,'Color','green');
C = [4-4*cos(4*asin(.25)),-4*sin(4*asin(.25))];
h{7} = viscircles(C,1,'LineWidth',2,'Color','blue');
PC=C+[cos(b(k)-(pi/2)),sin(b(k)-(pi/2))];
h{8}=viscircles(PC,.1,'Color','blue');
D = [4-4*cos(6*asin(.25)),-4*sin(6*asin(.25))];
h{9} = viscircles(D,1,'LineWidth',2,'Color','red');
PD=D+[cos(-b(k)-(pi/2)),sin(-b(k)-(pi/2))];
h{10}=viscircles(PD,.1,'Color','red');
E = [4-4*cos(8*asin(.25)),-4*sin(8*asin(.25))];
h{11} = viscircles(E,1,'LineWidth',2,'Color','yellow');
PE=E+[cos(b(k)-(pi/2)),sin(b(k)-(pi/2))];
h{12}=viscircles(PE,.1,'Color','yellow');
P3=B+[cos(b(k)),sin(b(k))];
P4=C+[cos(b(k)),sin(b(k))];
P5=D+[cos(b(k)),sin(b(k))];
P6=E+[cos(b(k)-x),sin(b(k)-x)];
P7=E+[11*cos(b(k)-x),11*sin(b(k)-x)];
P6vct(k,:)=P6;
P7vct(k,:)=P7;
h{13} = plot([P6(1) P7(1)],[P6(2) P7(2)],'LineWidth',5,'Color','black');
h{14}=plot(P6vct(:,1),P6vct(:,2),'LineWidth',3,'Color','black');
h{15}=plot(P7vct(:,1),P7vct(:,2),'LineWidth',3,'Color','black');
drawnow();
pause(0.001);
if k<numel(b)
delete(vertcat(h{2:13}));
end
end
hold off
axis ([-20 20 -20 20])
axis off
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!