- /
-
Butterfly Math Function
on 22 Oct 2024
- 25
- 165
- 0
- 0
- 893
"To The Sky" by Owl City
drawframe(1);
Write your drawframe function below
% Everything in this World is Math Function
% Maths Function by Dhimas Mahardika S.Si., M.Mat.
% from Sanggung Utara, Jatingaleh, Candisari
% Universitas Diponegoro Tembalang
% Universitas Nasional Karangturi Semarang
function drawframe(f)
t = linspace(0,2*pi);
h = linspace(0,2*pi,96);
h1= linspace(0.25,4*pi+0.25,96);
a=h(f)
a1=h1(f)
p=sin(t-0.07).*((cos(t-0.16)).^2).*sin(t)
q=0.8*sin(t-0.07).*((cos(t-0.16)).^2).*cos(t)
p1=p.*sin(a1)
q1=-p.*cos(a1)
x=p1
y=q.*sin(pi/2)+(q1-0.7).*cos(pi/2)
z=(q1-0.7).*sin(pi/2)-q.*cos(pi/2)
x1=-p1
y1=q.*sin(pi/2)+(q1-0.7).*cos(pi/2)
z1=(q1-0.7).*sin(pi/2)-q.*cos(pi/2)
x2=0.7*p1
y2=0.7*q.*sin(pi/2) + 0.7*(q1-1).*cos(pi/2)
z2=0.7*(q1-1).*sin(pi/2) - 0.7*q.*cos(pi/2)
x3=-0.7*p1
y3=0.7*q.*sin(pi/2) + 0.7*(q1-1).*cos(pi/2)
z3=0.7*(q1-1).*sin(pi/2) - 0.7*q.*cos(pi/2)
x4=0.4*p1
y4=0.4*q.*sin(pi/2) + 0.4*(q1-1.75).*cos(pi/2)
z4=0.4*(q1-1.75).*sin(pi/2) - 0.4*q.*cos(pi/2)
x5=-0.4*p1
y5=0.4*q.*sin(pi/2) + 0.4*(q1-1.75).*cos(pi/2)
z5=0.4*(q1-1.75).*sin(pi/2) - 0.4*q.*cos(pi/2)
plot3(x,y,z,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,x5,y5,z5,'LineWidth',2,'Color',[0 0 1])
MeshDensity=5555
axis equal
axis([-0.4 0.4 -0.25 0.4 -1.05 -0.3])
end