• 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

    Hope is a good thing,maybe the best of things,and no good thing ever dies.----------- Andy Dufresne
  • 相关阅读:
    bzoj 1858 线段树
    bzoj 1877 最小费用流
    bzoj 1833 数位dp
    Codeforces Round #285 (Div. 1) B
    HDU2028 Lowest Common Multiple Plus
    HDU5706 GirlCat
    HDU2022 海选女主角
    687E: TOF
    687D: Dividing Kingdom II
    687D: Dividing Kingdom II
  • 原文地址:https://www.cnblogs.com/eat-too-much/p/13764254.html
Copyright © 2020-2023  润新知