image thumbnail

Rose Model

by

 

two example that generate a 3D rose.

roseplot1.m
clear,clc

[x,t] = meshgrid((0:24)/24,((0:575)/575*17-2)*pi);
p     = (pi/2)*exp(-t/8/pi);
u     = 1-(1-mod(3.6*t/pi,2)).^4/2;
y     = 2*(x.*(x-1)).^2.*sin(p);
r     = u.*(x.*sin(p)+y.*cos(p));
z     = u.*(x.*cos(p)-y.*sin(p));
y     = r.*sin(t);
x     = r.*cos(t);
figure('Color','k') 
surface(x,y,z,'EdgeColor','none','FaceColor','r')
view(-22,66),axis equal off
light('pos',[-.25 -.25 1], 'style','local', 'color',[1 .84 .6])
lighting gouraud

Contact us