matlab 简单显示多边形和线条和点

简介

有的时候关于3d的散点和面片,直接用matlab 显示比较方便。

code

scatter3(x1,y1,z1,'k');
hold on;
scatter3(x2,y2,z2,'*');
hold on;
scatter3(x3,y3,z3,'*');
hold on;
line(x2,y2,z2);
hold on;
line(x3, y3, z3);
hold on;
% 交点 [-0.36127193633560406, 1.0, 6.1625138029061395]
x4=[-0.36127193633560406];
y4=[1.0];
z4=[6.1625138029061395];
scatter3(x4,y4,z4,'.');
hold on;
line(x1,y1,z1);
hold on;
x5 = [-0.00196542421612822, -0.00196542421612822, -0.7911059336125219];
y5 = [1.5, 0.5, 0.5];
z5 = [5.7008767866976084, 5.7008767866976084, 5.08666407400794];
patch(x5,y5,z5, 'green');
hold on;
x6=[-0.6161781369057966, -0.6161781369057966, -1.4053186463021903];
y6=[1.5,0.5,0.5];
z6=[6.490017296094002, 6.490017296094002, 5.875804583404333];
patch(x6,y6,z6, 'yellow');
hold on;
x7=[-0.00196542421612822,-0.6161781369057966,-0.6161781369057966];
y7=[1.5,1.5,0.5];
z7=[5.7008767866976084, 6.490017296094002, 6.490017296094002];
patch(x7,y7,z7, 'red');
hold on;
x8=[-0.7911059336125219,-1.4053186463021903,-1.4053186463021903];
y8=[0.5,0.5,1.5];
z8=[5.08666407400794, 5.875804583404333, 5.875804583404333];
patch(x8,y8,z8, 'blue');

image

matlab 简单显示多边形和线条和点

上一篇:接口测试基础知识


下一篇:Git 常用命令