• Remix
  • Share
  • New Entry

on 2 Dec 2023
  • 2
  • 32
  • 0
  • 1
  • 444
drawframe(24);
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
dth = pi/100;
[R,T]=ndgrid(dth/4:dth/4:pi/4,dth:dth:pi);
% Assess a petals curve
openRate = (24-abs(24-f))/24;
W=R.*((1-abs((1-mod(T,2))))*.7+.3)* openRate;;
% Compute the disk with the petals
X=W.*cospi(T+dth*2*f+4*pi/8);
Y=W.*sinpi(T+dth*2*f+4*pi/8);
% Convert Z to have an S model to it to make it fluted
Z=(-cospi(W*1.4)+1).^.3 * openRate^2;
% Graph the stamen
g=@(i)i((20:50),50)/4;;
plot3(g(X)*openRate,g(Y)*openRate,g(Z*4)*openRate,'o',Color='#FB3');
% Draw complete flower
surface(X*openRate,Y*openRate,Z*openRate);
shading interp
% Perfect the Axes, etc
axis equal off
xlim([-0.7 0.7])
ylim([-0.7 0.7])
zlim([0 1.2])
light
material([.8
.8
.4])
colormap red
set(gcf,Color='#2a2')
end
Animation
Remix Tree