表白神器(代码)( word 可编辑版)

2023-02-15 22:15:12   第一文档网     [ 字体: ] [ 阅读: ] [ 文档下载 ]

#第一文档网# 导语】以下是®第一文档网的小编为您整理的《表白神器(代码)( word 可编辑版)》,欢迎阅读!
神器,表白,编辑,代码,word
>> clc clear

[X,Y,Z] = meshgrid(linspace(-3,3,101));

F = -X.^2.*Z.^3-(9/80).*Y.^2.*Z.^3+(X.^2+(9/4).*Y.^2+Z.^2-1).^3; hFigure = figure;

sz = get(hFigure, 'Position');

set(hFigure, 'Position', [sz(1)-0.15*sz(3) sz(2) 1.3*sz(3) sz(4)]); set(hFigure,'color','w', 'menu','none')

hAxes = axes('Parent',hFigure,'NextPlot','add',... 'DataAspectRatio',[1 1 1],...

'XLim',[30 120],'YLim',[35 65],'ZLim',[30 75]); view([-39 30]); axis off hidden on

p = patch(isosurface(F,-0.001)); set(p,'FaceColor','w','EdgeColor','none');

for iX = [35 38 41 45 48 51 54 57 61 64 67] plane = reshape(F(:,iX,:),101,101); cData = contourc(plane,[0 0]); xData = iX.*ones(1,cData(2,1));


plot3(hAxes,xData,cData(2,2:end),cData(1,2:end),'k'); pause(.1), drawnow end

for iY = [41 44 47 51 55 58 61] plane = reshape(F(iY,:,:),101,101); cData = contourc(plane,[0 0]); yData = iY.*ones(1,cData(2,1));

plot3(hAxes,cData(2,2:end),yData,cData(1,2:end),'k'); pause(.1), drawnow end

for iZ = [36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 69 71] plane = F(:,:,iZ);

cData = contourc(plane,[0 0]); startIndex = 1;

if size(cData,2) > (cData(2,1)+1) startIndex = cData(2,1)+2; zData = iZ.*ones(1,cData(2,1));

plot3(hAxes,cData(1,2:(startIndex-1)),... cData(2,2:(startIndex-1)),zData,'k'); end


本文来源:https://www.dy1993.cn/h0LK.html

相关推荐