Escapetime - Transformation FormulasA transformation formula transforms the simple rectangular shape (the default shape coming from the direct mapping of the window to a part of the complex number plane) into another shape. This formula is rather simple to write and understand, because all it does - or better - has to do, is to modify the value of the predefined variable pixel. A transformation formula can have upto three member function:
So a transformation mainly consists of a member function void transform(void) which gets called for each pixel before the main fractal loop gets called. Thus a transformation could look as follows: rotOrder { real dAngle; real dist; void init_once(void) { // nothing to do... } void transform(void) { dAngle= arg(pixel); if (dAngle< 0) { dAngle=dAngle+2*pi; } dist= |pixel|; dAngle= dAngle-floor(dAngle*4/pi)*pi/4; if (dAngle> pi/8) { dAngle=pi/4-dAngle; } pixel= (cos(dAngle)*dist+(0,1)*(sin(dAngle)*dist)); } void description(void) { this.title = "Rotation Symmetry"; } }Have a look at these images: They show you the effect of that transformation. The transformation applies rotation symmetry to the fractal, so that the area from -22.5 degrees to +22.5 degrees gets repeated 8 times.
So all you need to do is to modify the predefined variable pixel! |