• Remix
  • Share
  • New Entry

  • Dhimas Mahardika

  • /
  • Creating Butterflies using Mathematics Formula (Parametric Equation)

on 14 Oct 2024
  • 78
  • 842
  • 1
  • 0
  • 1532
Song title "Fireflies" by Owl City
drawframe(1);
a = 0
a1 = 0.2500
p = 1×100
0 -0.0004 0.0072 0.0227 0.0455 0.0745 0.1082 0.1448 0.1822 0.2183 0.2510 0.2785 0.2991 0.3117 0.3155 0.3103 0.2964 0.2745 0.2461 0.2128 0.1764 0.1391 0.1030 0.0701 0.0421 0.0206 0.0065 0.0003 0.0021 0.0113
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
q = 1×100
-0.0545 -0.0052 0.0451 0.0943 0.1403 0.1815 0.2162 0.2433 0.2619 0.2717 0.2727 0.2655 0.2510 0.2303 0.2051 0.1768 0.1471 0.1177 0.0899 0.0650 0.0439 0.0270 0.0145 0.0063 0.0016 -0.0003 -0.0004 -0.0000 -0.0003 -0.0025
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
p1 = 1×100
0 -0.0001 0.0018 0.0056 0.0113 0.0184 0.0268 0.0358 0.0451 0.0540 0.0621 0.0689 0.0740 0.0771 0.0781 0.0768 0.0733 0.0679 0.0609 0.0526 0.0436 0.0344 0.0255 0.0173 0.0104 0.0051 0.0016 0.0001 0.0005 0.0028
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
q1 = 1×100
0 0.0004 -0.0070 -0.0220 -0.0441 -0.0722 -0.1048 -0.1403 -0.1765 -0.2115 -0.2432 -0.2698 -0.2898 -0.3020 -0.3057 -0.3006 -0.2871 -0.2660 -0.2385 -0.2062 -0.1709 -0.1348 -0.0998 -0.0679 -0.0408 -0.0200 -0.0063 -0.0003 -0.0020 -0.0110
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x = 1×100
0 -0.0001 0.0018 0.0056 0.0113 0.0184 0.0268 0.0358 0.0451 0.0540 0.0621 0.0689 0.0740 0.0771 0.0781 0.0768 0.0733 0.0679 0.0609 0.0526 0.0436 0.0344 0.0255 0.0173 0.0104 0.0051 0.0016 0.0001 0.0005 0.0028
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y = 1×100
-0.7000 -0.6996 -0.7070 -0.7220 -0.7441 -0.7722 -0.8048 -0.8403 -0.8765 -0.9115 -0.9432 -0.9698 -0.9898 -1.0020 -1.0057 -1.0006 -0.9871 -0.9660 -0.9385 -0.9062 -0.8709 -0.8348 -0.7998 -0.7679 -0.7408 -0.7200 -0.7063 -0.7003 -0.7020 -0.7110
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z = 1×100
0.0545 0.0052 -0.0451 -0.0943 -0.1403 -0.1815 -0.2162 -0.2433 -0.2619 -0.2717 -0.2727 -0.2655 -0.2510 -0.2303 -0.2051 -0.1768 -0.1471 -0.1177 -0.0899 -0.0650 -0.0439 -0.0270 -0.0145 -0.0063 -0.0016 0.0003 0.0004 0.0000 0.0003 0.0025
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x1 = 1×100
0 0.0001 -0.0018 -0.0056 -0.0113 -0.0184 -0.0268 -0.0358 -0.0451 -0.0540 -0.0621 -0.0689 -0.0740 -0.0771 -0.0781 -0.0768 -0.0733 -0.0679 -0.0609 -0.0526 -0.0436 -0.0344 -0.0255 -0.0173 -0.0104 -0.0051 -0.0016 -0.0001 -0.0005 -0.0028
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y1 = 1×100
-0.7000 -0.6996 -0.7070 -0.7220 -0.7441 -0.7722 -0.8048 -0.8403 -0.8765 -0.9115 -0.9432 -0.9698 -0.9898 -1.0020 -1.0057 -1.0006 -0.9871 -0.9660 -0.9385 -0.9062 -0.8709 -0.8348 -0.7998 -0.7679 -0.7408 -0.7200 -0.7063 -0.7003 -0.7020 -0.7110
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z1 = 1×100
0.0545 0.0052 -0.0451 -0.0943 -0.1403 -0.1815 -0.2162 -0.2433 -0.2619 -0.2717 -0.2727 -0.2655 -0.2510 -0.2303 -0.2051 -0.1768 -0.1471 -0.1177 -0.0899 -0.0650 -0.0439 -0.0270 -0.0145 -0.0063 -0.0016 0.0003 0.0004 0.0000 0.0003 0.0025
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x2 = 1×100
0 -0.0001 0.0012 0.0039 0.0079 0.0129 0.0187 0.0251 0.0315 0.0378 0.0435 0.0482 0.0518 0.0540 0.0546 0.0537 0.0513 0.0475 0.0426 0.0368 0.0306 0.0241 0.0178 0.0121 0.0073 0.0036 0.0011 0.0001 0.0004 0.0020
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y2 = 1×100
-0.7000 -0.6997 -0.7049 -0.7154 -0.7309 -0.7505 -0.7734 -0.7982 -0.8235 -0.8480 -0.8702 -0.8889 -0.9029 -0.9114 -0.9140 -0.9104 -0.9010 -0.8862 -0.8669 -0.8443 -0.8196 -0.7944 -0.7699 -0.7475 -0.7286 -0.7140 -0.7044 -0.7002 -0.7014 -0.7077
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z2 = 1×100
0.0382 0.0036 -0.0316 -0.0660 -0.0982 -0.1271 -0.1514 -0.1703 -0.1833 -0.1902 -0.1909 -0.1859 -0.1757 -0.1612 -0.1435 -0.1237 -0.1030 -0.0824 -0.0629 -0.0455 -0.0307 -0.0189 -0.0102 -0.0044 -0.0011 0.0002 0.0003 0.0000 0.0002 0.0018
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x3 = 1×100
0 0.0001 -0.0012 -0.0039 -0.0079 -0.0129 -0.0187 -0.0251 -0.0315 -0.0378 -0.0435 -0.0482 -0.0518 -0.0540 -0.0546 -0.0537 -0.0513 -0.0475 -0.0426 -0.0368 -0.0306 -0.0241 -0.0178 -0.0121 -0.0073 -0.0036 -0.0011 -0.0001 -0.0004 -0.0020
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y3 = 1×100
-0.7000 -0.6997 -0.7049 -0.7154 -0.7309 -0.7505 -0.7734 -0.7982 -0.8235 -0.8480 -0.8702 -0.8889 -0.9029 -0.9114 -0.9140 -0.9104 -0.9010 -0.8862 -0.8669 -0.8443 -0.8196 -0.7944 -0.7699 -0.7475 -0.7286 -0.7140 -0.7044 -0.7002 -0.7014 -0.7077
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z3 = 1×100
0.0382 0.0036 -0.0316 -0.0660 -0.0982 -0.1271 -0.1514 -0.1703 -0.1833 -0.1902 -0.1909 -0.1859 -0.1757 -0.1612 -0.1435 -0.1237 -0.1030 -0.0824 -0.0629 -0.0455 -0.0307 -0.0189 -0.0102 -0.0044 -0.0011 0.0002 0.0003 0.0000 0.0002 0.0018
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x4 = 1×100
0 -0.0000 0.0007 0.0022 0.0045 0.0074 0.0107 0.0143 0.0180 0.0216 0.0248 0.0276 0.0296 0.0308 0.0312 0.0307 0.0293 0.0272 0.0244 0.0211 0.0175 0.0138 0.0102 0.0069 0.0042 0.0020 0.0006 0.0000 0.0002 0.0011
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y4 = 1×100
-0.7000 -0.6998 -0.7028 -0.7088 -0.7176 -0.7289 -0.7419 -0.7561 -0.7706 -0.7846 -0.7973 -0.8079 -0.8159 -0.8208 -0.8223 -0.8203 -0.8149 -0.8064 -0.7954 -0.7825 -0.7684 -0.7539 -0.7399 -0.7272 -0.7163 -0.7080 -0.7025 -0.7001 -0.7008 -0.7044
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z4 = 1×100
0.0218 0.0021 -0.0180 -0.0377 -0.0561 -0.0726 -0.0865 -0.0973 -0.1048 -0.1087 -0.1091 -0.1062 -0.1004 -0.0921 -0.0820 -0.0707 -0.0588 -0.0471 -0.0360 -0.0260 -0.0176 -0.0108 -0.0058 -0.0025 -0.0006 0.0001 0.0002 0.0000 0.0001 0.0010
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x5 = 1×100
0 0.0000 -0.0007 -0.0022 -0.0045 -0.0074 -0.0107 -0.0143 -0.0180 -0.0216 -0.0248 -0.0276 -0.0296 -0.0308 -0.0312 -0.0307 -0.0293 -0.0272 -0.0244 -0.0211 -0.0175 -0.0138 -0.0102 -0.0069 -0.0042 -0.0020 -0.0006 -0.0000 -0.0002 -0.0011
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y5 = 1×100
-0.7000 -0.6998 -0.7028 -0.7088 -0.7176 -0.7289 -0.7419 -0.7561 -0.7706 -0.7846 -0.7973 -0.8079 -0.8159 -0.8208 -0.8223 -0.8203 -0.8149 -0.8064 -0.7954 -0.7825 -0.7684 -0.7539 -0.7399 -0.7272 -0.7163 -0.7080 -0.7025 -0.7001 -0.7008 -0.7044
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z5 = 1×100
0.0218 0.0021 -0.0180 -0.0377 -0.0561 -0.0726 -0.0865 -0.0973 -0.1048 -0.1087 -0.1091 -0.1062 -0.1004 -0.0921 -0.0820 -0.0707 -0.0588 -0.0471 -0.0360 -0.0260 -0.0176 -0.0108 -0.0058 -0.0025 -0.0006 0.0001 0.0002 0.0000 0.0001 0.0010
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x6 = 1×100
0 -0.0001 0.0018 0.0056 0.0113 0.0184 0.0268 0.0358 0.0451 0.0540 0.0621 0.0689 0.0740 0.0771 0.0781 0.0768 0.0733 0.0679 0.0609 0.0526 0.0436 0.0344 0.0255 0.0173 0.0104 0.0051 0.0016 0.0001 0.0005 0.0028
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y6 = 1×100
-0.0545 -0.0052 0.0451 0.0943 0.1403 0.1815 0.2162 0.2433 0.2619 0.2717 0.2727 0.2655 0.2510 0.2303 0.2051 0.1768 0.1471 0.1177 0.0899 0.0650 0.0439 0.0270 0.0145 0.0063 0.0016 -0.0003 -0.0004 -0.0000 -0.0003 -0.0025
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z6 = 1×100
-0.7000 -0.6996 -0.7070 -0.7220 -0.7441 -0.7722 -0.8048 -0.8403 -0.8765 -0.9115 -0.9432 -0.9698 -0.9898 -1.0020 -1.0057 -1.0006 -0.9871 -0.9660 -0.9385 -0.9062 -0.8709 -0.8348 -0.7998 -0.7679 -0.7408 -0.7200 -0.7063 -0.7003 -0.7020 -0.7110
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x7 = 1×100
0 0.0001 -0.0018 -0.0056 -0.0113 -0.0184 -0.0268 -0.0358 -0.0451 -0.0540 -0.0621 -0.0689 -0.0740 -0.0771 -0.0781 -0.0768 -0.0733 -0.0679 -0.0609 -0.0526 -0.0436 -0.0344 -0.0255 -0.0173 -0.0104 -0.0051 -0.0016 -0.0001 -0.0005 -0.0028
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y7 = 1×100
-0.0545 -0.0052 0.0451 0.0943 0.1403 0.1815 0.2162 0.2433 0.2619 0.2717 0.2727 0.2655 0.2510 0.2303 0.2051 0.1768 0.1471 0.1177 0.0899 0.0650 0.0439 0.0270 0.0145 0.0063 0.0016 -0.0003 -0.0004 -0.0000 -0.0003 -0.0025
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z7 = 1×100
-0.7000 -0.6996 -0.7070 -0.7220 -0.7441 -0.7722 -0.8048 -0.8403 -0.8765 -0.9115 -0.9432 -0.9698 -0.9898 -1.0020 -1.0057 -1.0006 -0.9871 -0.9660 -0.9385 -0.9062 -0.8709 -0.8348 -0.7998 -0.7679 -0.7408 -0.7200 -0.7063 -0.7003 -0.7020 -0.7110
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x8 = 1×100
0 -0.0001 0.0012 0.0039 0.0079 0.0129 0.0187 0.0251 0.0315 0.0378 0.0435 0.0482 0.0518 0.0540 0.0546 0.0537 0.0513 0.0475 0.0426 0.0368 0.0306 0.0241 0.0178 0.0121 0.0073 0.0036 0.0011 0.0001 0.0004 0.0020
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y8 = 1×100
-0.0382 -0.0036 0.0316 0.0660 0.0982 0.1271 0.1514 0.1703 0.1833 0.1902 0.1909 0.1859 0.1757 0.1612 0.1435 0.1237 0.1030 0.0824 0.0629 0.0455 0.0307 0.0189 0.0102 0.0044 0.0011 -0.0002 -0.0003 -0.0000 -0.0002 -0.0018
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z8 = 1×100
-0.7000 -0.6997 -0.7049 -0.7154 -0.7309 -0.7505 -0.7734 -0.7982 -0.8235 -0.8480 -0.8702 -0.8889 -0.9029 -0.9114 -0.9140 -0.9104 -0.9010 -0.8862 -0.8669 -0.8443 -0.8196 -0.7944 -0.7699 -0.7475 -0.7286 -0.7140 -0.7044 -0.7002 -0.7014 -0.7077
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x9 = 1×100
0 0.0001 -0.0012 -0.0039 -0.0079 -0.0129 -0.0187 -0.0251 -0.0315 -0.0378 -0.0435 -0.0482 -0.0518 -0.0540 -0.0546 -0.0537 -0.0513 -0.0475 -0.0426 -0.0368 -0.0306 -0.0241 -0.0178 -0.0121 -0.0073 -0.0036 -0.0011 -0.0001 -0.0004 -0.0020
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y9 = 1×100
-0.0382 -0.0036 0.0316 0.0660 0.0982 0.1271 0.1514 0.1703 0.1833 0.1902 0.1909 0.1859 0.1757 0.1612 0.1435 0.1237 0.1030 0.0824 0.0629 0.0455 0.0307 0.0189 0.0102 0.0044 0.0011 -0.0002 -0.0003 -0.0000 -0.0002 -0.0018
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z9 = 1×100
-0.7000 -0.6997 -0.7049 -0.7154 -0.7309 -0.7505 -0.7734 -0.7982 -0.8235 -0.8480 -0.8702 -0.8889 -0.9029 -0.9114 -0.9140 -0.9104 -0.9010 -0.8862 -0.8669 -0.8443 -0.8196 -0.7944 -0.7699 -0.7475 -0.7286 -0.7140 -0.7044 -0.7002 -0.7014 -0.7077
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x10 = 1×100
0 -0.0000 0.0007 0.0022 0.0045 0.0074 0.0107 0.0143 0.0180 0.0216 0.0248 0.0276 0.0296 0.0308 0.0312 0.0307 0.0293 0.0272 0.0244 0.0211 0.0175 0.0138 0.0102 0.0069 0.0042 0.0020 0.0006 0.0000 0.0002 0.0011
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y10 = 1×100
-0.0218 -0.0021 0.0180 0.0377 0.0561 0.0726 0.0865 0.0973 0.1048 0.1087 0.1091 0.1062 0.1004 0.0921 0.0820 0.0707 0.0588 0.0471 0.0360 0.0260 0.0176 0.0108 0.0058 0.0025 0.0006 -0.0001 -0.0002 -0.0000 -0.0001 -0.0010
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z10 = 1×100
-0.7000 -0.6998 -0.7028 -0.7088 -0.7176 -0.7289 -0.7419 -0.7561 -0.7706 -0.7846 -0.7973 -0.8079 -0.8159 -0.8208 -0.8223 -0.8203 -0.8149 -0.8064 -0.7954 -0.7825 -0.7684 -0.7539 -0.7399 -0.7272 -0.7163 -0.7080 -0.7025 -0.7001 -0.7008 -0.7044
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x11 = 1×100
0 0.0000 -0.0007 -0.0022 -0.0045 -0.0074 -0.0107 -0.0143 -0.0180 -0.0216 -0.0248 -0.0276 -0.0296 -0.0308 -0.0312 -0.0307 -0.0293 -0.0272 -0.0244 -0.0211 -0.0175 -0.0138 -0.0102 -0.0069 -0.0042 -0.0020 -0.0006 -0.0000 -0.0002 -0.0011
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y11 = 1×100
-0.0218 -0.0021 0.0180 0.0377 0.0561 0.0726 0.0865 0.0973 0.1048 0.1087 0.1091 0.1062 0.1004 0.0921 0.0820 0.0707 0.0588 0.0471 0.0360 0.0260 0.0176 0.0108 0.0058 0.0025 0.0006 -0.0001 -0.0002 -0.0000 -0.0001 -0.0010
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
z11 = 1×100
-0.7000 -0.6998 -0.7028 -0.7088 -0.7176 -0.7289 -0.7419 -0.7561 -0.7706 -0.7846 -0.7973 -0.8079 -0.8159 -0.8208 -0.8223 -0.8203 -0.8149 -0.8064 -0.7954 -0.7825 -0.7684 -0.7539 -0.7399 -0.7272 -0.7163 -0.7080 -0.7025 -0.7001 -0.7008 -0.7044
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
MeshDensity = 5555
Write your drawframe function below
% Using Mathematics we can create any objects and their simulation
% Graph of Equation created by Dhimas Mahardika S.Si., M.Mat.
% from
% Sanggung Utara, Jatingaleh, Candisari, Semarang
% Universitas Nasional Karangturi Semarang
% Universitas Diponegoro Tembalang
function drawframe(f)
t = linspace(0,2*pi);
h = linspace(0,2*pi,96);
h1= linspace(0.25,6*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(a)+(q1-0.7).*cos(a)
z=(q1-0.7).*sin(a)-q.*cos(a)
x1=-p1
y1=q.*sin(a)+(q1-0.7).*cos(a)
z1=(q1-0.7).*sin(a)-q.*cos(a)
x2=0.7*p1
y2=0.7*q.*sin(a) + 0.7*(q1-1).*cos(a)
z2=0.7*(q1-1).*sin(a) - 0.7*q.*cos(a)
x3=-0.7*p1
y3=0.7*q.*sin(a) + 0.7*(q1-1).*cos(a)
z3=0.7*(q1-1).*sin(a) - 0.7*q.*cos(a)
x4=0.4*p1
y4=0.4*q.*sin(a) + 0.4*(q1-1.75).*cos(a)
z4=0.4*(q1-1.75).*sin(a) - 0.4*q.*cos(a)
x5=-0.4*p1
y5=0.4*q.*sin(a) + 0.4*(q1-1.75).*cos(a)
z5=0.4*(q1-1.75).*sin(a) - 0.4*q.*cos(a)
x6=p1
y6=q.*sin(a+(pi/2))+(q1-0.7).*cos(a+(pi/2))
z6=(q1-0.7).*sin(a+(pi/2))-q.*cos(a+(pi/2))
x7=-p1
y7=q.*sin(a+(pi/2))+(q1-0.7).*cos(a+(pi/2))
z7=(q1-0.7).*sin(a+(pi/2))-q.*cos(a+(pi/2))
x8=0.7*p1
y8=0.7*q.*sin(a+(pi/2)) + 0.7*(q1-1).*cos(a+(pi/2))
z8=0.7*(q1-1).*sin(a+(pi/2)) - 0.7*q.*cos(a+(pi/2))
x9=-0.7*p1
y9=0.7*q.*sin(a+(pi/2)) + 0.7*(q1-1).*cos(a+(pi/2))
z9=0.7*(q1-1).*sin(a+(pi/2)) - 0.7*q.*cos(a+(pi/2))
x10=0.4*p1
y10=0.4*q.*sin(a+(pi/2)) + 0.4*(q1-1.75).*cos(a+(pi/2))
z10=0.4*(q1-1.75).*sin(a+(pi/2)) - 0.4*q.*cos(a+(pi/2))
x11=-0.4*p1
y11=0.4*q.*sin(a+(pi/2)) + 0.4*(q1-1.75).*cos(a+(pi/2))
z11=0.4*(q1-1.75).*sin(a+(pi/2)) - 0.4*q.*cos(a+(pi/2))
plot3(x,y,z,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,x5,y5,z5,...
x6,y6,z6,x7,y7,z7,x8,y8,z8,x9,y9,z9,x10,y10,z10,x11,y11,z11,'LineWidth',2,'Color',[1 0 0])
MeshDensity=5555
axis equal
axis([-0.5 0.5 -1.05 1.05 -1.05 1.05])
end
Movie
Audio
Remix Tree