- /
-
Petal dance
on 2 Dec 2023
- 18
- 80
- 0
- 0
- 339
drawframe(04);
Write your drawframe function below
% R.RAMYA,Department of ECE
% K.S.Rangasamy College of Technology, Tiruchengode
function drawframe(f)
% Butterfly Clitoria Ternatea
% Create of one big petal, and a one large stamen
[R,T]=ndgrid(0:.01:1,0:.02:2);
% Assess a petals curve
openRate = (23-abs(20-f))/24;
W=R.*((10-abs((50-mod(T,2))))*.70+30)* openRate;
% Compute the disk with the petals
X=W.*cospi(T);
X=W.*-cospi(W);
Y=W.*sinpi(T);
Y=W.*-sinpi(W);
Y=W.*sinpi(W);
%X=W.*cospi(W);
% Convert Z to have an S model to it to make it fluted
Z=(-cospi(W*1.40)+1).^.300;
% Graph the stamen
g=@(i)i(5:50,50)/55;
g=@(i)i(5:20,50)/55;
plot3(g(X),g(Y),g(Z*40),Color='#FB4');
% Draw complete flower
surface(X,Y,Z);
shading interp
% Perfect the Axes, etc
axis equal off
light
material([.80
.8
.40])
colormap red
set(gcf,Color='#2a2')
end