其他分享
首页 > 其他分享> > 初学者用matlab画画(不务正业了属于是)

初学者用matlab画画(不务正业了属于是)

作者:互联网

刚开始学哈哈 各位同学俺画的还行吗~

a=[0:pi/40:2*pi];
r=2;
x=r*cos(a);
y=r*sin(a);%%head

b=[pi/6:pi/40:4/3*pi];
R=2*sin(pi/4);
z=-R+cos(b);
w=R+sin(b);%%left ear

b1=[pi/6:pi/40:4/3*pi];
R1=2*sin(pi/4);
z1=-R1+0.5*cos(b1);
w1=R1+0.5*sin(b1);

c=[-pi/3:pi/40:6*pi/7];
T=2*sin(pi/4);
m=T+cos(c);
n=T+sin(c);%%right ear

c1=[-pi/3:pi/40:6*pi/7];
T1=2*sin(pi/4);
m1=T1+0.5*cos(c1);
n1=T1+0.5*sin(c1);

f = [0:pi/40:2*pi];%%left eye
l = -0.7+0.1*cos(f);
o = 0.7+0.1*sin(f);

i = [0:pi/40:2*pi];%%right eye
s = 0.7+0.1*cos(i);
t = 0.7+0.1*sin(i);

d=[0:pi/40:2*pi];
W=0.1;
p=W*cos(d);
q=W*sin(d);%%nose

e=[0 0]
f=[-0.1 -0.3]%%renzhong

g = [-5/6*pi:pi/40:0];
u = -0.6+0.6*cos(g);
v = -0.3+0.6*sin(g);%%left mouse

h = [-pi:pi/40:-pi/6];
j = 0.6+0.6*cos(h);
k = -0.3+0.6*sin(h);%%right mouse

plot(x,y,'b',z,w,'b',z1,w1,'k',m,n,'b',m1,n1,'k',l,o,'k',s,t,'k',p,q,'k',e,f,'-',u,v,'r',j,k,'r');
axis equal

这是代码哈哈

标签:cos,%%,不务正业,40,0.6,matlab,pi,sin,初学者
来源: https://blog.csdn.net/qq_59026709/article/details/122759227