|
|
Line 1: |
Line 1: |
| [[Image:Superformula.gif|right|frame|Some superformula samples: a=b=1; m, n1, n2 and n3 are shown in picture.]]
| | Let me first start by introducing myself. My name is Boyd Butts although it is not the name on my beginning certification. For a while I've been in South Dakota and my parents live nearby. My day occupation is a librarian. The preferred hobby for my kids and me is to play baseball and I'm attempting to make it a profession.<br><br>Also visit my website ... [http://saputraurl.cf/dietfooddelivery78594 http://saputraurl.cf] |
| | |
| The '''superformula''' is a generalization of the [[superellipse]] and was first proposed by [[Johan Gielis]].
| |
| | |
| Gielis suggested that the formula can be used to describe many complex shapes and curves that are found in nature.
| |
| | |
| In [[polar coordinates]], with <math>r</math> the radius and <math>\varphi</math> the angle, the superformula is:
| |
| | |
| <math>r\left(\varphi\right) =
| |
| \left[
| |
| \left|
| |
| \frac{\cos\left(\frac{m\varphi}{4}\right)}{a}
| |
| \right| ^{n_{2}}
| |
| +
| |
| \left|
| |
| \frac{\sin\left(\frac{m\varphi}{4}\right)}{b}
| |
| \right| ^{n_{3}}
| |
| \right] ^{-\frac{1}{n_{1}}}
| |
| </math>
| |
| | |
| The formula appeared in a work by Gielis. It was obtained by generalizing the superellipse, named and popularized by [[Piet Hein (Denmark)|Piet Hein]], a [[Denmark|Danish]] [[mathematician]].
| |
| | |
| == Plots ==
| |
| | |
| [[Image:Sf2d.png|480px| Other superformulas samples: a=b=1; m, n1, n2 and n3 are shown in picture.]]
| |
| | |
| == GNU_Octave program ==
| |
| A [[GNU Octave]] program for generating these figures:
| |
| | |
| <source lang="matlab">
| |
| function sf2d(n,a)
| |
| u=[0:.001:2*pi];
| |
| raux=abs(1/a(1).*abs(cos(n(1)*u/4))).^n(3)+abs(1/a(2).*abs(sin(n(1)*u/4))).^n(4);
| |
| r=abs(raux).^(-1/n(2));
| |
| x=r.*cos(u);
| |
| y=r.*sin(u);
| |
| plot(x,y);
| |
| end
| |
| </source>
| |
| | |
| == PHP script ==
| |
| A [[PHP]] script for generating these figures:
| |
| <source lang="php">
| |
| <?php
| |
| header("Content-type: image/png");
| |
| set_time_limit(120);
| |
| $img = imagecreatetruecolor(800, 800);
| |
| $black = imagecolorallocate($img, 0, 0, 0);
| |
| imagefilledrectangle($img, 0, 0, 800, 800, $black);
| |
| | |
| $center = 400;
| |
| $PI = 2 * pi();
| |
| | |
| $a = 1;
| |
| $b = 1;
| |
| $m = 12;
| |
| $n1 = 5;
| |
| $n2 = 6;
| |
| $n3 = 48;
| |
| | |
| for($f = 0; $f <= $PI; $f += 0.0001) {
| |
| $r= pow((pow(abs(cos($m*$f/4)/$a),$n2) + pow(abs(sin($m*$f/4)/$b), $n3)), -(1/$n1));
| |
| $x = $center + $r * cos ($f) * 100;
| |
| $y = $center + $r * sin ($f) * 100;
| |
| $col = imagecolorallocate($img, 255, 255, 255);
| |
| imagesetpixel($img, $x, $y, $col);
| |
| }
| |
| | |
| print imagepng($img);
| |
| imagedestroy($img);
| |
| ?>
| |
| </source>
| |
| | |
| ==Extension to higher dimensions ==
| |
| It is possible to extend the formula to 3, 4, or ''n'' dimensions, by means of [[spherical product]] of superformulas. For example, the [[dimension|3D]] [[parametric surface]] is obtained multiplying two superformulas ''r1'' and ''r2''. The coordinates are defined by the relations:
| |
| :<math> x \,=\, r_1(\theta)\cos(\theta)r_2(\phi)\cos(\phi)</math>
| |
| :<math> y \,=\, r_1(\theta)\sin(\theta)r_2(\phi)\cos(\phi)</math>
| |
| :<math> z \,=\, r_2(\phi)\sin(\phi)</math>
| |
| where <math>\phi</math> varies between ''-π/2'' and ''π/2'' ([[latitude]]) and ''θ'' between ''-π'' and ''π'' ([[longitude]]).
| |
| | |
| == Plots ==
| |
| <gallery>
| |
| Image:Sf3d_3257.svg|3D superformula: a=b=1; m, n1, n2 and n3 are shown in picture.
| |
| Image:Sf3d_3.5.5.5.svg|3D superformula: a=b=1; m, n1, n2 and n3 are shown in picture.
| |
| Image:Sf3d_3301515.svg|3D superformula: a=b=1; m, n1, n2 and n3 are shown in picture.
| |
| Image:Sf3d_7284.svg|3D superformula: a=b=1; m, n1, n2 and n3 are shown in picture.
| |
| Image:Sf3d_5111.svg|3D superformula: a=b=1; m, n1, n2 and n3 are shown in picture.
| |
| Image:sf3d_4.5.54.svg|3D superformula: a=b=1; m, n1, n2 and n3 are shown in picture.
| |
| Image:sf3d_8.5.58.svg|3D superformula: a=b=1; m, n1, n2 and n3 are shown in picture.
| |
| Image:Sf3d_4121515.svg|3D superformula: a=b=1; m, n1, n2 and n3 are shown in picture.
| |
| </gallery>
| |
| | |
| == GNU_Octave program ==
| |
| A [[GNU Octave]] program for generating these figures:
| |
| <source lang="matlab"> | |
| function sf3d(n, a)
| |
| u=[-pi:.05:pi];
| |
| v=[-pi/2:.05:pi/2];
| |
| nu=length(u);
| |
| nv=length(v);
| |
| for i=1:nu
| |
| for j=1:nv
| |
| raux1=abs(1/a(1)*abs(cos(n(1).*u(i)/4))).^n(3)+abs(1/a(2)*abs(sin(n(1)*u(i)/4))).^n(4);
| |
| r1=abs(raux1).^(-1/n(2));
| |
| raux2=abs(1/a(1)*abs(cos(n(1)*v(j)/4))).^n(3)+abs(1/a(2)*abs(sin(n(1)*v(j)/4))).^n(4);
| |
| r2=abs(raux2).^(-1/n(2));
| |
| x(i,j)=r1*cos(u(i))*r2*cos(v(j));
| |
| y(i,j)=r1*sin(u(i))*r2*cos(v(j));
| |
| z(i,j)=r2*sin(v(j));
| |
| endfor;
| |
| endfor;
| |
| mesh(x,y,z);
| |
| endfunction;
| |
| </source> | |
| | |
| ==References==
| |
| * {{Citation | last1=Gielis | first1=Johan | title=A generic geometric transformation that unifies a wide range of natural and abstract shapes | year=2003 | url= http://www.amjbot.org/cgi/content/abstract/90/3/333 | journal=[[American Journal of Botany]] | issn=0002-9122 | volume=90 | issue=3 | pages=333–338 | doi=10.3732/ajb.90.3.333}}
| |
| | |
| ==External links==
| |
| *[http://ssrn.com/abstract=913667 Some Experiments on Fitting of Gielis Curves by Simulated Annealing and Particle Swarm Methods of Global Optimization]
| |
| *[http://ssrn.com/abstract=917762 Least Squares Fitting of Chacón-Gielis Curves By the Particle Swarm Method of Optimization]
| |
| *[http://www.perbang.dk/superformula/ Superformula 2D Plotter & SVG Generator]
| |
| *[http://jsxgraph.uni-bayreuth.de/wiki/index.php/Superformula Interactive example using JSXGraph]
| |
| *[http://www.k2g2.org/blog:bit.craft:superdupershape_explorer 3D Superdupershape Explorer using Processing]
| |
| *[http://chamicewicz.com/p5/superformula3d/ Interactive 3D Superformula plotter using Processing (with code)]
| |
| *[http://sourceforge.net/projects/supershaper SuperShaper: An OpenSource, OpenCL accelerated, interactive 3D SuperShape generator with shader based visualisation (OpenGL3)]
| |
| *[http://www.organicvectory.com/index.php?option=com_wrapper&view=wrapper&Itemid=98 Simpel, WebGL based SuperShape implementation]
| |
| *[http://frink.machighway.com/~dynamicm/super-ellipse.html The Gielis Supershape Formula], Provides an interactive Java applet for exploring the variety of different shapes, natural or mathematical, that can be formed with the formula.
| |
| | |
| [[Category:Geometric shapes]]
| |
| [[Category:Curves]]
| |
| [[Category:Surfaces]]
| |
Let me first start by introducing myself. My name is Boyd Butts although it is not the name on my beginning certification. For a while I've been in South Dakota and my parents live nearby. My day occupation is a librarian. The preferred hobby for my kids and me is to play baseball and I'm attempting to make it a profession.
Also visit my website ... http://saputraurl.cf