Superformula

From Wikipedia, the free encyclopedia

Some superformula samples: a=b=1; m, n1, n2 and n3 are shown in picture.

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 r the radius and \varphi the angle, the superformula is:


The formula appeared in a work by Gielis. It was obtained by generalizing the superellipse, named and popularized by Piet Hein, a Danish mathematician.

Extension to higher dimensions[edit]

It is possible to extend the formula to 3, 4, or n dimensions, by means of the spherical product of superformulas. For example, the 3D parametric surface is obtained by multiplying two superformulas r1and r2. The coordinates are defined by the relations:

 x \,=\, r_1(\theta)\cos(\theta)r_2(\phi)\cos(\phi)
 y \,=\, r_1(\theta)\sin(\theta)r_2(\phi)\cos(\phi)
 z \,=\, r_2(\phi)\sin(\phi)

where \phi varies between -π/2 and π/2 (latitude) and θ between  and π (longitude).

Plots[edit]


GNU Octave program for generating these figures:

  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




3d Superformula: a=b=1; m, n1, n2 and n3 are shown in the pictures.

GNU Octave program for generating these figures:

 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;
 
   
int segments = 800;
float scale = 20.0;


float a  = 1.0;
float b  = 0.80;
float m  = 15.0;
float n1 = -8.0;
float n2 = 12.0;
float n3 = 10.0;


float tau = 6.28318530718;
float step = tau / segments;


float phi = 0.0;


for (float o=0.0; o<0.5; o+=0.01) {


    for (int i=0; i<segments; i++) {
        float mp4 = (m * phi) / 4.0;
        float term_a = pow(abs((cos(mp4) / a)), n2);
        float term_b = pow(abs((sin(mp4) / b)), n3);
        float r = pow((term_a + term_b), -(1 / n1));
        addpoint( geoself(), set(cos(phi)*scale*r, sin(phi)*scale*r, 0) );
        phi += step;
    }


    a += o;
    b += o/25;
}

References[edit]

External links[edit]

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值