Skip to content

Instantly share code, notes, and snippets.

@mckelvin
Created November 26, 2012 05:32
Show Gist options
  • Save mckelvin/4146732 to your computer and use it in GitHub Desktop.
Save mckelvin/4146732 to your computer and use it in GitHub Desktop.
for a=0:112;
for b=0:60;
u=a/2;
w=b/2;
v=w/50-0.3;
X(a+1,b+1)=cos(u)+v\*cos(u/2)\*cos(u);
Y(a+1,b+1)=sin(u)+v\*cos(u/2)\*sin(u);
Z(a+1,b+1)=v*sin(u/2);
T(a+1,b+1)=u;
end
end
surf(X,Y,Z,-X)
view(55, 50)
shading interp
camlight;lighting gouraud;
material dull
set(gcf, 'color', 'w')
colormap(winter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment