1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| C3=[(C2(1,1)+C1(1,1))/2,(C2(1,2)+C1(1,2))/2,300];
plot3(C2(1,1),C2(1,2),C2(1,3),'g-o','linewidth',2);
plot3(C1(1,1),C1(1,2),C1(1,3),'g-o','linewidth',2);
plot3(Pt1(1,1),Pt1(1,2),Pt1(1,3),'r-o','linewidth',5);
plot3(Pt2(1,1),Pt2(1,2),Pt2(1,3),'r-o','linewidth',5);
plan=createplane(C1,C2,C3);
drawPlane3d(plan)
P1=projpointOnPlane(Pt1,plan);
P2=projpointOnPlane(Pt2,plan);
M=[P1;P2];
M=transpose(M);
plot3(M(1,:),M(2,:),M(3,:),'r')
P3=projpointOnPlane(Pt3,plan);
P4=projpointOnPlane(Pt4,plan);
M=[P3;P4];
M=transpose(M);
plot3(M(1,:),M(2,:),M(3,:))
plot3(P1(1,1),P1(1,2),P1(1,3),'r-o','linewidth',5);
plot3(P2(1,1),P2(1,2),P2(1,3),'r-o','linewidth',5);
plot3(P3(1,1),P3(1,2),P3(1,3),'b-o','linewidth',5);
plot3(P4(1,1),P4(1,2),P4(1,3),'b-o','linewidth',5);
M=[Pt1;Pt2];
M=transpose(M);
plot3(M(1,:),M(2,:),M(3,:),'r')
plot3(Pt3(1,1),Pt3(1,2),Pt3(1,3),'b-o','linewidth',5);
plot3(Pt4(1,1),Pt4(1,2),Pt4(1,3),'b-o','linewidth',5)
M=[Pt3;Pt4];
M=transpose(M);
plot3(M(1,:),M(2,:),M(3,:))
axis equal;
set(gca,'xlim',[-200 200])
set(gca,'ylim',[-200 200])
set(gca,'zlim',[300 600]) |
Partager