Assymetroscope1 { ; ; Derived from original Kaleidoscope written by Damien M. Jones. ; Symmetrical forms can still be obtained ; However assymetrical mappings of variable distrtion can be achieved ; Low values for "divisor' produce more assymetry - use with different angles ; Evan Bayliss October 2023 transform: float r2 = 0.0 float d = 0.0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF complex z2 = #pixel - c ; get coordinate relative to symcenter ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) If @extrastep == 0 r2 = (r2 + #pi * 2) ; rotate 360 degrees else r2 = (r2 + #pi * 2) * |@rfunc(r)| ; allows for assymetry endif ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ;elseif (r2 <= #pi/@symorder) ; r2 = (#pi*2/@symorder - r2) * (r2*#pi) + |@rfunc(r)| ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF finx = #pixel/@num #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c + finx ; compute point ENDIF default: title = "Assymetroscope 1" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order/ Axes of Assymetry" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam param extrastep caption = "Choice of r2 calculation" enum = "original" "modified with function" default = 0 endparam func rfunc caption = "r variable function" default = sin() visible = @extrastep == 1 endfunc complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam param num Caption = "Divisor for init #pixel" default = 1000.0 endparam } Assymetroscope2 { ; ; Derived from original Kaleidoscope written by Damien M. Jones. ; Symmetrical forms can still be obtained ; However assymetrical mappings of variable distrtion can be achieved ; Low values for "divisor' produce more assymetry - use with different angles ; Evan Bayliss October 2023 transform: float r2 = 0.0 float d = 0.0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF complex z2 = #pixel - c ; get coordinate relative to symcenter ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) If @extrastep == 0 r2 = (r2 + #pi * 2) ; rotate 360 degrees else r2 = (r2 + #pi * 2) * |@rfunc(r)| ; allows for assymetry endif ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ;elseif (r2 <= #pi/@symorder) ; r2 = (#pi*2/@symorder - r2) * (r2*#pi) + |@rfunc(r)| ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF finx = #pixel/@num If @pix == 0 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c + finx ; compute point Elseif @pix == 1 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c + finx + #pixel elseif @pix == 2 #pixel = (cos(r2)*d + flip(@finfunc(r2)*d))/r + c + finx elseif @pix ==3 #pixel = (cos(r2)*d + flip(@finfunc(r2)*d)) Endif ENDIF default: title = "Assymetroscope 2" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order/ Axes of Assymetry" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam param extrastep caption = "Choice of r2 calculation" enum = "original" "modified with function" default = 0 endparam func rfunc caption = "r variable function" default = sin() visible = @extrastep == 1 endfunc complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam param num Caption = "Divisor for init #pixel" default = 1000.0 endparam param pix caption = "Choice of final pixel formula" enum ="(cos(r2)*d + flip(sin(r2)*d))/r + c + finx" \ "(cos(r2)*d + flip(sin(r2)*d))/r + c + finx + #pixel" \ "(cos(r2)*d + flip(@finfunc(r2)*d))/r + c + finx" \ "(cos(r2)*d + flip(@finfunc(r2)*d))" default = 0 endparam func finfunc caption = "Final pixel calc function" default = sin() visible = @pix == 2 || @pix == 3 endfunc } KaleidoscopeEBver3 { ; ; Kaleidoscope transformation. Can be used to simulate many ; different kinds of symmetry. ; ; Original written by Damien M. Jones. ; Modified Evan Bayliss Sept 2021 ; There is now a choice of formulae for #pixel ; Combining different formulae and angles can produce interesting effects ; This is most complex version - not all choices may work with a particular fractal formula ; transform: float r2 = 0.0 float d = 0.0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF complex z2 = #pixel - c ; get coordinate relative to symcenter ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/(#pi)/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF if @choice == 0 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point elseif @choice == 1 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c + real(@rfunc(r)) elseif @choice == 2 #pixel = (cos(r2)*d + flip(@rfunc2(r2)*d))/r + c + real(@rfunc(r)) elseif @choice == 3 #pixel = (cos(r2)*d + flip(@rfunc2(r2)*d))/r + flip((imag(@rfunc(r)*d)))/r + c elseif @choice == 4 #pixel = (@r2num*r2) + (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point elseif @choice == 5 #pixel = (real(z2)/flip(imag(z2))) + (cos(r2)*d + flip(sin(r2)*d))/r + c elseif @choice == 6 float rf = real(@rfunc2(z2)) float ff = real(flip(imag(@rfunc(z2)))) #pixel = rf/ff + (cos(r2)*d + flip(sin(r2)*d))/r + c ENDIF endif default: title = "Kaleidoscope EB ver 3" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam int param choice caption = "Choice of index formula" enum = "Standard" "Standard + real(rfunc(r))" "Standard with flip(rfunc(r)) + real(rfunc(r))" "Double flip formula" \ "Standard formula + r2num*r2" "Standard formula + real(z2)/flip(imag(z2))" "Standard formula + real(rfunc2(z2))/flip(imag(rfunc(z2)))" default = 0 endparam float param r2num caption = "Number to multiply r2" default = 0 endparam func rfunc caption = "Function for r" default = abs() endfunc func rfunc2 caption = "Function for flip(rfunc2(r2)*d))/r" default = sin() endfunc param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam } KaleidoscopeEBver { ; ; Kaleidoscope transformation. Can be used to simulate many ; different kinds of symmetry. ; ; Original written by Damien M. Jones. ; Modified Evan Bayliss Sept 2021 ; There is now a choice of formulae for #pixel ; Combining different formulae and angles can produce interesting effects ; Version 3 is the most complex ; transform: float r2 = 0.0 float d = 0.0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF complex z2 = #pixel - c ; get coordinate relative to symcenter ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/(#pi)/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF if @choice == 0 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point elseif @choice == 1 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c + real(@rfunc(r)) elseif @choice == 2 #pixel = (cos(r2)*d + flip(@rfunc2(r2)*d))/r + c + real(@rfunc(r)) ENDIF endif default: title = "Kaleidoscope EB ver 1" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam int param choice caption = "Choice of index formula" enum = "Standard" "Standard + real(rfunc(r))" "Standard with flip(rfunc(r)) + real(rfunc(r))" default = 0 endparam func rfunc caption = "Function for r" default = abs() endfunc func rfunc2 caption = "Function for flip(rfunc2(r2)*d))/r" default = sin() endfunc param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam } KaleidoscopeEBver2 { ; ; Kaleidoscope transformation. Can be used to simulate many ; different kinds of symmetry. ; ; Original written by Damien M. Jones. ; Modified Evan Bayliss Sept 2021 ; There is now a choice of formulae for #pixel ; Combining different formulae and angles can produce interesting effects ; Version 3 is the most complex ; transform: float r2 = 0.0 float d = 0.0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF complex z2 = #pixel - c ; get coordinate relative to symcenter ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/(#pi)/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF if @choice == 0 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point elseif @choice == 1 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c + real(@rfunc(r)) elseif @choice == 2 #pixel = (cos(r2)*d + flip(@rfunc2(r2)*d))/r + c + real(@rfunc(r)) elseif @choice == 3 #pixel = (cos(r2)*d + flip(@rfunc2(r2)*d))/r + flip((imag(@rfunc(r)*d)))/r + c ENDIF endif default: title = "Kaleidoscope EB ver 2" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam int param choice caption = "Choice of index formula" enum = "Standard" "Standard + real(rfunc(r))" "Standard with flip(rfunc(r)) + real(rfunc(r))" "Double flip formula" default = 0 endparam func rfunc caption = "Function for r" default = abs() endfunc func rfunc2 caption = "Function for flip(rfunc2(r2)*d))/r" default = sin() endfunc param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam } KaleidoscopeEBver9 { ; ; Kaleidoscope transformation. ; ; Original written by Damien M. Jones. ; Modified Evan Bayliss Oct 2021 ; Incorporates Mandelbrot formula as one of the choices ; The result straddles both mapping and formula especiall for "inside" sections ; transform: float r2 = 0.0 float d = 0.0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF if @iterchoice == 0 complex z2 = #pixel - c ; get coordinate relative to symcenter else complex z2 = #pixel - c while iter <= @itnum iter = iter + 1 z2 = z2^@power + #pixel ; Mandelbrot formula endwhile endif ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point ENDIF default: title = "Kaleidoscope EB ver 9" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam int param iterchoice caption = "Formula for z2" enum = "Standard #pixel - c" "z2 = z2^@power + #pixel" default = 0 endparam float param power caption = "Power value for z2" default = 2 endparam int param itnum caption = "Iteration number" default =1 endparam complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam } KPJ1 { ; ; Kaleidoscope mixed with Popcorn Julia ; Evan Bayliss Oct 2021 ; ; Original Kaleidoscope Written by Damien M. Jones. ; transform: float r2 = 0.0 float d = 0.0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF if @iterchoice == 0 complex z2 = #pixel - c ; get coordinate relative to symcenter else complex z2 = #pixel - c while iter <= @itnum || |z2| > @bailout x = real(z2), y = imag(z2) iter = iter +1 newx = x - @h*fn1((y) + fn2(@k*y)) ; Popcorn Julia (PJ) formula newy = y - @h*fn1((x) + fn2(@k*x)) x = newx, y = newy z2 = fn3(x) + fn4(y) ; end PJ endwhile endif ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point ENDIF default: title = "KPJ 1" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam int param iterchoice caption = "Formula for z2" enum = "Standard #pixel - c" "Popcorn Julia formula (PJ)" default = 0 endparam float param power caption = "Power value for z2" default = 2 endparam int param itnum caption = "Iteration number" hint = "Works best with low iteration values" default =1 endparam param h caption = "PJ H value" default = 0.05 endparam param k caption = "PJ K value" default = 3.0 endparam param bailout ; does not work well with low values caption = "PJ Bailout value" default = 1e18 endparam func fn1 caption = "PJ 1st Function" default = sin() endfunc func fn2 caption = "PJ 2nd Function" default = tan() endfunc func fn3 caption = "PJ 3rd Function" default = ident() endfunc func fn4 caption = "PJ 4th Function" default = flip() endfunc complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam } KAGT1 { ; ; Kaleidoscope mixed with elements from Otto Magus AltGnarlaThotep ; Evan Bayliss Oct 2021 ; ; Original Kaleidoscope Written by Damien M. Jones. ; transform: float r2 = 0.0 float d = 0.0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed int i2 = 0 IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF if @iterchoice == 0 complex z2 = #pixel - c ; get coordinate relative to symcenter else complex z2 = #pixel - c while iter <= @itnum || |z2| > @bailout float x = real(z2), float y = imag(z2) ; AltGnarlaThotep (AGT) formula incorporated iter = iter +1 float b = x^2+ y^2 x=x/b*@p1+real(@p2/10) y=y/b*@p1+imag(@p2/10) a=x if i2==0 x=x-@p3*real(sin(y+sin(@p4*(y+sin(@p5*y)))))/10 y=y+@p3*real(sin(a+sin(@p4*(a+sin(@p5*a)))))/10 i2=i2+1 else x=x-@p6*real(tanh(y+cos(@p7*(y+sin(@p8*y)))))/10 y=y+@p6*real(tanh(a+cos(@p7*(a+sin(@p8*a)))))/10 i2=0 endif z2=(fn2(x+flip(y)))^@power+@p9 z2=51*z2/50 ; end of AGT portion endwhile endif ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point ENDIF default: title = "KAGT 1" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam int param iterchoice caption = "Formula for z2" enum = "Standard #pixel - c" "Alt Gnarlathotep formula (AGT)" default = 0 endparam int param itnum caption = "Iteration number" default = 1 endparam param p1 caption = "AGT 1st value" default = 1.0 endparam param p2 caption = "AGT 2nd value" default = (0,0) endparam param p3 caption = "AGT 3rd value" default = 0.3 endparam param p4 caption = "AGT 4th value" default = 5.0 endparam param p5 caption = "AGT 5th value" default = 2.0 endparam param p6 caption = "AGT 6th value" default = 0.3 endparam param p7 caption = "AGT 7th value" default = 5.0 endparam param p8 caption = "AGT 8th value" default = 2.0 endparam func fn2 caption = "AGT Function" default = ident() endfunc param p9 caption = "AGT 9th (post function) value" default = (0,0) endparam float param power caption = "Power value for z2" default = 2 endparam param bailout caption = "AGT Bailout value" default = 1e18 endparam complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam } KaleidoscopeEBver3a { ; ; Original written by Damien M. Jones. Modifies Evan Bayliss September 2021 ; transform: float r2 = 0.0 float d = 0.0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF if @z2choice == 0 complex z2 = #pixel - c ; get coordinate relative to symcenter else complex z2 = #pixel -c if real(#pixel) <= real(c) && imag(#pixel) <= imag(c) z2 = @z2func(z2) + z2 elseif real(#pixel) <= real(c) && imag(#pixel) >imag(c) z2 = -@z2func(z2) + z2 elseif real(#pixel) > real(c) && imag(#pixel) <= imag(c) z2 = @z2func(z2) - z2 elseif real(#pixel) > real(c) && imag(#pixel) > imag(c) z2 = -(@z2func(z2) + z2) endif endif ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/(#pi)/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF if @choice == 0 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point elseif @choice == 1 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c + real(@rfunc(r)) elseif @choice == 2 #pixel = (cos(r2)*d + flip(@rfunc2(r2)*d))/r + c + real(@rfunc(r)) elseif @choice == 3 #pixel = (cos(r2)*d + flip(@rfunc2(r2)*d))/r + flip((imag(@rfunc(r)*d)))/r + c elseif @choice == 4 #pixel = (@r2num*r2) + (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point elseif @choice == 5 #pixel = (real(z2)/flip(imag(z2))) + (cos(r2)*d + flip(sin(r2)*d))/r + c elseif @choice == 6 float rf = real(@rfunc2(z2)) float ff = real(flip(imag(@rfunc(z2)))) #pixel = rf/ff + (cos(r2)*d + flip(sin(r2)*d))/r + c ENDIF endif default: title = "Kaleidoscope EB ver 3a" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam int param z2choice caption = "Choose z2 calculation method" enum = "Standard" "Variation with functions" default = 0 endparam func z2func caption = "Function for z2" default =abs() endfunc int param choice caption = "Choice of index formula" enum = "Standard" "Standard + real(rfunc(r))" "Standard with flip(rfunc(r)) + real(rfunc(r))" "Double flip formula" \ "Standard formula + r2num*r2" "Standard formula + real(z2)/flip(imag(z2))" "Standard formula + real(rfunc2(z2))/flip(imag(rfunc(z2)))" default = 0 endparam float param r2num caption = "Number to multiply r2" default = 0 endparam func rfunc caption = "Function for r" default = abs() endfunc func rfunc2 caption = "Function for flip(rfunc2(r2)*d))/r" default = sin() endfunc param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam } KNewtt1 { ; ; Kaleidoscope mixed with Newton ; Evan Bayliss Oct 2021 ; ; Original Kaleidoscope Written by Damien M. Jones. ; transform: float r2 = 0.0 float d = 0.0 int iter = 0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF if @iterchoice == 0 complex z2 = #pixel - c ; get coordinate relative to symcenter else complex z2 = #pixel - c zold =z2 while iter <= @itnum ;|| |z2 - zold| < @bailout iter = iter +1 zold = z2 z2 = ((@p1 - 1) * z2^@power + @root) / (@p1 * z2 ^ (@p1 - 1)) endwhile endif ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point ENDIF default: title = "KNewt 1" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam int param iterchoice caption = "Formula for z2" enum = "Standard #pixel - c" "Newton Formula" default = 0 endparam float param power caption = "Power value for z2" default = 2 endparam int param itnum caption = "Iteration number" ;hint = "Works best with low iteration values" default =1 endparam param p1 caption = "Newton p1 (exponent) value" default = (3,0) endparam param root caption = "Root value for Newton" default =(1,0) endparam param bailout caption = "PJ Bailout value" default = 0.00001 endparam complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam } KaleidoscopeEBver10b { ; ; Kaleidoscope transformation. Can be used to simulate many ; different kinds of symmetry. ; ; Original ver written by Damien M. Jones. ; Modified Evan Bayliss Nov 2021 and Jan 2022 ; Different rotation vector formulae ; transform: float r2 = 0.0 float d = 0.0 float xpix = real(#screenpixel) float ypix = imag(#screenpixel) float xc =real(#center) float yc = real(flip(#center)) tanang = (xpix - xc)/(ypix - yc) tanang2 = xpix/ypix if @choice == 0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector elseif @choice == 1 complex r = (0,1) ^ (@angle + |#pixel|/90) ; complex rotation vector elseif @choice == 2 complex r = (0,1) ^ ((@angle*tanang)/90) ; complex rotation vector elseif @choice == 3 complex r = (0,1) ^ ((@angle + atan2(tanang))/90) ; complex rotation vector elseif @choice == 4 complex r = (0,1) ^ (@angle/90) + atan2(tanang) elseif @choice == 5 complex r = @rnum ^ (@angle/90) elseif @choice == 6 complex r = @rnum ^ (@angle + atan2(tanang2))/90 elseif @choice == 7 complex r = @rnum ^ (atan2(#pixel)) endif complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF complex z2 = #pixel - c ; get coordinate relative to symcenter ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF if @finchoice == 0 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point else #pixel = @finfunc(#pixel) + (cos(r2)*d + flip(sin(r2)*d))/r + c endif ENDIF default: title = "Kaleidoscope EB ver 10b" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam param centermove caption = "Use Screen Center" default = true hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param choice caption = "Choice of rotation vector formula" enum = "complex r = (0,1) ^ (@angle/90)" "complex r = (0,1) ^ (@angle + |#pixel|/90)" "complex r = (0,1) ^ ((@angle*tanang)/90)" \ "(0,1) ^ ((@angle*atan2(tanang))/90)" "(0,1) ^ (@angle/90) + atan2(tanang)" "@rnum ^ (@angle/90)" "@rnum ^ (@angle + atan2(tanang2))/90" \ "@rnum ^ (atan2(#pixel))" default = 0 endparam complex param rnum caption = "Rotation vector constant" default =(0,1) visible = @choice == 6 || @choice == 5 || @choice ==7 endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam param finchoice caption = "Choice of final pixel formula" enum ="(cos(r2)*d + flip(sin(r2)*d))/r + c" "@finfunc(#pixel) + (cos(r2)*d + flip(sin(r2)*d))/r + c" default = 0 endparam func finfunc caption = "Pixel Function in final formula (Choice 1)" default =abs() visible = @finchoice == 1 endfunc } KaleidoscopeEBver10a { ; ; Kaleidoscope transformation. Can be used to simulate many ; different kinds of symmetry. ; ; Original ver written by Damien M. Jones. ; Modified Evan Bayliss Nov 2021 ; Different rotation vector formulae ; transform: float r2 = 0.0 float d = 0.0 float xpix = real(#screenpixel) float ypix = imag(#screenpixel) float xc =real(#center) float yc = real(flip(#center)) tanang = (xpix - xc)/(ypix - yc) if @choice == 0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector elseif @choice == 1 complex r = (0,1) ^ (@angle + |#pixel|/90) ; complex rotation vector elseif @choice == 2 complex r = (0,1) ^ ((@angle*tanang)/90) ; complex rotation vector elseif @choice == 3 complex r = (0,1) ^ ((@angle + atan2(tanang))/90) ; complex rotation vector elseif @choice == 4 complex r = (0,1) ^ (@angle/90) + atan2(tanang) elseif @choice == 5 complex r = @rnum ^ (@angle/90) endif complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF complex z2 = #pixel - c ; get coordinate relative to symcenter ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF if @finchoice == 0 #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point else #pixel = @finfunc(#pixel) + (cos(r2)*d + flip(sin(r2)*d))/r + c endif ENDIF default: title = "Kaleidoscope EB ver 10a" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam param choice caption = "Choice of rotation vector formula" enum = "complex r = (0,1) ^ (@angle/90)" "complex r = (0,1) ^ (@angle + |#pixel|/90)" "complex r = (0,1) ^ ((@angle*tanang)/90)" \ "(0,1) ^ ((@angle*atan2(tanang))/90)" "(0,1) ^ (@angle/90) + atan2(tanang)" "@rnum ^ (@angle/90)" default = 0 endparam complex param rnum caption = "Rotation vector constant" default =(0,1) endparam complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam param finchoice caption = "Choice of final pixel formula" enum ="(cos(r2)*d + flip(sin(r2)*d))/r + c" "@finfunc(#pixel) + (cos(r2)*d + flip(sin(r2)*d))/r + c" default = 0 endparam func finfunc caption = "Pixel Function in final formula (Choice 1)" default =abs() endfunc } KPJ1AmendedVer3 { ; ; Kaleidoscope mixed with Popcorn Julia ; Evan Bayliss Oct 2021 ;Power for z2 incorporated ; "While iter..." line altered after suggestion from Jim Blue ; Altered #pixel line ; Original Kaleidoscope Written by Damien M. Jones. ; transform: float r2 = 0.0 float d = 0.0 complex r = (0,1) ^ (@angle/90) ; complex rotation vector complex c = @symcenter ; assume symmetry center is fixed IF (@centermove) ; relative symmetry center requested c = #center ; symmetry center is image center ENDIF if @iterchoice == 0 complex z2 = #pixel - c ; get coordinate relative to symcenter else complex z2 = #pixel - c while iter <= @itnum && |z2| < @bailout x = real(z2), y = imag(z2) iter = iter +1 newx = x - @h*fn1((y) + fn2(@k*y)) ; Popcorn Julia (PJ) formula newy = y - @h*fn1((x) + fn2(@k*x)) x = newx, y = newy z2 = fn3(x) + fn4(y) + z2^@power ; end PJ endwhile endif ; convert z2 into angle and distance r2 = atan2(z2) IF (r2 < 0); negative angle (we want 0 < atan < pi*2) r2 = r2 + #pi * 2; rotate 360 degrees ENDIF r2 = r2 + r2*(atan2(|#pixel|)) d = cabs(z2) ; distance from symcenter IF (@symorder > 0) ; Zero symmetry disables the transform. ; apply symmetry IF (@symreflect == 0) ; reflective r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder IF (r2 > #pi/@symorder) ; upper half of the range r2 = #pi*2/@symorder - r2 ; reflect angle ENDIF ELSEIF (@symreflect == 1) ; left symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder ELSEIF (@symreflect == 2) ; right symmetry r2 = r2 - floor(r2*@symorder/#pi/2)*#pi*2/@symorder r2 = #pi*2/@symorder - r2 ; always reflect this ELSEIF (@symreflect == 3) ; slice-only symmetry IF (r2 > #pi*2/@symorder) ; outside of slice r2 = 0 ; reset angle #solid = true ; this is outside now ENDIF ENDIF #pixel = (cos(r2)*d + flip(sin(r2)*d))/r + c ; compute point ENDIF default: title = "KPJ 1 Amended Version 3" helpfile = "Uf*.chm" helptopic = "Html/transformations/standard/kaleidoscope.html" param symorder caption = "Symmetry Order" default = 8.0 hint = "Indicates the number of reflected components. \ Use 0 to temporarily disable symmetry." endparam param symreflect caption = "Symmetry Mode" default = 0 enum = "reflective" "left" "right" "slice only" hint = "Style of symmetry. Reflective will always be \ seamless; left and right may not be. If Slice \ is selected, only the section that will be \ mirrored will be shown." endparam int param iterchoice caption = "Formula for z2" enum = "Standard #pixel - c" "Popcorn Julia formula (PJ)" default = 0 endparam float param power caption = "Power value for z2" default = 2 endparam int param itnum caption = "Iteration number" hint = "Works best with low iteration values" default =1 endparam param h caption = "PJ H value" default = 0.05 endparam param k caption = "PJ K value" default = 3.0 endparam param bailout ; does not work well with low values caption = "PJ Bailout value" default = 1e18 endparam func fn1 caption = "PJ 1st Function" default = sin() endfunc func fn2 caption = "PJ 2nd Function" default = tan() endfunc func fn3 caption = "PJ 3rd Function" default = ident() endfunc func fn4 caption = "PJ 4th Function" default = flip() endfunc complex param symcenter caption = "Center" default = #center enabled = !@centermove hint = "Sets the center of symmetry. If Use Screen \ Center is set, this item is ignored." endparam param centermove caption = "Use Screen Center" default = false hint = "If set, symmetry will be around the center of \ the window, regardless of the Symmetry Center \ setting." endparam param angle caption = "Rotation angle" default = 0.0 hint = "Sets how much to rotate the fractal (in degrees) \ before applying symmetry. Can be used to select \ a slice of the fractal." endparam }