hi all,

i have recently built in the superformula into mutatorkammer, and i think you might

be interested in a nice transformation, with this transformation different kinds of flower shaped

things can be made

a detailed description about the formula can be found here:

http://local.wasp.uwa.edu.au/~pbourke/surfaces_curves/supershape/

here is one version which could take 6 additional parameters, but 2 of them can be neglected, namely a and b

on the page above the author suggested to leave a and b to 1

i have no delphi compiler right now ;(

but if anyone built this one in it would be great fun!

// The super Shape Function

// as a Transformation of a 2d Point - Excerpt from Mutatorkammer SUPER Function !

// Description:

// the supershape function in 2d normaly gives a curve

// in 2d space, meaning, only one value from -PI to +PI generates the shape

// this function transforms a point, calculating the length and the angle of the current

// pixel as input to the function, the returned value is then scaled to original length

//

// by the way: this formula would also do fine if used in the nonlinear transformations Apophysis uses!

//

// c.Kleinhuis 2007 - use at your own risk ! - but use it freely !

//

double super(double theta,double a,double b,double n1,double n2,double n3,double m){

double one= pow( fabs(cos(m*theta/4)/a),n2);

double two= pow( fabs(sin(m*theta/4)/b),n3);

return pow((one+two),-1/n1);

}

// Parameter x is the point you want to transform

// the parameters y,z and w are the 6 values for the supershape formula,

// taking real and imaginary parts from them gives us the 6 values we need!

// be sure to read http://local.wasp.uwa.edu.au/~pbourke/surfaces_curves/supershape/

// for an explanation of the values

// the last parameter (imaginary part of w) is the amount of angular repeats, setting this

// to a integer number gives you spikes - the other parameters are too hard to explain ;)

// just play around ..

// MyComplex calc(MyComplex x,MyComplex y,MyComplex z,MyComplex w )

{

double a=std::real(y);

double b=std::imag(y);

double n1=std::real(z);

double n2=std::imag(z);

double n3=std::real(w);

double m=std::imag(w);

double theta=atan2(std::imag(x),std::real(x));

double l=sqrt(std::real(x)*std::real(x)+std::imag(x)*std::imag(x));

double res=super(theta,a,b,n1,n2,n3,m);

return MyComplex( l*res*cos(theta), l*res*sin(theta) );

}