prss.net
当前位置:首页 >> MATLAB心形曲线的绘制 >>

MATLAB心形曲线的绘制

clear all;clc; x=-2:0.01:2; y=sqrt(2*sqrt(x.^2)-x.^2); z=asin(abs(x)-1)-pi./2; plot(x,y);grid on;hold on; plot(x,z); axis([-2,2,-2,2]);

输入以下程序即可: clear clc a=1; t=0:0.01:2*pi; x=a.*(2.*cos(t)-cos(2.*t)); y=a.*(2.*sin(t)-sin(2.*t)); plot(x,y) MATLAB(矩阵实验室)是MATrix LABoratory的缩写,是一款由美国The MathWorks公司出品的商业数学软件。MATLAB是一种用于...

[x y z]=meshgrid(-1.5:0.02:1.5); v=(x.^2+9/4*y.^2+z.^2-1).^3-x.^2.*z.^3-9/80*y.^2.*z.^3; p=isosurface(x,y,z,v,0); figure(1);clf; patch(p,'edgecolor','none','facecolor','w'); h=contourslice(x,y,z,v,-1.5:0.3:1.5,-1.5:0.3:1.5,-1.5...

首先你得给出心形线的表达式,例如: 极坐标表达式:ρ = a*(1-cos(t)) 参数方程:x=a*(2*cos(t)-cos(2*t)),y=a*(2*sin(t)-sin(2*t)) 相应地,可以使用polar()函数极坐标绘图,或者根据参数方程使用plot()函数进行直角坐标系绘图 1 极坐标绘图 >...

程序代码和图形如下: %1心形线 clc;clear;close all; i=-pi:0.1:pi; x=2.*(sin(i)-sin(2*i)./2); y=2.*(cos(i)-cos(i).^2); figure(1); plot(x,y);grid on;box on; axis([-3 3 -4.2 1]); title('心形线');xlabel('x');ylabel('y'); %2马鞍面 cl...

源代码: [x,y,z]=meshgrid(linspace(-1.3,1.3)); val=(x.^2 + (9/4)*y.^2 + z.^2 - 1).^3 - x.^2.*z.^3 - (1/9)*y.^2.*z.^3; isosurface(x,y,z,val,0); axis equal;view(-10,24);colormap([1 0.2 0.2])

t=0:pi/100:2*pi; a=20; x=a*(2*cos(t)-cos(2*t)); y=a*(2*sin(t)-sin(2*t)); plot(y,x)

clc,clear close all [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*...

源代码: [x,y,z]=meshgrid(linspace(-1.3,1.3)); val=(x.^2 + (9/4)*y.^2 + z.^2 - 1).^3 - x.^2.*z.^3 - (1/9)*y.^2.*z.^3; isosurface(x,y,z,val,0); axis equal;view(-10,24);colormap([1 0.2 0.2])

[x y z]=meshgrid(-1.5:0.02:1.5);v=(x.^2+9/4*y.^2+z.^2-1).^3-x.^2.*z.^3-9/80*y.^2.*z.^3;p=isosurface(x,y,z,v,0);figure(1);clf;patch(p,'edgecolor','none','facecolor','w');h=contourslice(x,y,z,v,-1.5:0.3:1.5,-1.5:0.3:1.5,-1.5:0.3:...

网站首页 | 网站地图
All rights reserved Powered by www.prss.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com