IFSEscape1 { ; ; IFS Escape time July 19, 2013 ; adapted from Fractint code of Ramiro Perez ; two transforms ; init: z = #pixel loop: float k = real(z) ; transform 1 if k < @t1 z=z*@p1+@p2 endif ; transform 2 if @t2 <= k z=z*conj(@p1)+@p3 endif bailout: |z| <= @bailout default: title = "IFS Escape 1" maxiter = 1000 center = (0, 1.25) magn = 4 periodicity = 0 method = multipass heading text = "This is an IFS formula that uses an escape time algorithm as first \ presented by Ramiro Perez for Fractint." endheading param version caption = "Formula Version" default = 100 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam complex param p1 caption = "IFS parameter 1" default = (0.9,-0.87) endparam complex param p2 caption = "IFS parameter 2" default = (-1,0) endparam complex param p3 caption = "IFS parameter 3" default = (1,0) endparam float param t1 caption = "Threshold 1" default = 0 endparam float param t2 caption = "Threshold 2" default = 0 endparam float param bailout caption = "Bailout value" default = 1e10 endparam } Gopalsamy1 {; Ron Barnett, February 1999 ; Conversion of one of my old Fractint formulas to UF ; Origin of the formula is unknown. ; versioning and switch modes added in 2006 init: #z = #pixel loop: ; The original code from Fractint was: ; x = real(z), y = imag(z) ; x1 = -2*x*y + p1 ; y = y*y - x*x ; z = x1 + flip(y) #z = -(0,1)*conj(#z)^@power + @p1 bailout: ; The various bailout tests are based upon Fractint bailout tests. (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Gopalsamy" maxiter = 1000 center = (0, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 101 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam complex param p1 caption = "seed" default = (-0.19, -0.19) hint = "This is the 'Julia' seed." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" hint = "Diferent modes for determining bailout." endparam complex param power caption = "Power" default = (2,0) endparam float param bailout caption = "Bailout value" default = 10000 min = 1 hint = "The bailout value, which determines when the iterated values \ escape." endparam switch: type = "MandelGopalsamy" bailout = bailout power = power } MandelGopalsamy {; Ron Barnett, September 2006 ; The Mandelbrot equivalent of Gopalsamy1 (one of my old Fractint formulas) ; The origin of the equation is unknown. init: #z = @start loop: #z = -(0,1)*conj(#z)^@power + #pixel bailout: ; The various bailout tests are based upon Fractint bailout tests. (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Mandel Gopalsamy" maxiter = 1000 center = (0, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 101 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam complex param start caption = "Perturbation" default = (0,0) hint = "Changes the iteration starting point and the shape of the fractal." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" hint = "Diferent modes for determining bailout." endparam float param bailout caption = "Bailout value" default = 10000 min = 1 hint = "The bailout value, which determines when the iterated values \ escape." endparam complex param power caption = "Power" default = (2,0) endparam switch: type = "Gopalsamy1" bailout = bailout start = start p1 = #pixel power = power } ZeePi { ; Ron Barnett, 1993 ; Based upon Ramanujan's iterative function for calculating pi init: #z = @start + #pixel loop: x = (1 - #z^@p1)^(1/@p1) #z = #z*@fn1((1-x)/(1+x)) + @p2 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "ZeePi" maxiter = 255 center = (0, 0) periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Perturbation" default = (0,0) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.1, 0.0) endparam param p2 caption = "Parameter 2" default = (0.395, 0.0) endparam func fn1 caption = "Function 1" default = sin() endfunc switch: type = "ZeePiM" bailout = @bailout p1 = @p1 fn1 = @fn1 test = @test } ZeePiM { ; Ron Barnett, 1993 ; Based upon Ramanujan's iterative function for calculating pi init: #z = @start + #pixel loop: x = (1 - #z^@p1)^(1/@p1) #z = #z*@fn1((1-x)/(1+x)) +#pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "ZeePi" maxiter = 255 center = (0, 0) periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Perturbation" default = (0,0) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.1, 0.0) endparam func fn1 caption = "Function 1" default = sin() endfunc switch: type = "ZeePi" bailout = @bailout p2 = #pixel p1 = @p1 fn1 = @fn1 test = @test } IkenagaMap {; Ron Barnett, March 1999 ; based upon the Ikenaga function described ; in Dewdneys's The Armchair Universe. ; The initial starting point allows the function to provide a ; "map" for the corresponding Julia function (Julike ) ; modified from the original Fractint frm init: #z = ((1-#pixel)/3)^0.5 loop: #z = #z*#z*#z + (#pixel-1)*#z - #pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Ikenaga Map" maxiter = 1000 center = (0, 0) method = multipass periodicity = 0 magn = 1.5 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10000.0 min = 1 endparam switch: type = "Julike" bailout = @bailout p1 = #pixel test = @test } Julike {; Ron Barnett, March 1999 ; a Julia function based upon the Ikenaga function ; modified from the original Fractint frm init: #z = #pixel loop: #z = #z*#z*#z + (@p1-1)*#z - @p1 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Ikenaga Julia" maxiter = 1000 center = (0, 0) method = multipass periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10000.0 min = 1 endparam param p1 caption = "seed" default = (0.0, -0.1625) endparam switch: type = "IkenagaMap" bailout = @bailout test = @test } Frame-RbtM {; Ron Barnett, March 1999 ; from Mazes for the Mind by Pickover init: #z = #pixel loop: #z = #z*#z*#z/5 + #z*#z + #pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Frame-Robert" maxiter = 1000 center = (-2, 0) magn = 0.7 method = multipass periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10000.0 min = 1 endparam switch: type = "Frame-RbtJ" bailout = @bailout p1 = #pixel test = @test } Frame-RbtJ {; Ron Barnett, March 1999 init: #z = #pixel loop: #z = #z*#z*#z/5 + #z*#z + @p1 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Frame-Robert Julia" maxiter = 10000 center = (0, 0) method = multipass periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10000.0 min = 1 endparam param p1 caption = "seed" default = (-0.964, -0.178) endparam switch: type = "Frame-RbtM" bailout = @bailout test = @test } IkeNewtM {; Ron Barnett, March 1999 init: #z = #pixel loop: zf = #z*#z*#z + (#pixel-1)*#z - #pixel zd = 3*#z*#z + #pixel-1 #z = #z - @p1*zf/zd bailout: @p2 <= |zf| default: title = "Scaled Ikenaga Newton" maxiter = 255 center = (0, 0) magn = 0.2 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p1 caption = "Scaling Factor" default = (0.5,0.5) endparam param p2 caption = "Bailout value" default = 0.001 max = 0.1 endparam switch: type = "IkeNewtJul" p1 = @p1 p2 = #pixel test = @p2 } IkeNewtJul {; Ron Barnett, March 1999 init: #z = #pixel loop: zf = #z*#z*#z + (@p2-1)*#z - @p2 zd = 3*#z*#z + @p2-1 #z = #z - @p1*zf/zd bailout: @test <= |zf| default: title = "Scaled Julike Newton" maxiter = 255 center = (0, 0) magn = 0.2 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p1 caption = "Scaling Factor" default = (0.5,0.5) endparam param p2 caption = "Julia value" default = (0.01,0.25) endparam param test caption = "Bailout value" default = 0.001 max = 0.1 endparam switch: type = "IkeNewtM" p1 = @p1 p2 = @test } MandellambdaPwr {; Ron Barnett March 1999 ; This provide a "map" for LambdaPwr init: #z = (1/(@p1+1))^(1/@p1) loop: #z = #pixel*#z*(1 - #z^@p1) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Mandellambda Power" maxiter = 1000 center = (1.0, 0.0) magn = 0.7 method = multipass periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10000.0 min = 1 endparam param p1 caption = "Power" default = (1.0,0.0) endparam switch: type = "LambdaPwr" bailout = @bailout seed = #pixel p1 = @p1 test = @test } LambdaPwr {; Ron Barnett, March 1999 init: #z = #pixel loop: #z = @seed*#z*(1 - #z^@p1) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Lambda Power" maxiter = 1000 center = (0.5, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10000.0 min = 1 endparam param p1 caption = "Power" default = (1.0,0.0) endparam param seed caption = "Julia Seed" default = (0.964, -0.303) endparam switch: type = "MandellambdaPwr" bailout = @bailout p1 = @p1 test = @test } SJMAND01 {;4D Mandelbrot type SJ, Ron Barnett March 1999 ; Modified March 2000 ; Modified from a formula of Gordon Lamb ; Type SJ iterate in the "zc" plane, ; Altering the real value of p2 in type SJ will ; step the position of the iterated image along the x axis ; of the c-plane Mandelbrot set. ; Parameter p1 will rotate the angle of the iteration plane ; p1=1 will revert to the c-plane giving the classic Mandelbrot init: #z = real(#pixel) + flip(imag(#pixel)*@p1) complex c = @p2 + @p1*real(#pixel) + flip(imag(#pixel)) loop: #z = #z*#z + c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "4D Mandelbrot SJ" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.0,0.0) endparam param p2 caption = "Plane position" default = (-0.75,0.0) endparam switch: type = "SJMAND01J" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel } SJMAND01J {; Ron Barnett March 2000 init: #z = real(#pixel) + flip(imag(#pixel)*@p1) complex c = @p2 + @p1*real(@p3) + flip(imag(@p3)) loop: #z = #z*#z + c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "4D Mandelbrot SJ Julia" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.1,0.0) endparam param p2 caption = "Plane position" default = (-0.75,0.0) endparam param p3 caption = "seed" default = (0.8875,0.3625) endparam switch: type = "SJMAND01" bailout = @bailout p1 = @p1 p2 = @p2 } 3RDIM01 {;4D Mandelbrot type 3RDIM, Ron Barnett March 1999 ; Modified March 2000 ; Modified from a formula of Gordon Lamb ; Type 3RDIM iterate in the "cz" plane, ; Altering the imaginary value of p2 in type 3RDIM will ; step the position of the iterated image along the y axis ; of the c-plane Mandelbrot set. ; Parameter p1 will rotate the angle of the iteration plane ; p1=1 will revert to the c-plane giving the classic Mandelbrot init: #z = @p1*real(#pixel)+flip(imag(#pixel)) complex c = @p2+real(#pixel)+flip(imag(#pixel)*@p1) loop: #z = #z*#z + c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "4D Mandelbrot 3RDIM" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam switch: type = "3RDIM01J" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel } 3RDIM01J {; Ron Barnett March 2000 init: #z = @p1*real(#pixel)+flip(imag(#pixel)) complex c = @p2+real(@p3)+flip(imag(@p3)*@p1) loop: #z = #z*#z + c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "4D Mandelbrot 3RDIM Julia" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.001) endparam param p3 caption = "seed" default = (-0.8125, -0.3875) endparam switch: type = "3RDIM01" bailout = @bailout p1 = @p1 p2 = @p2 } SlopeNewton { ; based upon the slope (Mandelbrot) ; formula of Damien Jones ; Ron Barnett, March 1999 ; init: complex fz = 0 complex fzp = 0 complex fzp2 = 0 float pwrtest = 10^(100/cabs(@p1)) bool bTest = false float isnear = @p3*cabs(@p2)^cabs(@p1) complex z1 = #pixel ; primary iterated point complex z2 = #pixel + @offset ; horizontally offset point complex z3 = #pixel + flip(@offset) ; vertically offset point int done = 2 float e1 = 0.0 ; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0 ; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0 ; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20 ; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 float iterate = 0 loop: complex oldz1 = z1 fz = z1^@p1 - @p2 fzp = @p1*z1^(@p1-1) fzp2 = @p1*(@p1-1)*z1^(@p1-2) if @converge == 0 ; Newton z1 = z1 - fz/fzp elseif @converge == 1 ; Householder z1 = z1 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) elseif @converge == 2 ; Halley z1 = z1 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) elseif @converge == 3 ; Schroder z1 = z1 - fz*fzp/(fzp^2 - fz*fzp2) elseif @converge == 4 ; Ho custom z1 = z1 - fz/fzp*(1 + fz*fzp2/(@custom*fzp^2)) elseif @converge == 5 ; Ha custom z1 = z1 - 2*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 6 ; H_S custom z1 = z1 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 7 ; Mixed1 if iterate % 2 == 0 z1 = z1 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) else z1 = z1 - fz/fzp endif elseif @converge == 8 ; Mixed2 if iterate % 2 == 0 z1 = z1 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) else z1 = z1 - fz/fzp endif elseif @converge == 9 ; Mixed3 if iterate % 2 == 0 z1 = z1 - fz*fzp/(fzp^2 - fz*fzp2) else z1 = z1 - fz/fzp endif elseif @converge == 10 ; Mixed4 if iterate % 2 == 0 z1 = z1 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) else z1 = z1 - fz/fzp endif endif btest = (cabs(oldz1-z1) < isnear) complex oldz2 = z2 fz = z2^@p1 - @p2 fzp = @p1*z2^(@p1-1) fzp2 = @p1*(@p1-1)*z2^(@p1-2) if @converge == 0 ; Newton z2 = z2 - fz/fzp elseif @converge == 1 ; Householder z2 = z2 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) elseif @converge == 2 ; Halley z2 = z2 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) elseif @converge == 3 ; Schroder z2 = z2 - fz*fzp/(fzp^2 - fz*fzp2) elseif @converge == 4 ; Ho custom z2 = z2 - fz/fzp*(1 + fz*fzp2/(@custom*fzp^2)) elseif @converge == 5 ; Ha custom z2 = z2 - 2*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 6 ; H_S custom z2 = z2 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 7 ; Mixed1 if iterate % 2 == 0 z2 = z2 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) else z2 = z2 - fz/fzp endif elseif @converge == 8 ; Mixed2 if iterate % 2 == 0 z2 = z2 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) else z2 = z2 - fz/fzp endif elseif @converge == 9 ; Mixed3 if iterate % 2 == 0 z2 = z2 - fz*fzp/(fzp^2 - fz*fzp2) else z2 = z2 - fz/fzp endif elseif @converge == 10 ; Mixed4 if iterate % 2 == 0 z2 = z2 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) else z2 = z2 - fz/fzp endif endif complex oldz3 = z3 fz = z3^@p1 - @p2 fzp = @p1*z3^(@p1-1) fzp2 = @p1*(@p1-1)*z3^(@p1-2) if @converge == 0 ; Newton z3 = z3 - fz/fzp elseif @converge == 1 ; Householder z3 = z3 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) elseif @converge == 2 ; Halley z3 = z3 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) elseif @converge == 3 ; Schroder z3 = z3 - fz*fzp/(fzp^2 - fz*fzp2) elseif @converge == 4 ; Ho custom z3 = z3 - fz/fzp*(1 + fz*fzp2/(@custom*fzp^2)) elseif @converge == 5 ; Ha custom z3 = z3 - 2*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 6 ; H_S custom z3 = z3 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 7 ; Mixed1 if iterate % 2 == 0 z3 = z3 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) else z3 = z3 - fz/fzp endif elseif @converge == 8 ; Mixed2 if iterate % 2 == 0 z3 = z3 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) else z3 = z3 - fz/fzp endif elseif @converge == 9 ; Mixed3 if iterate % 2 == 0 z3 = z3 - fz*fzp/(fzp^2 - fz*fzp2) else z3 = z3 - fz/fzp endif elseif @converge == 10 ; Mixed4 if iterate % 2 == 0 z3 = z3 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) else z3 = z3 - fz/fzp endif endif IF (@zmode == 5) iterexp1 = iterexp1 + exp(-1/(cabs(oldz1 - z1))) iterexp2 = iterexp2 + exp(-1/(cabs(oldz2 - z2))) iterexp3 = iterexp3 + exp(-1/(cabs(oldz3 - z3))) ENDIF done = done + 1 ; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF ( btest || cabs(z1) > pwrtest || \ @everyiter || \ done == #maxit + 2) ; done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1) ; log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2) ; sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3) ; cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4) ; exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5) ; sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6) ; cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7) ; sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8) ; cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9) ; tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy) ; fudge z from vector ELSE ; didn't compute z this time z = z1 ; use primary iteration value to keep periodicity working ENDIF IF (btest || cabs(z) > pwrtest) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (Newton)" center = (0.0, 0.0) maxiter = 1000 periodicity = 0 heading caption = "Slope Newton" endheading heading caption = "This is a 'convergent' fractal" endheading heading caption = "that uses multiple convergence" endheading heading caption = "methods." endheading heading caption = "Use with Damien's Lighting" endheading heading caption = "formula or 3D Texturizer III" endheading param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p1 caption = "Power" default = (3,0) endparam param p2 caption = "Root" default = (1,0) endparam param p3 caption = "Bailout value" default = 0.000001 max = 0.1 endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam heading caption = "Convergence Methods" endheading param converge caption = "Convergence Method" default = 0 enum = "Newton" "Householder" "Halley" "Schroder" "Ho Custom" \ "Ha Custom" "H_S Custom" "Mixed1" "Mixed2" "Mixed3" "Mixed4" endparam float param custom caption = "H_S Constant" default = 1.5 visible = @converge==4 || @converge==5 || @converge==6 || @converge==10 endparam } SlopeExpMandelbrot { ; based upon the slope (Mandelbrot) ; formula of Damien Jones ; Ron Barnett, March 1999 ; Modified with more height values July 2004 init: complex c1 = #pixel; primary iterated point complex c2 = #pixel + @offset; horizontally offset point complex c3 = #pixel + flip(@offset); vertically offset point complex z1 = @start; starting value complex z2 = @start complex z3 = @start int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 float theta = 0.0 float r = 0.0 complex qa = 0 complex qb = 0 complex qc = 0 complex qy = 0 complex qx = 0 complex cx = 0 complex cy = 0 loop: z1 = z1^@power + c1; iterate each point z2 = z2^@power + c2 z3 = z3^@power + c3 iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 58) ; smallest Knot curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 59) ; smallest Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(real(#z) + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 60) ; smallest Bean theta = atan(imag(#z)/real(#z)) af1 = @a*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) polar = ((af1*cos(theta))+flip((af1*sin(theta)))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 61) ; smallest Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*@b)^2 qc = (0.05*@b)^4 - (cy^2 - (0.05*@b)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = 2.25*@a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 62) ; smallest Bow theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 63) ; smallest Cassini Ovals theta = atan(imag(#z)/real(#z)) if @negroot == true rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 64) ; smallest Circle theta = atan(imag(#z)/real(#z)) rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 65) ; smallest Trident cx = real(#z) cy = cx^2 + 0.1*@b/cx polar = 0.1*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 66) ; smallest Stirrup Curve cy = imag(#z) qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 67) ; smallest Diamond polar = @a*@safn(abs((real(#z)*@sa1))+abs((flip(imag(#z))^@sa2))-1) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 68) ; smallest Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 polar = 4*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 69) ; smallest Teardrop Curve theta = atan(imag(#z)/real(#z)) af1 = @a*cos(theta) af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 70) ; smallest Happy Accident polar = 15*@a*@safn((((real(#z)*@sa4)^(1+@sa2))+ \ (flip(imag(#z))^2*@sa3))*atan2((flip(imag(#z))^@sa7)* \ (real(#z)^@sa5))-@sa1* \ (flip(imag(#z))^@sa6)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 71) ; smallest Hyperbola theta = atan(imag(#z)/real(#z)) rr = 0.35*@a*(1/cos(2*theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 72) ; smallest Kappa Curve theta = atan(imag(#z)/real(#z)) rr = 0.1*@a*tan(theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 73) ; smallest Piriform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1+sin(theta)) af2 = 0.1*@b*cos(theta)*(1+sin(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 74) ; smallest Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif polar = 2.5*@a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 75) ; smallest Serpentine Curve theta = atan(imag(#z)/real(#z)) af1 = 0.2*@a*cotan(theta) af2 = 0.2*@b*sin(theta)*cos(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 76) ; smallest Line cx = real(#z) cy = cx polar = 3*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 77) ; smallest Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 78) ; smallest Parabola cy = imag(#z) cx = 10*@b*cy^2 polar = 0.65*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 79) ; smallest Trefoil theta = atan(imag(#z)/real(#z)) rr = 0.1*@a/cos(3*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 80) ; smallest Trident of Descartes cx = real(#z) cy = (cx-0.2*@b)*(cx+0.2*@b)*(cx-0.4*@b)/cx polar = @a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 81) ; smallest Trisectrix of Maclaurin theta = atan(imag(#z)/real(#z)) rr = 0.5*@a*sin(3*theta)/sin(2*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 82) ; smallest Atzema Spiral theta = atan(imag(#z)/real(#z)) af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 83) ; smallest Rose of Troy theta = atan(imag(#z)/real(#z)) rr = @cp*(1+10*@a*sin(4*@b*theta)) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 84) ; smallest Cotes' Spiral theta = atan(imag(#z)/real(#z)) rr = @a/cosh(@b*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 85) ; smallest Dipole Curve theta = atan(imag(#z)/real(#z)) rr = @a*(cos(theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 86) ; smallest Polytrope cx = real(#z) cy = 1/cx^@pn polar = 0.00005*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 86) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 87) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: method = multipass periodicity = 0 heading caption = "SlopeExp Mandelbrot" endheading $ifdef VER40 heading text = "Provides 88 different Height Value variants." endheading heading text = "Use Damien's Lighting Coloring or 3D Texturizer Enhanced III. \ Most other coloring formulas can be used." endheading $else heading caption = "Use Damien's Lighting Coloring" endheading heading caption = "Or 3D Texturizer Enhanced III." endheading heading caption = "Most other coloring formulas" endheading heading caption = "can also be used." endheading $endif title = "SlopeExp (Mandelbrot)" center = (-0.5, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.1 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Starting Point" default = (0,0) hint = "Starting value for each point. You can use this to \ 'perturb' the fractal." endparam param power caption = "Exponent" default = (2,0) hint = "Overall exponent for the equation. (2,0) gives \ the classic Mandelbrot type." endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam heading caption = "Slope Parameters" endheading param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 87 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 || @zmode==58 || @zmode==59 \ || @zmode==60 || @zmode==61 || @zmode==62 || @zmode==63 || @zmode==64 \ || @zmode==65 || @zmode==66 || @zmode==67 || @zmode==68 || @zmode==69 \ || @zmode==70 || @zmode==71 || @zmode==72 || @zmode==73 || @zmode==74 \ || @zmode==75 || @zmode==76 || @zmode==77 || @zmode==78 || @zmode==79 \ || @zmode==80 || @zmode==81 || @zmode==82 || @zmode==83 || @zmode==84 \ || @zmode==85 || @zmode==86 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 || @zmode==61 || @zmode==62 || @zmode==63 \ || @zmode==64 || @zmode==65 || @zmode==69 || @zmode==73 || @zmode==75 \ || @zmode==78 || @zmode==80 || @zmode==82 || @zmode==83 || @zmode==84 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@zmode==83 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 || @zmode==69 || @zmode==86 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 || @zmode==60 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc param sa1 caption = "Adjuster 1" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @zmode == 70 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @zmode == 70 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @zmode == 70 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @zmode == 70 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @zmode == 70 endparam func safn caption = "Adjuster Fn" default = ident() visible = @zmode == 67 || @zmode==70 endfunc param negroot caption = "Quad Neg Root" default = false visible=@zmode==58 || @zmode==61 || @zmode==66 || @zmode==74 || @zmode==77 endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeExpJulia" seed = #pixel power = @power bailout = @bailout offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b cp = @cp pn = @pn afn1 = @afn1 afn2 = @afn2 safn = @safn apwr = @apwr fn1 = @fn1 sa1 = @sa1 sa2 = @sa2 sa3 = @sa3 sa4 = @sa4 sa5 = @sa5 sa6 = @sa6 sa7 = @sa7 negroot = @negroot } SlopeExpJulia { ; based upon the slope (Julia) ; formula of Damien Jones ; Ron Barnett, March 1999 ; Modified with more Height Values July 2004 init: complex z1 = #pixel; primary iterated point complex z2 = #pixel + @offset; horizontally offset point complex z3 = #pixel + flip(@offset); vertically offset point int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 complex polar = 0.0 complex af1 = 0.0 complex af2 = 0.0 loop: z1 = z1^@power + @seed ; iterate each point z2 = z2^@power + @seed z3 = z3^@power + @seed iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) ; theta = atan2(#z) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 58) ; smallest Knot curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 59) ; smallest Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(real(#z) + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 60) ; smallest Bean theta = atan(imag(#z)/real(#z)) af1 = @a*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) polar = ((af1*cos(theta))+flip((af1*sin(theta)))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 61) ; smallest Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*@b)^2 qc = (0.05*@b)^4 - (cy^2 - (0.05*@b)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = 2.25*@a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 62) ; smallest Bow theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 63) ; smallest Cassini Ovals theta = atan(imag(#z)/real(#z)) if @negroot == true rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 64) ; smallest Circle theta = atan(imag(#z)/real(#z)) rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 65) ; smallest Trident cx = real(#z) cy = cx^2 + 0.1*@b/cx polar = 0.1*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 66) ; smallest Stirrup Curve cy = imag(#z) qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 67) ; smallest Diamond polar = @a*@safn(abs((real(#z)*@sa1))+abs((flip(imag(#z))^@sa2))-1) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 68) ; smallest Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 polar = 4*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 69) ; smallest Teardrop Curve theta = atan(imag(#z)/real(#z)) af1 = @a*cos(theta) af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 70) ; smallest Happy Accident polar = 15*@a*@safn((((real(#z)*@sa4)^(1+@sa2))+ \ (flip(imag(#z))^2*@sa3))*atan2((flip(imag(#z))^@sa7)* \ (real(#z)^@sa5))-@sa1* \ (flip(imag(#z))^@sa6)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 71) ; smallest Hyperbola theta = atan(imag(#z)/real(#z)) rr = 0.35*@a*(1/cos(2*theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 72) ; smallest Kappa Curve theta = atan(imag(#z)/real(#z)) rr = 0.1*@a*tan(theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 73) ; smallest Piriform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1+sin(theta)) af2 = 0.1*@b*cos(theta)*(1+sin(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 74) ; smallest Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif polar = 2.5*@a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 75) ; smallest Serpentine Curve theta = atan(imag(#z)/real(#z)) af1 = 0.2*@a*cotan(theta) af2 = 0.2*@b*sin(theta)*cos(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 76) ; smallest Line cx = real(#z) cy = cx polar = 3*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 77) ; smallest Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 78) ; smallest Parabola cy = imag(#z) cx = 10*@b*cy^2 polar = 0.65*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 79) ; smallest Trefoil theta = atan(imag(#z)/real(#z)) rr = 0.1*@a/cos(3*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 80) ; smallest Trident of Descartes cx = real(#z) cy = (cx-0.2*@b)*(cx+0.2*@b)*(cx-0.4*@b)/cx polar = @a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 81) ; smallest Trisectrix of Maclaurin theta = atan(imag(#z)/real(#z)) rr = 0.5*@a*sin(3*theta)/sin(2*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 82) ; smallest Atzema Spiral theta = atan(imag(#z)/real(#z)) af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 83) ; smallest Rose of Troy theta = atan(imag(#z)/real(#z)) rr = @cp*(1+10*@a*sin(4*@b*theta)) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 84) ; smallest Cotes' Spiral theta = atan(imag(#z)/real(#z)) rr = @a/cosh(@b*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 85) ; smallest Dipole Curve theta = atan(imag(#z)/real(#z)) rr = @a*(cos(theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 86) ; smallest Polytrope cx = real(#z) cy = 1/cx^@pn polar = 0.00005*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 86) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 87) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: method = multipass periodicity = 0 heading caption = "SlopeExp Mandelebrot Julia" endheading $ifdef VER40 heading text = "Provides 88 different Height Value variants." endheading heading text = "Use Damien's Lighting Coloring or 3D Texturizer Enhanced III. \ Most other coloring formulas can be used." endheading $else heading caption = "Use Damien's Lighting Coloring" endheading heading caption = "Or 3D Texturizer Enhanced III." endheading heading caption = "Most other coloring formulas" endheading heading caption = "can also be used." endheading $endif title = "SlopeExp (Julia)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param seed caption = "Julia Seed" default = (-0.75,0.2) hint = "This is the Julia seed, a constant parameter which \ defines the shape of the fractal." endparam param start caption = "Starting Point" default = (0,0) hint = "Starting value for each point. You can use this to \ 'perturb' the fractal." endparam param power caption = "Exponent" default = (2,0) hint = "Overall exponent for the equation. (2,0) gives \ the classic Mandelbrot type." endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam heading caption = "Slope Parameters" endheading param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 87 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sextic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 || @zmode==58 || @zmode==59 \ || @zmode==60 || @zmode==61 || @zmode==62 || @zmode==63 || @zmode==64 \ || @zmode==65 || @zmode==66 || @zmode==67 || @zmode==68 || @zmode==69 \ || @zmode==70 || @zmode==71 || @zmode==72 || @zmode==73 || @zmode==74 \ || @zmode==75 || @zmode==76 || @zmode==77 || @zmode==78 || @zmode==79 \ || @zmode==80 || @zmode==81 || @zmode==82 || @zmode==83 || @zmode==84 \ || @zmode==85 || @zmode==86 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 || @zmode==61 || @zmode==62 || @zmode==63 \ || @zmode==64 || @zmode==65 || @zmode==69 || @zmode==73 || @zmode==75 \ || @zmode==78 || @zmode==80 || @zmode==82 || @zmode==83 || @zmode==84 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@zmode==83 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 || @zmode==69 || @zmode==86 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 || @zmode==60 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc param sa1 caption = "Adjuster 1" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @zmode == 70 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @zmode == 70 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @zmode == 70 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @zmode == 70 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @zmode == 70 endparam func safn caption = "Adjuster Fn" default = ident() visible = @zmode == 67 || @zmode==70 endfunc param negroot caption = "Quad Neg Root" default = false visible=@zmode==58 || @zmode==61 || @zmode==66 || @zmode==74 || @zmode==77 endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeExpMandelbrot" power = @power bailout = @bailout offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b cp = @cp pn = @pn afn1 = @afn1 afn2 = @afn2 safn = @safn apwr = @apwr fn1 = @fn1 sa1 = @sa1 sa2 = @sa2 sa3 = @sa3 sa4 = @sa4 sa5 = @sa5 sa6 = @sa6 sa7 = @sa7 negroot = @negroot } SlopeIkeNewtM { ; based upon the slope (Mandelbrot) ; formula of Damien Jones ; Ron Barnett, March 1999 ; init: complex z1 = #pixel ; primary iterated point complex z2 = #pixel + @offset ; horizontally offset point complex z3 = #pixel + flip(@offset) ; vertically offset point int done = 2 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: complex oldz1 = z1 complex zf1 = z1*z1*z1 + (pixel-1)*z1 - pixel complex zd1 = 3*z1*z1 + pixel-1 z1 = z1 - @p1*zf1/zd1 complex oldz2 = z2 complex zf2 = z2*z2*z2 + (pixel-1)*z2 - pixel complex zd2 = 3*z2*z2 + pixel-1 z2 = z2 - @p1*zf2/zd2 complex oldz3 = z3 complex zf3 = z3*z3*z3 + (pixel-1)*z3 - pixel complex zd3 = 3*z3*z3 + pixel-1 z3 = z3 - @p1*zf3/zd3 IF (@zmode == 5) iterexp1 = iterexp1 + exp(-1/(cabs(oldz1 - z1))) iterexp2 = iterexp2 + exp(-1/(cabs(oldz2 - z2))) iterexp3 = iterexp3 + exp(-1/(cabs(oldz3 - z3))) ENDIF done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1|; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1); update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)); get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1); update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)); get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1); update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)); get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1); update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)); get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1); update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF (@p2 > |oldz1-z1| || \ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (@p2 > |oldz1-z1|) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (Scaled Ikenaga Newton)" center = (0.0, 0.0) maxiter = 1000 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p1 caption = "Scaling Factor" default = (0.5,0.5) endparam param p2 caption = "Bailout value" default = 0.000001 max = 0.1 endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam } SlopeZeePi { ; based upon the slope (Mandelbrot) ; formula of Damien Jones ; Ron Barnett, March 1999 ; init: complex z1 = #pixel ; primary iterated point complex z2 = #pixel + @offset ; horizontally offset point complex z3 = #pixel + flip(@offset) ; vertically offset point int done = 2 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: complex x1 = (1 - z1^@p1)^(1/@p1) complex z1 = z1*@fn1((1-x1)/(1+x1)) + @p2 complex x2 = (1 - z2^@p1)^(1/@p1) complex z2 = z2*@fn1((1-x2)/(1+x2)) + @p2 complex x3 = (1 - z3^@p1)^(1/@p1) complex z3 = z3*@fn1((1-x3)/(1+x3)) + @p2 IF (@zmode == 5) iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) ENDIF done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1|; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1); update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)); get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1); update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)); get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1); update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)); get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1); update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)); get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1); update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF (@bailout < |z1| || \ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (@bailout < |z1|) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (ZeePi)" center = (0.0, 0.0) maxiter = 255 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout value" default = 10.0 min = 1 endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam param p1 caption = "Parameter 1" default = (1.1, 0.0) endparam param p2 caption = "Parameter 2" default = (0.395, 0.0) endparam func fn1 caption = "Function 1" default = sin() endfunc } SlopeCayleyMand { ; based upon the slope (Mandelbrot) ; formula of Damien Jones ; Ron Barnett, March 1999 ; modified to add more height values July 2004 ; modified to add more height values December 2004 ; modified to add alternate convergence methods December 2004 init: complex z1 = 0 ; primary iterated point complex z2 = @offset ; horizontally offset point complex z3 = flip(@offset) ; vertically offset point int done = 2 complex a = #pixel float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 complex fz = 0 complex fzp = 0 complex fzp2 = 0 float iterate = 0 loop: iterate = iterate + 1 oldz1 = z1 fz = z1^3 - a*z1 - a + 1 fzp = 3*z1^2 - a fzp2 = 6*z1 if @converge == 0 ; Newton z1 = z1 - fz/fzp elseif @converge == 1 ; Householder z1 = z1 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) elseif @converge == 2 ; Halley z1 = z1 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) elseif @converge == 3 ; Schroder z1 = z1 - fz*fzp/(fzp^2 - fz*fzp2) elseif @converge == 4 ; Ho custom z1 = z1 - fz/fzp*(1 + fz*fzp2/(@custom*fzp^2)) elseif @converge == 5 ; Ha custom z1 = z1 - 2*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 6 ; H_S custom z1 = z1 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 7 ; Mixed1 if iterate % 2 == 0 z1 = z1 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) else z1 = z1 - fz/fzp endif elseif @converge == 8 ; Mixed2 if iterate % 2 == 0 z1 = z1 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) else z1 = z1 - fz/fzp endif elseif @converge == 9 ; Mixed3 if iterate % 2 == 0 z1 = z1 - fz*fzp/(fzp^2 - fz*fzp2) else z1 = z1 - fz/fzp endif elseif @converge == 10 ; Mixed4 if iterate % 2 == 0 z1 = z1 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) else z1 = z1 - fz/fzp endif endif oldz2 = z2 fz = z2^3 - a*z2 - a + 1 fzp = 3*z2^2 - a fzp2 = 6*z2 if @converge == 0 ; Newton z2 = z2 - fz/fzp elseif @converge == 1 ; Householder z2 = z2 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) elseif @converge == 2 ; Halley z2 = z2 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) elseif @converge == 3 ; Schroder z2 = z2 - fz*fzp/(fzp^2 - fz*fzp2) elseif @converge == 4 ; Ho custom z2 = z2 - fz/fzp*(1 + fz*fzp2/(@custom*fzp^2)) elseif @converge == 5 ; Ha custom z2 = z2 - 2*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 6 ; H_S custom z2 = z2 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 7 ; Mixed1 if iterate % 2 == 0 z2 = z2 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) else z2 = z2 - fz/fzp endif elseif @converge == 8 ; Mixed2 if iterate % 2 == 0 z2 = z2 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) else z2 = z2 - fz/fzp endif elseif @converge == 9 ; Mixed3 if iterate % 2 == 0 z2 = z2 - fz*fzp/(fzp^2 - fz*fzp2) else z2 = z2 - fz/fzp endif elseif @converge == 10 ; Mixed4 if iterate % 2 == 0 z2 = z2 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) else z2 = z2 - fz/fzp endif endif oldz3 = z3 fz = z3^3 - a*z3 - a + 1 fzp = 3*z3^2 - a fzp2 = 6*z3 if @converge == 0 ; Newton z3 = z3 - fz/fzp elseif @converge == 1 ; Householder z3 = z3 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) elseif @converge == 2 ; Halley z3 = z3 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) elseif @converge == 3 ; Schroder z3 = z3 - fz*fzp/(fzp^2 - fz*fzp2) elseif @converge == 4 ; Ho custom z3 = z3 - fz/fzp*(1 + fz*fzp2/(@custom*fzp^2)) elseif @converge == 5 ; Ha custom z3 = z3 - 2*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 6 ; H_S custom z3 = z3 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 7 ; Mixed1 if iterate % 2 == 0 z3 = z3 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) else z3 = z3 - fz/fzp endif elseif @converge == 8 ; Mixed2 if iterate % 2 == 0 z3 = z3 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) else z3 = z3 - fz/fzp endif elseif @converge == 9 ; Mixed3 if iterate % 2 == 0 z3 = z3 - fz*fzp/(fzp^2 - fz*fzp2) else z3 = z3 - fz/fzp endif elseif @converge == 10 ; Mixed4 if iterate % 2 == 0 z3 = z3 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) else z3 = z3 - fz/fzp endif endif IF (@zmode == 87) iterexp1 = iterexp1 + exp(-1/(cabs(oldz1 - z1))) iterexp2 = iterexp2 + exp(-1/(cabs(oldz2 - z2))) iterexp3 = iterexp3 + exp(-1/(cabs(oldz3 - z3))) ENDIF done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 58) ; smallest Knot curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 59) ; smallest Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(real(#z) + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 60) ; smallest Bean theta = atan(imag(#z)/real(#z)) af1 = @a*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) polar = ((af1*cos(theta))+flip((af1*sin(theta)))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 61) ; smallest Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*@b)^2 qc = (0.05*@b)^4 - (cy^2 - (0.05*@b)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = 2.25*@a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 62) ; smallest Bow theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 63) ; smallest Cassini Ovals theta = atan(imag(#z)/real(#z)) if @negroot == true rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 64) ; smallest Circle theta = atan(imag(#z)/real(#z)) rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 65) ; smallest Trident cx = real(#z) cy = cx^2 + 0.1*@b/cx polar = 0.1*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 66) ; smallest Stirrup Curve cy = imag(#z) qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 67) ; smallest Diamond polar = @a*@safn(abs((real(#z)*@sa1))+abs((flip(imag(#z))^@sa2))-1) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 68) ; smallest Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 polar = 4*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 69) ; smallest Teardrop Curve theta = atan(imag(#z)/real(#z)) af1 = @a*cos(theta) af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 70) ; smallest Happy Accident polar = 15*@a*@safn((((real(#z)*@sa4)^(1+@sa2))+ \ (flip(imag(#z))^2*@sa3))*atan2((flip(imag(#z))^@sa7)* \ (real(#z)^@sa5))-@sa1* \ (flip(imag(#z))^@sa6)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 71) ; smallest Hyperbola theta = atan(imag(#z)/real(#z)) rr = 0.35*@a*(1/cos(2*theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 72) ; smallest Kappa Curve theta = atan(imag(#z)/real(#z)) rr = 0.1*@a*tan(theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 73) ; smallest Piriform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1+sin(theta)) af2 = 0.1*@b*cos(theta)*(1+sin(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 74) ; smallest Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif polar = 2.5*@a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 75) ; smallest Serpentine Curve theta = atan(imag(#z)/real(#z)) af1 = 0.2*@a*cotan(theta) af2 = 0.2*@b*sin(theta)*cos(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 76) ; smallest Line cx = real(#z) cy = cx polar = 3*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 77) ; smallest Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 78) ; smallest Parabola cy = imag(#z) cx = 10*@b*cy^2 polar = 0.65*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 79) ; smallest Trefoil theta = atan(imag(#z)/real(#z)) rr = 0.1*@a/cos(3*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 80) ; smallest Trident of Descartes cx = real(#z) cy = (cx-0.2*@b)*(cx+0.2*@b)*(cx-0.4*@b)/cx polar = @a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 81) ; smallest Trisectrix of Maclaurin theta = atan(imag(#z)/real(#z)) rr = 0.5*@a*sin(3*theta)/sin(2*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 82) ; smallest Atzema Spiral theta = atan(imag(#z)/real(#z)) af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 83) ; smallest Rose of Troy theta = atan(imag(#z)/real(#z)) rr = @cp*(1+10*@a*sin(4*@b*theta)) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 84) ; smallest Cotes' Spiral theta = atan(imag(#z)/real(#z)) rr = @a/cosh(@b*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 85) ; smallest Dipole Curve theta = atan(imag(#z)/real(#z)) rr = @a*(cos(theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 86) ; smallest Polytrope cx = real(#z) cy = 1/cx^@pn polar = 0.00005*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF (@p2 > |oldz1-z1| || \ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 86) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 87) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (@p2 > |oldz1-z1|) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (Cayley Mandelbrot)" helpfile = "Classical Slope Formulas.chm" center = (0.3593516980975, 0) magn = 360 method = multipass periodicity = 0 heading caption = "Slope Cayley Mandelbrot" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal that uses multiple convergence \ methods and has Julia-like regions for several convergence \ methods. Eighty eight different height value types are available. \ Use with Damien's Lighting formula, 3D Texturizer \ Enhanced III or Direct Color Slope." endheading $else heading caption = "This is a 'convergent' fractal" endheading heading caption = "that uses multiple convergence" endheading heading caption = "methods and has Mandelbrot-like regions" endheading heading caption = "for several convergence methods." endheading heading caption = "Use with Damien's Lighting" endheading heading caption = "formula or 3D Texturizer III" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p2 caption = "Bailout value" default = 0.000001 max = 0.1 endparam heading caption = "Convergence Methods" endheading param converge caption = "Convergence Method" default = 0 enum = "Newton" "Householder" "Halley" "Schroder" "Ho Custom" \ "Ha Custom" "H_S Custom" "Mixed1" "Mixed2" "Mixed3" "Mixed4" endparam float param custom caption = "H_S Constant" default = 1.5 visible = @converge==4 || @converge==5 || @converge==6 || @converge==10 endparam heading caption = "Slope Parameters" endheading param offset caption = "Orbit Separation" default = 0.0001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 87 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 || @zmode==58 || @zmode==59 \ || @zmode==60 || @zmode==61 || @zmode==62 || @zmode==63 || @zmode==64 \ || @zmode==65 || @zmode==66 || @zmode==67 || @zmode==68 || @zmode==69 \ || @zmode==70 || @zmode==71 || @zmode==72 || @zmode==73 || @zmode==74 \ || @zmode==75 || @zmode==76 || @zmode==77 || @zmode==78 || @zmode==79 \ || @zmode==80 || @zmode==81 || @zmode==82 || @zmode==83 || @zmode==84 \ || @zmode==85 || @zmode==86 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 || @zmode==61 || @zmode==62 || @zmode==63 \ || @zmode==64 || @zmode==65 || @zmode==69 || @zmode==73 || @zmode==75 \ || @zmode==78 || @zmode==80 || @zmode==82 || @zmode==83 || @zmode==84 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@zmode==83 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 || @zmode==69 || @zmode==86 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 || @zmode==60 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc param sa1 caption = "Adjuster 1" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @zmode == 70 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @zmode == 70 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @zmode == 70 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @zmode == 70 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @zmode == 70 endparam func safn caption = "Adjuster Fn" default = ident() visible = @zmode == 67 || @zmode==70 endfunc param negroot caption = "Quad Neg Root" default = false visible=@zmode==58 || @zmode==61 || @zmode==66 || @zmode==74 || @zmode==77 endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.1 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeCayleyJul" p2 = @p2 p1 = #pixel offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b cp = @cp pn = @pn afn1 = @afn1 afn2 = @afn2 safn = @safn apwr = @apwr fn1 = @fn1 sa1 = @sa1 sa2 = @sa2 sa3 = @sa3 sa4 = @sa4 sa5 = @sa5 sa6 = @sa6 sa7 = @sa7 negroot = @negroot converge = @converge custom = @custom } SlopeCayleyJul {; based upon the slope (Mandelbrot) ; formula of Damien Jones ; Ron Barnett, March 1999 ; modified to add more height values July 2004 ; modified to add more height values December 2004 ; modified to add alternate convergence methods December 2004 init: complex z1 = #pixel ; primary iterated point complex z2 = #pixel + @offset ; horizontally offset point complex z3 = #pixel + flip(@offset) ; vertically offset point int done = 2 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 float iterate = 0 complex fz = 0 complex fzp = 0 complex fzp2 = 0 loop: iterate = iterate + 1 oldz1 = z1 fz = z1^3 - @p1*z1 - @p1 + 1 fzp = 3*z1^2 - @p1 fzp2 = 6*z1 if @converge == 0 ; Newton z1 = z1 - fz/fzp elseif @converge == 1 ; Householder z1 = z1 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) elseif @converge == 2 ; Halley z1 = z1 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) elseif @converge == 3 ; Schroder z1 = z1 - fz*fzp/(fzp^2 - fz*fzp2) elseif @converge == 4 ; Ho custom z1 = z1 - fz/fzp*(1 + fz*fzp2/(@custom*fzp^2)) elseif @converge == 5 ; Ha custom z1 = z1 - 2*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 6 ; H_S custom z1 = z1 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 7 ; Mixed1 if iterate % 2 == 0 z1 = z1 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) else z1 = z1 - fz/fzp endif elseif @converge == 8 ; Mixed2 if iterate % 2 == 0 z1 = z1 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) else z1 = z1 - fz/fzp endif elseif @converge == 9 ; Mixed3 if iterate % 2 == 0 z1 = z1 - fz*fzp/(fzp^2 - fz*fzp2) else z1 = z1 - fz/fzp endif elseif @converge == 10 ; Mixed4 if iterate % 2 == 0 z1 = z1 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) else z1 = z1 - fz/fzp endif endif oldz2 = z2 fz = z2^3 - @p1*z2 - @p1 + 1 fzp = 3*z2^2 - @p1 fzp2 = 6*z2 if @converge == 0 ; Newton z2 = z2 - fz/fzp elseif @converge == 1 ; Householder z2 = z2 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) elseif @converge == 2 ; Halley z2 = z2 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) elseif @converge == 3 ; Schroder z2 = z2 - fz*fzp/(fzp^2 - fz*fzp2) elseif @converge == 4 ; Ho custom z2 = z2 - fz/fzp*(1 + fz*fzp2/(@custom*fzp^2)) elseif @converge == 5 ; Ha custom z2 = z2 - 2*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 6 ; H_S custom z2 = z2 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 7 ; Mixed1 if iterate % 2 == 0 z2 = z2 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) else z2 = z2 - fz/fzp endif elseif @converge == 8 ; Mixed2 if iterate % 2 == 0 z2 = z2 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) else z2 = z2 - fz/fzp endif elseif @converge == 9 ; Mixed3 if iterate % 2 == 0 z2 = z2 - fz*fzp/(fzp^2 - fz*fzp2) else z2 = z2 - fz/fzp endif elseif @converge == 10 ; Mixed4 if iterate % 2 == 0 z2 = z2 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) else z2 = z2 - fz/fzp endif endif oldz3 = z3 fz = z3^3 - @p1*z3 - @p1 + 1 fzp = 3*z3^2 - @p1 fzp2 = 6*z3 if @converge == 0 ; Newton z3 = z3 - fz/fzp elseif @converge == 1 ; Householder z3 = z3 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) elseif @converge == 2 ; Halley z3 = z3 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) elseif @converge == 3 ; Schroder z3 = z3 - fz*fzp/(fzp^2 - fz*fzp2) elseif @converge == 4 ; Ho custom z3 = z3 - fz/fzp*(1 + fz*fzp2/(@custom*fzp^2)) elseif @converge == 5 ; Ha custom z3 = z3 - 2*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 6 ; H_S custom z3 = z3 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) elseif @converge == 7 ; Mixed1 if iterate % 2 == 0 z3 = z3 - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) else z3 = z3 - fz/fzp endif elseif @converge == 8 ; Mixed2 if iterate % 2 == 0 z3 = z3 - 2*fz*fzp/(2*fzp^2 - fz*fzp2) else z3 = z3 - fz/fzp endif elseif @converge == 9 ; Mixed3 if iterate % 2 == 0 z3 = z3 - fz*fzp/(fzp^2 - fz*fzp2) else z3 = z3 - fz/fzp endif elseif @converge == 10 ; Mixed4 if iterate % 2 == 0 z3 = z3 - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2) else z3 = z3 - fz/fzp endif endif IF (@zmode == 87) iterexp1 = iterexp1 + exp(-1/(cabs(oldz1 - z1))) iterexp2 = iterexp2 + exp(-1/(cabs(oldz2 - z2))) iterexp3 = iterexp3 + exp(-1/(cabs(oldz3 - z3))) ENDIF done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 58) ; smallest Knot curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 59) ; smallest Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(real(#z) + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 60) ; smallest Bean theta = atan(imag(#z)/real(#z)) af1 = @a*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) polar = ((af1*cos(theta))+flip((af1*sin(theta)))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 61) ; smallest Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*@b)^2 qc = (0.05*@b)^4 - (cy^2 - (0.05*@b)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = 2.25*@a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 62) ; smallest Bow theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 63) ; smallest Cassini Ovals theta = atan(imag(#z)/real(#z)) if @negroot == true rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 64) ; smallest Circle theta = atan(imag(#z)/real(#z)) rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 65) ; smallest Trident cx = real(#z) cy = cx^2 + 0.1*@b/cx polar = 0.1*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 66) ; smallest Stirrup Curve cy = imag(#z) qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 67) ; smallest Diamond polar = @a*@safn(abs((real(#z)*@sa1))+abs((flip(imag(#z))^@sa2))-1) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 68) ; smallest Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 polar = 4*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 69) ; smallest Teardrop Curve theta = atan(imag(#z)/real(#z)) af1 = @a*cos(theta) af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 70) ; smallest Happy Accident polar = 15*@a*@safn((((real(#z)*@sa4)^(1+@sa2))+ \ (flip(imag(#z))^2*@sa3))*atan2((flip(imag(#z))^@sa7)* \ (real(#z)^@sa5))-@sa1* \ (flip(imag(#z))^@sa6)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 71) ; smallest Hyperbola theta = atan(imag(#z)/real(#z)) rr = 0.35*@a*(1/cos(2*theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 72) ; smallest Kappa Curve theta = atan(imag(#z)/real(#z)) rr = 0.1*@a*tan(theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 73) ; smallest Piriform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1+sin(theta)) af2 = 0.1*@b*cos(theta)*(1+sin(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 74) ; smallest Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif polar = 2.5*@a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 75) ; smallest Serpentine Curve theta = atan(imag(#z)/real(#z)) af1 = 0.2*@a*cotan(theta) af2 = 0.2*@b*sin(theta)*cos(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 76) ; smallest Line cx = real(#z) cy = cx polar = 3*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 77) ; smallest Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 78) ; smallest Parabola cy = imag(#z) cx = 10*@b*cy^2 polar = 0.65*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 79) ; smallest Trefoil theta = atan(imag(#z)/real(#z)) rr = 0.1*@a/cos(3*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 80) ; smallest Trident of Descartes cx = real(#z) cy = (cx-0.2*@b)*(cx+0.2*@b)*(cx-0.4*@b)/cx polar = @a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 81) ; smallest Trisectrix of Maclaurin theta = atan(imag(#z)/real(#z)) rr = 0.5*@a*sin(3*theta)/sin(2*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 82) ; smallest Atzema Spiral theta = atan(imag(#z)/real(#z)) af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 83) ; smallest Rose of Troy theta = atan(imag(#z)/real(#z)) rr = @cp*(1+10*@a*sin(4*@b*theta)) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 84) ; smallest Cotes' Spiral theta = atan(imag(#z)/real(#z)) rr = @a/cosh(@b*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 85) ; smallest Dipole Curve theta = atan(imag(#z)/real(#z)) rr = @a*(cos(theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 86) ; smallest Polytrope cx = real(#z) cy = 1/cx^@pn polar = 0.00005*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF (@p2 > |oldz1-z1| || \ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 86) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 87) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (@p2 > |oldz1-z1|) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (Cayley Julia)" helpfile = "Classical Slope Formulas.chm" maxiter = 1000 center = (0, 0) magn = 32 method = multipass periodicity = 0 heading caption = "Slope Cayley Julia" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal that uses multiple convergence \ methods and has Julia-like regions for several convergence \ methods. Eighty eight different height value types are available. \ Use with Damien's Lighting formula, 3D Texturizer \ Enhanced III or Direct Color Slope." endheading $else heading caption = "This is a 'convergent' fractal" endheading heading caption = "that uses multiple convergence" endheading heading caption = "methods and has Julia-like regions" endheading heading caption = "for several convergence methods." endheading heading caption = "Use with Damien's Lighting" endheading heading caption = "formula or 3D Texturizer III" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p1 caption = "Julia Seed" default = (0.360968017578125,0.00074462890625) hint = "This is the Julia seed, a constant parameter which \ defines the shape of the fractal." endparam param p2 caption = "Bailout value" default = 0.000001 max = 0.1 endparam heading caption = "Convergence Methods" endheading param converge caption = "Convergence Method" default = 0 enum = "Newton" "Householder" "Halley" "Schroder" "Ho Custom" \ "Ha Custom" "H_S Custom" "Mixed1" "Mixed2" "Mixed3" "Mixed4" endparam float param custom caption = "Convergence Param" default = 1.5 visible = @converge==4 || @converge==5 || @converge==6 || @converge==10 endparam heading caption = "Slope Parameters" endheading param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 87 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 || @zmode==58 || @zmode==59 \ || @zmode==60 || @zmode==61 || @zmode==62 || @zmode==63 || @zmode==64 \ || @zmode==65 || @zmode==66 || @zmode==67 || @zmode==68 || @zmode==69 \ || @zmode==70 || @zmode==71 || @zmode==72 || @zmode==73 || @zmode==74 \ || @zmode==75 || @zmode==76 || @zmode==77 || @zmode==78 || @zmode==79 \ || @zmode==80 || @zmode==81 || @zmode==82 || @zmode==83 || @zmode==84 \ || @zmode==85 || @zmode==86 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 || @zmode==61 || @zmode==62 || @zmode==63 \ || @zmode==64 || @zmode==65 || @zmode==69 || @zmode==73 || @zmode==75 \ || @zmode==78 || @zmode==80 || @zmode==82 || @zmode==83 || @zmode==84 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@zmode==83 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 || @zmode==69 || @zmode==86 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 || @zmode==60 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc param sa1 caption = "Adjuster 1" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @zmode == 70 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @zmode == 70 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @zmode == 70 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @zmode == 70 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @zmode == 70 endparam func safn caption = "Adjuster Fn" default = ident() visible = @zmode == 67 || @zmode==70 endfunc param negroot caption = "Quad Neg Root" default = false visible=@zmode==58 || @zmode==61 || @zmode==66 || @zmode==74 || @zmode==77 endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeCayleyMand" p2 = @p2 offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b cp = @cp pn = @pn afn1 = @afn1 afn2 = @afn2 safn = @safn apwr = @apwr fn1 = @fn1 sa1 = @sa1 sa2 = @sa2 sa3 = @sa3 sa4 = @sa4 sa5 = @sa5 sa6 = @sa6 sa7 = @sa7 negroot = @negroot converge = @converge custom = @custom } contest4 {; modified from Kerry Mitchell version ; by Ron Barnett, November 1999 init: #z = @start c = pixel loop: z2 = #z*#z #z = #z*z2+c*(1+#z-z2) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Contest4" maxiter = 1024 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Perturbation" default = (0,0) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1 endparam } SlopeExpContest4 { ; modified from Kerry Mitchell version ; with slope method modified from Damien Jones ; by Ron Barnett, November 1999 init: complex c1 = #pixel; primary iterated point complex c2 = #pixel + @offset; horizontally offset point complex c3 = #pixel + flip(@offset); vertically offset point complex z1 = @start; starting value complex z2 = @start complex z3 = @start int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z11 = z1*z1 z22 = z2*z2 z33 = z3*z3 z1 = z1*z11+c1*(1+z1-z11) z2 = z2*z22+c2*(1+z2-z22) z3 = z3*z33+c3*(1+z3-z33) iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (Contest4)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Starting Point" default = (0,0) hint = "Starting value for each point. You can use this to \ 'perturb' the fractal." endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the set anymore." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam } Pokorny {; Ron Barnett, November 1999 init: #z = @start c = #pixel loop: #z = 1/(#z*#z + c) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Pokorny" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1 endparam switch: type = "PokornyJulia" bailout = @bailout seed = #pixel test = @test } PokornyJulia {; Ron Barnett, December 1999 ; a Julia function based upon the Ikenaga function ; modified from the original Fractint frm init: #z = #pixel loop: #z = 1/(#z*#z + @seed) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Porkorny Julia" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1 endparam param seed caption = "seed" default = (0.575, 0.3375) endparam switch: type = "Pokorny" bailout = @bailout test = @test } SlopeExpIkenaga { ; based upon the slope (Mandelbrot) ; formula of Damien Jones ; Ron Barnett, November 1999 ; Modified with more Height Values July 2004 ; init: complex c1 = #pixel; primary iterated point complex c2 = #pixel + @offset; horizontally offset point complex c3 = #pixel + flip(@offset); vertically offset point complex z1 = ((1-c1)/3)^0.5; starting value complex z2 = ((1-c2)/3)^0.5 complex z3 = ((1-c3)/3)^0.5 int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = z1*z1*z1+(c1-1)*z1-c1; iterate each point z2 = z2*z2*z2+(c2-1)*z2-c2 z3 = z3*z3*z3+(c3-1)*z3-c3 iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 57) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 58) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (Ikenaga)" center = (-0.5, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Ikenaga set anymore." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 58 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func @fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 endfunc param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeExpIkenagaJulia" seed = #pixel bailout = @bailout offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b pn = @pn afn1 = @afn1 afn2 = @afn2 fn1 = @fn1 } SlopeExpIkenagaJulia { ; based upon the slope (Julia) ; formula of Damien Jones ; Ron Barnett, November 1999 ; Modified with more Height Values July 2004 ; init: complex z1 = #pixel; primary iterated point complex z2 = #pixel + @offset; horizontally offset point complex z3 = #pixel + flip(@offset); vertically offset point int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = z1*z1*z1+(@seed-1)*z1-@seed ; iterate each point z2 = z2*z2*z2+(@seed-1)*z2-@seed z3 = z3*z3*z3+(@seed-1)*z3-@seed iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 57) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 58) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (Ikenaga Julia)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param seed caption = "Julia Seed" default = (0,-0.1625) hint = "This is the Julia seed, a constant parameter which \ defines the shape of the fractal." endparam param bailout caption = "Bail-out Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Ikenaga set anymore." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 58 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func @fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 endfunc param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeExpIkenaga" bailout = @bailout offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b pn = @pn afn1 = @afn1 afn2 = @afn2 fn1 = @fn1 } SlopeExpMandelLambdaPwr { ; based upon the slope (Mandelbrot) ; formula of Damien Jones ; Ron Barnett, November 1999 ; init: complex c1 = #pixel; primary iterated point complex c2 = #pixel + @offset; horizontally offset point complex c3 = #pixel + flip(@offset); vertically offset point complex z1 = (1/(@p1+1))^(1/@p1); starting value complex z2 = (1/(@p1+1))^(1/@p1) complex z3 = (1/(@p1+1))^(1/@p1) int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = c1*z1*(1 - z1^@p1); iterate each point z2 = c2*z2*(1 - z2^@p1) z3 = c3*z3*(1 - z3^@p1) iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (MandelLambdaPwr)" center = (1.0, 0.0) magn = 0.7 maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the MandelLambdaPwr set anymore." endparam param p1 caption = "Power" default = (1.0,0.0) endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeExpLambdaPwr" seed = #pixel p1 = @p1 bailout = @bailout offset = @offset zmode = @zmode xfer = @xfer zscale = @zscale zscale2 = @zscale2 everyiter = @everyiter } SlopeExpLambdaPwr { ; based upon the slope (Julia) ; formula of Damien Jones ; Ron Barnett, November 1999 ; init: complex z1 = #pixel; primary iterated point complex z2 = #pixel + @offset; horizontally offset point complex z3 = #pixel + flip(@offset); vertically offset point int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = @seed*z1*(1 - z1^@p1) ; iterate each point z2 = @seed*z2*(1 - z2^@p1) z3 = @seed*z3*(1 - z3^@p1) iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (LambdaPwr)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param seed caption = "Julia Seed" default = (0.964,-0.303) hint = "This is the Julia seed, a constant parameter which \ defines the shape of the fractal." endparam param p1 caption = "Power" default = (1.0,0.0) endparam param bailout caption = "Bail-out Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Ikenaga set anymore." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeExpMandelLambdaPwr" bailout = @bailout offset = @offset zmode = @zmode xfer = @xfer zscale = @zscale zscale2 = @zscale2 everyiter = @everyiter } SlopeExpFrame-RbtM { ; based upon the slope (Mandelbrot) ; formula of Damien Jones ; Ron Barnett, November 1999 ; init: complex c1 = #pixel; primary iterated point complex c2 = #pixel + @offset; horizontally offset point complex c3 = #pixel + flip(@offset); vertically offset point complex z1 = @start; starting value complex z2 = @start complex z3 = @start int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = z1*z1*z1/5 + z1*z1 + c1 z2 = z2*z2*z2/5 + z2*z2 + c2 z3 = z3*z3*z3/5 + z3*z3 + c3 iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current angles d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 7) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 8) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (Frame-RbtM)" center = (-2.0, 0.0) magn = 0.7 maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Starting Point" default = (0,0) hint = "Starting value for each point. You can use this to \ 'perturb' the fractal." endparam param power caption = "Exponent" default = (2,0) hint = "Overall exponent for the equation. (2,0) gives \ the classic Mandelbrot type." endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 8 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function(z)|" "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam func @fn1 caption = "Transmute Function" default = sin() endfunc switch: type = "SlopeExpFrame-RbtJ" seed = #pixel bailout = @bailout zmode = @zmode offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 everyiter = @everyiter } SlopeExpFrame-RbtJ { ; based upon the slope (Julia) ; formula of Damien Jones ; Ron Barnett, November 1999 ; Modified March 14, 2003 ; init: complex z1 = #pixel; primary iterated point complex z2 = #pixel + @offset; horizontally offset point complex z3 = #pixel + flip(@offset); vertically offset point int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = z1*z1*z1/5 + z1*z1 + @seed z2 = z2*z2*z2/5 + z2*z2 + @seed z3 = z3*z3*z3/5 + z3*z3 + @seed iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function(z)| d1 = abs(real(@fn1(z1))) + abs(imag(@fn1(z1))) ; get current angles d2 = abs(real(@fn1(z2))) + abs(imag(@fn1(z2))) d3 = abs(real(@fn1(z3))) + abs(imag(@fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 7) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 8) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (Frame-RbtJ)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param seed caption = "Julia Seed" default = (-0.964,-0.178) hint = "This is the Julia seed, a constant parameter which \ defines the shape of the fractal." endparam param start caption = "Starting Point" default = (0,0) hint = "Starting value for each point. You can use this to \ 'perturb' the fractal." endparam param bailout caption = "Bail-out Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 8 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function(z)|" "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam func @fn1 caption = "Transmute Function" default = sin() endfunc switch: type = "SlopeExpFrame-RbtM" bailout = @bailout offset = @offset zmode = @zmode xfer = @xfer zscale = @zscale zscale2 = @zscale2 everyiter = @everyiter } SlopeExpGopalsamy { ; based upon the slope (Mandelbrot) ; formula of Damien Jones ; Ron Barnett, December 1999 ; init: complex z1 = #pixel; primary iterated point complex z2 = #pixel + @offset; horizontally offset point complex z3 = #pixel + flip(@offset); vertically offset point int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 float px = 0.0 float py = 0.0 float r = 0.0 float theta = 0.0 loop: px = real(#pixel) py = imag(#pixel) theta = atan2(py/px) x = real(z1) y = imag(z1) x1 = -2*x*y + @p1 y = y*y - x*x z1 = x1 + flip(y) x = real(z2) y = imag(z2) x1 = -2*x*y + @p1 y = y*y - x*x z2 = x1 + flip(y) x = real(z3) y = imag(z3) x1 = -2*x*y + @p1 y = y*y - x*x z3 = x1 + flip(y) iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|*|imag(z)| / |real(z)|+|imag(z)| d1 = abs(real(z1))*abs(imag(z1))/(abs(real(z1))+abs(imag(z1))) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2))/(abs(real(z2))+abs(imag(z2))) d3 = abs(real(z3))*abs(imag(z3))/(abs(real(z3))+abs(imag(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |imag(z)|/|real(z)| d1 = abs(imag(z1))/abs(real(z1)) ; get current distances from i axis d2 = abs(imag(z2))/abs(real(z2)) d3 = abs(imag(z3))/abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; distance between z and point d1 = |z1-@point| d2 = |z2-@point| d3 = |z3-@point| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; distance between z and function IF @df == 0 r = @a*sqrt(cos(2*theta)) ELSEIF @df == 1 r = @a*(1-cos(theta)) ELSEIF @df == 2 r = (@a + @b*cos(theta))/cos(theta) ELSEIF @df == 3 r = @a*theta ELSEIF @df == 4 r = exp(@a*theta) ELSEIF @df == 5 r = @a*cos(theta) ENDIF pf = r*cos(theta) + flip(r*sin(theta)) d1 = |z1-pf| d2 = |z2-pf| d3 = |z3-pf| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 10) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 11) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (Gopalsamy)" center = (0.0, 0.0) maxiter = 1000 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Starting Point" default = (0,0) hint = "Starting value for each point. You can use this to \ 'perturb' the fractal." endparam param p1 caption = "seed" default = (-0.19, -0.19) endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 11 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest summ(z)" "smallest prod(z)" "scaled prod(z)" \ "smallest ratio1(z)" "smallest ratio2(z)" "smallest |atan(z)|" \ "distance to point" "distance to function" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin"\ "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param point caption = "Point" default = (-1.0, 1.0) hint = "Point for distance calculation" endparam param df caption = "Polar function" default = 0 enum = "lemniscate" "cardiod" "conchoid" \ "archimedes" "log spiral" "rose" endparam param a caption = "Polar parameter" default = 1.0 hint = "Affects spread and scale" endparam param b caption = "Conchoid parameter" default = 1.0 hint = "Affects shape and scale. \ Use only with conchoid function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam } Mask {; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = @fn1(#pixel) loop: #z = @p1*@fn2(#z)^2 + @p2*@fn3(#z)^2 + #pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Mask" center = (0.0, 0.0) maxiter = 256 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1 endparam param p1 caption = "Parameter 1" default = (0.0, 1.0) endparam param p2 caption = "Parameter 2" default = (0.0,1.0) endparam func fn1 caption = "Function 1" default = log() endfunc func fn2 caption = "Function 2" default = sinh() endfunc func fn3 caption = "Function 3" default = cosh() endfunc switch: type = "JMask" bailout = @bailout p3 = #pixel p1 = @p1 p2 = @p2 fn1 = @fn1 fn2 = @fn2 fn3 = @fn3 } JMask {; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = @fn1(#pixel) loop: #z = @p1*@fn2(#z)^2 + @p2*@fn3(#z)^2 + @p3 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "JMask" center = (0.0, 0.0) maxiter = 256 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1 endparam param p1 caption = "Parameter 1" default = (0.0, 1.0) endparam param p2 caption = "Parameter 2" default = (0.0, 1.0) endparam param p3 caption = "Parameter 3" default = (-0.32, -.7125) endparam func fn1 caption = "Function 1" default = log() endfunc func fn2 caption = "Function 2" default = sinh() endfunc func fn3 caption = "Function 3" default = cosh() endfunc switch: type = "Mask" bailout = @bailout p1 = @p1 p2 = @p2 fn1 = @fn1 fn2 = @fn2 fn3 = @fn3 } PseudoZeePi {; Ron Barnett, 1993 ; Modified and tweaked February 2000 init: #z = #pixel loop: x = 1-#z^@p1; #z = #z*((1-x)/(1+x))^(1/@p1) + @p2 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "PseudoZeePi" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1 endparam param p1 caption = "Parameter 1" default = (2.0, 0.0) endparam param p2 caption = "Parameter 2" default = (0.33, 0.0) endparam } RecipIkeM {; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = 1/(#z*#z*#z + (#pixel-1)*#z - #pixel) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) >= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "RecipIkeM" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1 endparam switch: type = "RecipIkeJ" bailout = @bailout p1 = #pixel } RecipIkeJ {; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = 1/(#z*#z*#z + (@p1-1)*#z - @p1) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "RecipIkeJ" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1 endparam param p1 caption = "Parameter 1" default = (0.2125, -0.4875) endparam switch: type = "RecipIkeM" bailout = @bailout } IkeGenM { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = ((1-#pixel)/(3*@p1))^0.5 loop: #z =@p1*#z*#z*#z + (#pixel-1)*#z - #pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "IkeGenM" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.0, 0.0) endparam switch: type = "IkeGenJ" bailout = @bailout p2 = #pixel p1 = @p1 } IkeGenJ { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z =@p1*#z*#z*#z + (@p2-1)*#z - @p2 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "IkeGenJ" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.0, 0.0) endparam param p2 caption = "Parameter 2" default = (0.0375, 0.25) endparam switch: type = "IkeGenM" bailout = @bailout p1 = @p1 } FrRbtGenM {; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = @p1*#z*#z*#z + #z*#z + #pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "FrRbtGenM" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (0.2, 0.0) endparam switch: type = "FrRbtGenJ" bailout = @bailout p2 = #pixel p1 = @p1 } FrRbtGenJ {; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = @p1*#z*#z*#z + #z*#z + @p2 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "FrRbtGenJ" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (0.2, 0.0) endparam param p2 caption = "Parameter 2" default = (-1.025, 0.35) endparam switch: type = "FrRbtGenM" bailout = @bailout p1 = @p1 } IkeFrRbtGenM {; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = 2*(1-#pixel)/(3*@p1) loop: #z = @p1*#z*#z*#z + (#pixel-1)*#z*#z - #pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "IkeFrRbtGenM" center = (0.0, 0.0) maxiter = 1000 periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10000.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.0, 0.0) endparam switch: type = "IkeFrRbtGenJ" bailout = @bailout p2 = #pixel p1 = @p1 } IkeFrRbtGenJ {; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = @p1*#z*#z*#z + (@p2-1)*#z*#z - @p2 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "IkeFrRbtGenJ" center = (0.5, 0.0) maxiter = 1000 periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10000.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.0, 0.0) endparam param p2 caption = "Parameter 2" default = (0.375, -0.1125) endparam switch: type = "IkeFrRbtGenM" bailout = @bailout p1 = @p1 } PolyGenM { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z=(-@p2+(@p2*@p2+(1-#pixel)*3*@p1)^0.5)/(3*@p1) loop: #z=@p1*#z*#z*#z+@p2*#z*#z+(#pixel-1)* #z-#pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "PolyGenM" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.0, 0.0) endparam param p2 caption = "Parameter 2" default = (1.0, 0.0) endparam switch: type = "PolyGenJ" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel } PolyGenJ { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z=(-@p2+(@p2*@p2+(1-#pixel)*3*@p1)^0.5)/(3*@p1) loop: #z=@p1*#z*#z*#z+@p2*#z*#z+(@p3-1)* #z-@p3 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "PolyGenJ" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.0, 0.0) endparam param p2 caption = "Parameter 2" default = (1.0, 0.0) endparam param p3 caption = "Parameter 3" default = (0.3375, -0.325) endparam switch: type = "PolyGenM" bailout = @bailout p1 = @p1 p2 = @p2 } Gopalsamy2 { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 ; Modified October 2006 ; Versioning and more parameters added April 2007 init: #z = #pixel loop: ; The original code from Fractint was: ; x = real(#z) ; y = imag(#z) ; x1 = -4*x*y + @p1 ; y = 4*y*y - x*x ; #z = x1 + flip(y) x = real(#z) y = imag(#z)*@a #z = x + flip(y) #z = -(0,1)*conj(#z)^@power + @p1 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Gopalsamy2" center = (0.0, 0.0) maxiter = 1000 periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param a caption = "Parameter a" default = 2.0 endparam complex param power caption = "Power" default = (2,0) endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam param p1 caption = "Seed" default = (-0.18, -0.18) endparam switch: type = "MandelGopalsamy2" bailout = @bailout a = a power = power } Gopalsamy3 { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: x = real(#z) y = imag(#z) x1 = 3*x*y*y - x*x*x + @p1 y = y*y*y - 3*x*x*y #z = x1 + flip(y) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Gopalsamy3" maxiter = 1000 center = (0, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam param p1 caption = "Parameter 1" default = (-0.6, -0.6) endparam switch: type = "MandelGopalsamy3" bailout = @bailout } Gopalsamy4 { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: x = real(#z) y = imag(#z) x1 = -x*y + @p1 y = 2*y*y - 3*x*x #z = x1 + flip(y) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Gopalsamy4" maxiter = 1000 center = (0, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam param p1 caption = "Parameter 1" default = (-0.26, -0.26) endparam switch: type = "MandelGopalsamy4" bailout = @bailout start = @start } Gopalsamy5 { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 ; Modified October 2006 init: #z = #pixel loop: x = real(#z) y = imag(#z) x1 = 2*x*y y1 = x*x - y*y x2 = -2*x1*y1 + @p1 y = y1*y1 - x1*x1 #z = x2 + flip(y) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Gopalsamy5" maxiter = 1000 center = (0, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam param p1 caption = "Parameter 1" default = (-0.5, -0.5) endparam switch: type = "MandelGopalsamy5" bailout = @bailout } GopalsamySin2 { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: x = real(#z) y = imag(#z) x1 = sin(x)*cosh(y) y1 = cos(x)*sinh(y) x2 = -2*x1*y1 + @p1 y = y1*y1 - x1*x1 #z = x2 + flip(y) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "GopalsamySin2" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (0.96, 0.96) endparam } GopalsamySin { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: x = real(#z) y = imag(#z) x1 = -sin(x)*cosh(y) + @p1 y = -cos(x)*sinh(y) #z = x1 + flip(y) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "GopalsamySin" maxiter = 1000 center = (0, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam param p1 caption = "Parameter 1" default = (0.96, 0.96) endparam switch: type = "GopalsamySin" bailout = @bailout } GopalsamyExp { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 ; Modified October 2006 init: #z = #pixel loop: x = real(#z) y = imag(#z) x1 = -exp(x)*cos(y) + @p1 y = -exp(x)*sin(y) #z = x1 + flip(y) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "GopalsamyExp" maxiter = 1000 center = (0, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam param p1 caption = "Parameter 1" default = (0.96, 0.96) endparam switch: type = "MandelGopalsamyExp" bailout = @bailout } GopalsamyExp2 { ; Ron Barnett, October 2006 init: #z = #pixel loop: x = real(#z) y = imag(#z) x1 = exp(x)*cos(y) y1 = exp(x)*sin(y) x2 = -2*x1*y1 + @p1 y = y1*y1 - x1*x1 #z = x2 + flip(y) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "GopalsamyExp2" maxiter = 1000 center = (0, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam param p1 caption = "Parameter 1" default = (-0.4, 0.19) endparam switch: type = "MandelGopalsamyExp2" bailout = @bailout } GopalsamySinh2 { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: x = real(#z) y = imag(#z) x1 = sinh(x)*cos(y) y1 = cosh(x)*sin(y) x2 = -2*x1*y1 + @p1 y = y1*y1 - x1*x1 #z = x2 + flip(y) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "GopalsamySinh2" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (0.5, 0.5) endparam } GopalsamySinh { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: x = real(#z) y = imag(#z) x1 = -sinh(x)*cos(y) + @p1 y = -cosh(x)*sin(y) #z = x1 + flip(y) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "GopalsamySinh" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (-1.0, 0.9) endparam } GopalsamyFn { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 ; modified October 2006 init: #z = #pixel loop: x = real(#z) y = imag(#z) x1 = @fn1(x)*@fn2(y) y1 = @fn3(x)*@fn4(y) x2 = -2*x1*y1 + @p1 y = y1*y1 - x1*x1 #z = x2 + flip(y) bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "GopalsamyFn" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam param p1 caption = "Parameter 1" default = (-0.23, -0.1) endparam func fn1 caption = "First Function" default = asin() endfunc func fn2 caption = "Second Function" default = cos() endfunc func fn3 caption = "Third Function" default = cosh() endfunc func fn4 caption = "Fourth Function" default = atan() endfunc switch: type = "MandelGopalsamyFn" bailout = @bailout fn1 = @fn1 fn2 = @fn2 fn3 = @fn3 fn4 = @fn4 } OldMandelPhoenix {; Ron Barnett, 1990 ; Old formula from Stevens Turbo Pascal book ; Modified and tweaked March 2000 init: #z = 0 complex x1 = 0 complex y = 0 loop: x1 = #z*#z + real(#pixel) + imag(#pixel)*y y = #z #z = x1 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "OldMandelPhoenix" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam switch: type = "OldPhoenix" bailout = @bailout p1 = #pixel } OldPhoenix {; Ron Barnett, 1990 ; Old formula from Stevens Turbo Pascal book ; Modified and tweaked March 2000 init: #z = flip(#pixel) complex x1 = 0 complex y = 0 loop: x1 = #z*#z + real(@p1) + imag(@p1)*y y = #z #z = x1 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "OldPhoenix" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (0.56667, -0.5) endparam switch: type = "OldMandelPhoenix" bailout = @bailout } Ikenagafn { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = @fn1(#z*#z*#z) + (@p1*#pixel-1)*#z - @p2*#pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Ikenagafn" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.0, 0.0) endparam param p2 caption = "Parameter 2" default = (1.0, 0.0) endparam func fn1 caption = "First Function" default = sin() endfunc } IkenagaOriginal { ; Ron Barnett, 1990 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = #z*#z*#z + (#pixel-1)*#z - #pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "IkenagaOriginal" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam } CubicM { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = (#z-1)*(#z-1)*(#z+1) - #pixel + 1 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "CubicM" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam switch: type = "CubicJ" bailout = @bailout p1 = #pixel } CubicJ { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = (#z-1)*(#z-1)*(#z+1) - @p1 + 1 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "CubicJ" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (0.559, -0.2) endparam switch: type = "CubicM" bailout = @bailout } CubicfnM { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = @fn1((#z-1)*(#z-1)*(#z+1)) - #pixel*@p1 + @p2 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "CubicfnM" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.0, 0.0) endparam param p2 caption = "Parameter 2" default = (1.0, 0.0) endparam func fn1 caption = "Function" default = sin() endfunc switch: type = "CubicfnJ" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel fn1 = @fn1 } CubicfnJ { ; Ron Barnett, 1993 ; Modified and tweaked March 2000 init: #z = #pixel loop: #z = @fn1((#z-1)*(#z-1)*(#z+1)) - @p3*@p1 + @p2 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "CubicfnJ" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (1.0, 0.0) endparam param p2 caption = "Parameter 2" default = (1.0, 0.0) endparam param p3 caption = "Parameter 3" default = (1.525, -0.3125) endparam func fn1 caption = "Function" default = sin() endfunc switch: type = "CubicfnM" bailout = @bailout p1 = @p1 p2 = @p2 fn1 = @fn1 } 4DMandelfnfnczPlane {; Ron Barnett, 1998 ; Modified and tweaked March 2000 init: #z=@p1*real(#pixel)+flip(imag(#pixel)) c=@p2+real(#pixel)+flip(imag(#pixel)*@p1) loop: if (cabs(#z) < @p3) #z = @fn1(#z) + c else #z = @fn2(#z) + c endif bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "4DMandelfnfnczPlane" center = (0.0, 0.0) maxiter = 256 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Parameter 1" default = (0.0, 0.0) endparam param p2 caption = "Parameter 2" default = (0.0, 0.0) endparam param p3 caption = "Parameter 3" default = (0.5, 0.0) endparam func fn1 caption = "Function 1" default = sin() endfunc func fn2 caption = "Function 2" default = sqr() endfunc } SJIkenagamap01 {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: y = ((1-#pixel)/3)^0.5 #z=real(y)+flip(imag(y)*@p1) c=@p2+@p1*real(#pixel)+flip(imag(#pixel)) loop: #z = #z*#z*#z + (c - 1)*#z - c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "SJIkenagamap01" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.0,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam switch: type = "SJIkenagamap01J" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel } SJIkenagamap01J {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: y = ((1-#pixel)/3)^0.5 #z=real(y)+flip(imag(y)*@p1) c=@p2+@p1*real(@p3)+flip(imag(@p3)) loop: #z = #z*#z*#z + (c - 1)*#z - c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "SJIkenagamap01J" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param p3 caption = "seed" default = (-1.1125, -0.2625) endparam switch: type = "sjikenagamap01" bailout = @bailout p1 = @p1 p2 = @p2 } SJIkenaga01 {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=real(#pixel)+flip(imag(#pixel)*@p1) c=@p2+@p1*real(#pixel)+flip(imag(#pixel)) loop: #z=#z*#z*#z+(c-1)*#z-c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "SJIkenaga01" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.0,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam } 3RDIMIkenaga01 {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=@p1*real(#pixel)+flip(imag(#pixel)) c=@p2+real(#pixel)+flip(imag(#pixel)*@p1) loop: #z=#z*#z*#z+(c-1)*#z-c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "3RDIMIkenaga01" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam } SJFrame-Robert {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=real(#pixel)+flip(imag(#pixel)*@p1) c=@p2+@p1*real(#pixel)+flip(imag(#pixel)) loop: #z=#z*#z*#z/5+#z*#z+c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "SJFrame-Robert" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.0,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam switch: type = "SJFrame-RobertJ" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel } SJFrame-RobertJ {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=real(#pixel)+flip(imag(#pixel)*@p1) c=@p2+@p1*real(@p3)+flip(imag(@p3)) loop: #z=#z*#z*#z/5+#z*#z+c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "SJFrame-RobertJ" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param p3 caption = "seed" default = (-0.157,-0.745) endparam switch: type = "SJFrame-Robert" bailout = @bailout p1 = @p1 p2 = @p2 } 3RDIMFrame-Robert {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=@p1*real(#pixel)+flip(imag(#pixel)) c=@p2+real(#pixel)+flip(imag(#pixel)*@p1) loop: #z=#z*#z*#z/5+#z*#z+c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "3RDIMFrame-Robert" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam switch: type = "3RDIMFrame-RobertJ" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel } 3RDIMFrame-RobertJ {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=@p1*real(#pixel)+flip(imag(#pixel)) c=@p2+real(@p3)+flip(imag(@p3)*@p1) loop: #z=#z*#z*#z/5+#z*#z+c bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "3RDIMFrame-RobertJ" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param p3 caption = "seed" default = (-0.97,-0.55) endparam switch: type = "3RDIMFrame-Robert" bailout = @bailout p1 = @p1 p2 = @p2 } SJSpider01 {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=real(#pixel)+flip(imag(#pixel)*@p1) c=@p2+@p1*real(#pixel)+flip(imag(#pixel)) loop: #z=#z*#z+c c=c/2+#z bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "SJSpider01" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam switch: type = "SJSpider01J" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel } SJSpider01J {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=real(#pixel)+flip(imag(#pixel)*@p1) c=@p2+@p1*real(@p3)+flip(imag(@p3)) loop: #z=#z*#z+c c=c/2+#z bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "SJSpider01J" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param p3 caption = "seed" default = (-0.7125,-0.475) endparam switch: type = "SJSpider01" bailout = @bailout p1 = @p1 p2 = @p2 } 3RDIMSpider01 {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=@p1*real(#pixel)+flip(imag(#pixel)) c=@p2+real(#pixel)+flip(imag(#pixel)*@p1) loop: #z=#z*#z+c c=c/2+#z bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "3RDIMSpider01" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam switch: type = "3RDIMSpider01J" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel } 3RDIMSpider01J {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=@p1*real(#pixel)+flip(imag(#pixel)) c=@p2+real(@p3)+flip(imag(@p3)*@p1) loop: #z=#z*#z+c c=c/2+#z bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "3RDIMSpider01J" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param p3 caption = "seed" default = (0.1,-0.625) endparam switch: type = "3RDIMSpider01" bailout = @bailout p1 = @p1 p2 = @p2 } SJManowar01 {; Ron Barnett, 1994 ; Modified and tweaked March 2000 ; Fixed algorithm code September 2006 init: #z=real(#pixel)+flip(imag(#pixel)*@p1) z1 = #z c=@p2+@p1*real(#pixel)+flip(imag(#pixel)) loop: complex oldz = #z #z = oldz*oldz + z1 + c z1 = oldz ; old code ; #z=#z*#z+z1+c ; z1=#z bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "SJManowar01" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam switch: type = "SJManowar01J" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel } SJManowar01J {; Ron Barnett, 1994 ; Modified and tweaked March 2000 init: #z=real(#pixel)+flip(imag(#pixel)*@p1) z1 = #z c=@p2+@p1*real(@p3)+flip(imag(@p3)) loop: complex oldz = #z #z = oldz*oldz + z1 + c z1 = oldz ; old code ; #z=#z*#z+z1+c ; z1=#z bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "SJManowar01J" maxiter = 255 center = (0, 0) param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param p3 caption = "seed" default = (0.2,0.06) endparam switch: type = "SJManowar01" bailout = @bailout p1 = @p1 p2 = @p2 } 3RDIMManowar01 {; Ron Barnett, 1994 ; Modified and tweaked March 2000 ; Algorithm error corrected September 2006 init: #z=@p1*real(#pixel)+flip(imag(#pixel)) z1 = #z c=@p2+real(#pixel)+flip(imag(#pixel)*@p1) loop: complex oldz = #z if @version == "1.0" #z = oldz*oldz + z1 + c z1 = oldz elseif @version == "0" ; old code, which is in error #z = #z*#z + z1 + c z1=#z endif bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "3RDIMManowar01" maxiter = 255 center = (0, 0) $ifdef VER40 heading text = "If your old upr does perform correctly, change the default 'Version \ number' to '0'. DO NOT CHANGE THE DEFAULT VALUE FOR NEW UPRS!" endheading $endif param version default = 1 enum = "0" "1.0" hint = "This is for backwards compatibility with old versions \ of the formula. If your old upr does perform correctly, change the default 'Version \ number' to '0'. DO NOT CHANGE THE DEFAULT VALUE FOR NEW UPRS!" endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam switch: type = "3RDIMManowar01J" bailout = @bailout p1 = @p1 p2 = @p2 p3 = #pixel version = @version } 3RDIMManowar01J {; Ron Barnett, 1994 ; Modified and tweaked March 2000 ; code algorithm corrected September 2006 init: #z=@p1*real(#pixel)+flip(imag(#pixel)) z1 = #z c=@p2+real(@p3)+flip(imag(@p3)*@p1) loop: complex oldz = #z if @version == "1.0" #z = oldz*oldz + z1 + c z1 = oldz elseif @version == "0" ; old code, which is in error #z = #z*#z + z1 + c z1=#z endif bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "3RDIMManowar01J" maxiter = 255 center = (0, 0) $ifdef VER40 heading text = "If your old upr does perform correctly, change the default 'Version \ number' to '0'. DO NOT CHANGE THE DEFAULT VALUE FOR NEW UPRS!" endheading $endif param version default = 1 enum = "0" "1.0" hint = "This is for backwards compatibility with old versions \ of the formula. If your old upr does perform correctly, change the default 'Version \ number' to '0'. DO NOT CHANGE THE DEFAULT VALUE FOR NEW UPRS!" endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 100.0 min = 1 endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param p3 caption = "seed" default = (0.06,-0.1) endparam switch: type = "3RDIMManowar01" bailout = @bailout p1 = @p1 p2 = @p2 version = @version } MandelbrotMix4_UF {; Ron Barnett, June 2000 ; This is a Ultrafractal conversion with some ; Generalization of the MandelbrotMix4 formula ; created by Jim Muth (with his permission). init: float a = real(@p1) float b = imag(@p1) float d = real(@p2) float f = imag(@p2) #z = (-a*b/(f*d))^(1/(f-b)) float k = real(p3) + 1 float l = imag(p3) + 100 complex c = @fn1(#pixel) loop: #z = k*(a*#z^b + d*#z^f) + c bailout: (@test == 0 && |#z| <= l) || \ (@test == 1 && sqr(real(#z)) <= l) || \ (@test == 2 && sqr(imag(#z)) <= l) || \ (@test == 3 && (sqr(real(#z)) <= l && sqr(imag(#z)) < l)) || \ (@test == 4 && (sqr(real(#z)) <= l || sqr(imag(#z)) < l)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= l)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= l)) default: title = "MandelbrotMix4_UF" maxiter = 255 center = (0, 0) periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p1 caption = "Parameter 1" default = (1,4) endparam param p2 caption = "Parameter 2" default = (2,2) endparam param p3 caption = "Parameter 3" default = (-0.5,0) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam func fn1 caption = "Function 1" default = abs() endfunc switch: type = "JuliaMix4_UF" p1 = @p1 p2 = @p2 p3 = @p3 test = @test fn1 = @fn1 seed = #pixel } SlopeExpMandelbrotMix4_UF {; Ron Barnett, June 2000 ; This is a Ultrafractal conversion with some ; Generalization of the MandelbrotMix4 formula ; created by Jim Muth (with his permission). ; Some of the code based upon the slope (Mandelbrot) ; formula of Damien Jones init: float a = real(@p1) float b = imag(@p1) float d = real(@p2) float f = imag(@p2) float k = real(p3) + 1 complex c1 = @fn1(#pixel) ; primary iterated point complex c2 = @fn1(#pixel) + @offset ; horizontally offset point complex c3 = @fn1(#pixel) + flip(@offset) ; vertically offset point complex z1 = (-a*b/(f*d))^(1/(f-b)) ; starting value complex z2 = (-a*b/(f*d))^(1/(f-b)) complex z3 = (-a*b/(f*d))^(1/(f-b)) int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = k*(a*z1^b + d*z1^f) + c1 ; iterate each point z2 = k*(a*z2^b + d*z2^f) + c2 z3 = k*(a*z3^b + d*z3^f) + c3 iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (MandelbrotMix4_UF)" center = (0.0, 0.0) maxiter = 1000 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam float param bailout caption = "bailout" default = 1e5 endparam param p1 caption = "Parameter 1" default = (1,4) endparam param p2 caption = "Parameter 2" default = (2,2) endparam float param p3 caption = "Parameter 3" default = -0.5 endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam func fn1 caption = "Function 1" default = ident() endfunc switch: type = "SlopeExpJuliaMix4_UF" p1 = @p1 p2 = @p2 p3 = @p3 test = @test fn1 = @fn1 offset = @offset zmode = @zmode xfer = @xfer zscale = @zscale zsacale2 = @zscale2 everyiter = @everyiter seed = #pixel } NegativeMandelPower {; Ron Barnett, October 2008 ; Mandelbrot with extended bailout options init: #z = #pixel loop: #z = (-#z)^@power + #pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Negative MandelPower" maxiter = 1000 center = (-0.5, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam complex param power caption = "Power" default = (2,0) endparam switch: type = "NegativeJuliaPower" bailout = @bailout power = @power p1 = #pixel test = @test } NegativeJuliaPower {; Ron Barnett, October 2008 ; Mandelbrot with extended bailout options init: #z = #pixel loop: #z = (-#z)^@power + @p1 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Negative JuliaPower" maxiter = 1000 center = (0, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam complex param power caption = "Power" default = (2,0) endparam param p1 caption = "seed" default = (-0.75, 0.2) endparam switch: type = "NegativeMandelPower" bailout = @bailout power = @power test = @test } MandelbrotBailout {; Ron Barnett, September 2000 ; Mandelbrot with extended bailout options init: #z = #pixel loop: #z = #z^@power + #pixel bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Mandelbrot Bailout" maxiter = 1000 center = (-0.5, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam complex param power caption = "Power" default = (2,0) endparam switch: type = "JuliaBailout" bailout = @bailout power = @power p1 = #pixel test = @test } JuliaBailout {; Ron Barnett, September 2000 ; Mandelbrot with extended bailout options init: #z = #pixel loop: #z = #z^@power + @p1 bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Julia Bailout" maxiter = 1000 center = (0, 0) periodicity = 0 method = multipass param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam float param bailout caption = "Bailout value" default = 10000 min = 1 endparam complex param power caption = "Power" default = (2,0) endparam param p1 caption = "seed" default = (-0.75, 0.2) endparam switch: type = "MandelbrotBailout" bailout = @bailout power = @power test = @test } SlopeExp3RDIMSpider01 {; Ron Barnett, September 2000 ; Some of the code based upon the slope (Mandelbrot) ; formula of Damien Jones init: complex c1 = @p2 + real(#pixel) + flip(imag(#pixel)*@p1) complex c2 = @p2 + real(#pixel) + flip(imag(#pixel)*@p1) + @offset complex c3 = @p2 + real(#pixel) + flip(imag(#pixel)*@p1) + flip(@offset) complex z1 = @p1*real(#pixel) + flip(imag(#pixel)) complex z2 = z1 complex z3 = z1 int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = z1*z1 + c1 z2 = z2*z2 + c2 z3 = z3*z3 + c3 c1=c1/2+z1 c2=c2/2+z2 c3=c3/2+z3 iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (3RDIMSpider01)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandel set anymore." endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeExp3RDIMSpider01J" bailout = @bailout offset = @offset zmode = @zmode xfer = @xfer zscale = @zscale zscale2 = @zscale2 everyiter = @everyiter p1 = @p1 p2 = @p2 p3 = #pixel } SlopeExp3RDIMSpider01J {; Ron Barnett, September 2000 ; Some of the code based upon the slope (Mandelbrot) ; formula of Damien Jones init: complex c1 = @p2 + real(@p3) + flip(imag(@p3)*@p1) complex c2 = @p2 + real(@p3) + flip(imag(@p3)*@p1) + @offset complex c3 = @p2 + real(@p3) + flip(imag(@p3)*@p1) + flip(@offset) complex z1 = @p1*real(#pixel) + flip(imag(#pixel)) complex z2 = z1 complex z3 = z1 int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = z1*z1 + c1 z2 = z2*z2 + c2 z3 = z3*z3 + c3 c1=c1/2+z1 c2=c2/2+z2 c3=c3/2+z3 iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (3RDIMSpider01J)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandel set anymore." endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param p3 caption = "seed" default = (0.1,-0.625) endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeExp3RDIMSpider01" bailout = @bailout offset = @offset zmode = @zmode xfer = @xfer zscale = @zscale zscale2 = @zscale2 everyiter = @everyiter p1 = @p1 p2 = @p2 } SlopeExpSJIkenagamap01 {; Ron Barnett, September 2000 ; Some of the code based upon the slope (Mandelbrot) ; formula of Damien Jones init: y = ((1-#pixel)/3)^0.5 complex c1 = @p2 + @p1*real(#pixel) + flip(imag(#pixel)) complex c2 = @p2 + @p1*real(#pixel) + flip(imag(#pixel)) + @offset complex c3 = @p2 + @p1*real(#pixel) + flip(imag(#pixel)) + flip(@offset) complex z1 = real(y) + flip(imag(y)*@p1) complex z2 = z1 complex z3 = z1 int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = z1*z1*z1 + (c1 - 1)*z1 - c1 z2 = z2*z2*z2 + (c2 - 1)*z2 - c2 z3 = z3*z3*z3 + (c3 - 1)*z3 - c3 iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (SJIkenagamap01)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandel set anymore." endparam param p1 caption = "Plane rotation" default = (0.0,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeExpSJIkenagamap01J" bailout = @bailout offset = @offset zmode = @zmode xfer = @xfer zscale = @zscale zscale2 = @zscale2 everyiter = @everyiter p1 = @p1 p2 = @p2 p3 = #pixel } SlopeExpSJIkenagamap01J {; Ron Barnett, September 2000 ; Some of the code based upon the slope (Mandelbrot) ; formula of Damien Jones init: y = ((1-#pixel)/3)^0.5 complex c1 = @p2 + @p1*real(@p3) + flip(imag(@p3)) complex c2 = @p2 + @p1*real(@p3) + flip(imag(@p3)) + @offset complex c3 = @p2 + @p1*real(@p3) + flip(imag(@p3)) + flip(@offset) complex z1 = real(y) + flip(imag(y)*@p1) complex z2 = z1 complex z3 = z1 int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = z1*z1*z1 + (c1 - 1)*z1 - c1 z2 = z2*z2*z2 + (c2 - 1)*z2 - c2 z3 = z3*z3*z3 + (c3 - 1)*z3 - c3 iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (SJIkenagamap01J)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandel set anymore." endparam param p1 caption = "Plane rotation" default = (0.5,0.0) endparam param p2 caption = "Plane position" default = (0.0,0.0) endparam param p3 caption = "seed" default = (-1.1125, -0.2625) endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeExpSJIkenagamap01" bailout = @bailout offset = @offset zmode = @zmode xfer = @xfer zscale = @zscale zscale2 = @zscale2 everyiter = @everyiter p1 = @p1 p2 = @p2 } IkenagaRoots-Mandel { ; Ron Barnett, September 2000 ; Another Newton with mini-mandelbrots ; Based on the Ikenaga formula init: #z = 0 oldz = 0 a = ((1-#pixel)/3)^0.5 loop: oldz = #z #z = (2*#z*#z*#z + a) / (3*#z*#z + a - 1) bailout: |#z - oldz| >= @bailout default: title = "Ikenaga Roots - Mandel" maxiter = 1000 center = (-0.663, 0) magn = 140 method = multipass periodicity = 0 heading caption = "Ikenaga Roots-Mandel" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal that \ has Mandelbrot-like regions." endheading $else heading caption = "This is a 'convergent' fractal" endheading heading caption = "that has Mandelbrot-like regions" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout value" default = 0.000001 endparam switch: type = "IkenagaRoots-Julia" bailout = @bailout p1 = #pixel } FrameRobertRoots-Mandel { ; Ron Barnett, September 2000 ; Another Newton with mini-mandelbrot like regions ; Based on the FrameRobert formula init: #z = @init oldz = 0 a = #pixel loop: oldz = #z #z = (2*#z*#z*#z/5 + #z*#z - a) / (3*#z*#z/5 + 2*#z) bailout: |#z - oldz| >= @bailout default: title = "FrameRobert Roots-Mandel" maxiter = 1000 center = (5.25, 0) method = multipass periodicity = 0 magn = 6.5 heading caption = "FrameRobert Roots-Mandel" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal that \ has Mandelbrot-like regions." endheading $else heading caption = "This is a 'convergent' fractal" endheading heading caption = "that has Mandelbrot-like regions" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout value" default = 0.000001 endparam param init caption = "Iteration Initialization" default = (0.945,0) endparam switch: type = "FrameRobertRoots-Julia" bailout = @bailout p1 = #pixel init = @init } FrameRobertRoots-Julia { ; Ron Barnett, September 2000 ; Another Newton with mini-julia like regions ; Based on the FrameRobert formula init: #z = @init + #pixel oldz = 0 a = @p1 loop: oldz = #z #z = (2*#z*#z*#z/5 + #z*#z - a) / (3*#z*#z/5 + 2*#z) bailout: |#z - oldz| >= @bailout default: title = "FrameRobert Roots-Julia" maxiter = 1000 center = (-2.625, 0) magn = 4.5 method = multipass periodicity = 0 heading caption = "FrameRobert Roots-Julia" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal that \ has Julia-like regions." endheading $else heading caption = "This is a 'convergent' fractal" endheading heading caption = "that has Julia-like regions" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout value" default = 0.000001 endparam param p1 caption = "Parameter 1" default = (5.1885, 0.04) endparam param init caption = "Iteration Initialization" default = (0.945,0) endparam switch: type = "FrameRobertRoots-Mandel" bailout = @bailout p1 = #pixel init = @init } IkenagaRoots-Julia { ; Ron Barnett, September 2000 ; Another Newton with mini-julias ; Based on the Ikenaga formula init: #z = #pixel oldz = 0 a = ((1-@p1)/3)^0.5 loop: oldz = #z #z = (2*#z*#z*#z + a) / (3*#z*#z + a - 1) bailout: |#z - oldz| >= @bailout default: title = "Ikenaga Roots-Julia" maxiter = 1000 center = (0, 0) magn = 40 periodicity = 0 method = multipass heading caption = "Ikenaga Roots-Julia" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal that \ has Julia-like regions." endheading $else heading caption = "This is a 'convergent' fractal" endheading heading caption = "that has Julia-like regions" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout value" default = 0.000001 endparam param p1 caption = "Parameter 1" default = (-0.66, 0.0017) endparam switch: type = "IkenagaRoots-Mandel" bailout = @bailout } SlopeIkenagaRoots-Mandel { ; Ron Barnett, September 2000 ; Another Newton with mini-mandelbrots ; Based on the Ikenaga formula and the slope (Mandelbrot) ; formula of Damien Jones ; init: complex z1 = 0 ; primary iterated point complex z2 = @offset ; horizontally offset point complex z3 = flip(@offset) ; vertically offset point a = ((1-#pixel)/3)^0.5 int done = 2 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: complex oldz1 = z1 z1 = (2*z1*z1*z1 + a) / (3*z1*z1 + a - 1) complex oldz2 = z2 z2 = (2*z2*z2*z2 + a) / (3*z2*z2 + a - 1) complex oldz3 = z3 z3 = (2*z3*z3*z3 + a) / (3*z3*z3 + a - 1) IF (@zmode == 87) iterexp1 = iterexp1 + exp(-1/(cabs(oldz1 - z1))) iterexp2 = iterexp2 + exp(-1/(cabs(oldz2 - z2))) iterexp3 = iterexp3 + exp(-1/(cabs(oldz3 - z3))) ENDIF done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 58) ; smallest Knot curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 59) ; smallest Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(real(#z) + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 60) ; smallest Bean theta = atan(imag(#z)/real(#z)) af1 = @a*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) polar = ((af1*cos(theta))+flip((af1*sin(theta)))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 61) ; smallest Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*@b)^2 qc = (0.05*@b)^4 - (cy^2 - (0.05*@b)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = 2.25*@a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 62) ; smallest Bow theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 63) ; smallest Cassini Ovals theta = atan(imag(#z)/real(#z)) if @negroot == true rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 64) ; smallest Circle theta = atan(imag(#z)/real(#z)) rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 65) ; smallest Trident cx = real(#z) cy = cx^2 + 0.1*@b/cx polar = 0.1*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 66) ; smallest Stirrup Curve cy = imag(#z) qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 67) ; smallest Diamond polar = @a*@safn(abs((real(#z)*@sa1))+abs((flip(imag(#z))^@sa2))-1) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 68) ; smallest Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 polar = 4*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 69) ; smallest Teardrop Curve theta = atan(imag(#z)/real(#z)) af1 = @a*cos(theta) af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 70) ; smallest Happy Accident polar = 15*@a*@safn((((real(#z)*@sa4)^(1+@sa2))+ \ (flip(imag(#z))^2*@sa3))*atan2((flip(imag(#z))^@sa7)* \ (real(#z)^@sa5))-@sa1* \ (flip(imag(#z))^@sa6)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 71) ; smallest Hyperbola theta = atan(imag(#z)/real(#z)) rr = 0.35*@a*(1/cos(2*theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 72) ; smallest Kappa Curve theta = atan(imag(#z)/real(#z)) rr = 0.1*@a*tan(theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 73) ; smallest Piriform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1+sin(theta)) af2 = 0.1*@b*cos(theta)*(1+sin(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 74) ; smallest Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif polar = 2.5*@a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 75) ; smallest Serpentine Curve theta = atan(imag(#z)/real(#z)) af1 = 0.2*@a*cotan(theta) af2 = 0.2*@b*sin(theta)*cos(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 76) ; smallest Line cx = real(#z) cy = cx polar = 3*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 77) ; smallest Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 78) ; smallest Parabola cy = imag(#z) cx = 10*@b*cy^2 polar = 0.65*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 79) ; smallest Trefoil theta = atan(imag(#z)/real(#z)) rr = 0.1*@a/cos(3*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 80) ; smallest Trident of Descartes cx = real(#z) cy = (cx-0.2*@b)*(cx+0.2*@b)*(cx-0.4*@b)/cx polar = @a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 81) ; smallest Trisectrix of Maclaurin theta = atan(imag(#z)/real(#z)) rr = 0.5*@a*sin(3*theta)/sin(2*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 82) ; smallest Atzema Spiral theta = atan(imag(#z)/real(#z)) af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 83) ; smallest Rose of Troy theta = atan(imag(#z)/real(#z)) rr = @cp*(1+10*@a*sin(4*@b*theta)) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 84) ; smallest Cotes' Spiral theta = atan(imag(#z)/real(#z)) rr = @a/cosh(@b*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 85) ; smallest Dipole Curve theta = atan(imag(#z)/real(#z)) rr = @a*(cos(theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 86) ; smallest Polytrope cx = real(#z) cy = 1/cx^@pn polar = 0.00005*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF (@p2 > |oldz1-z1| || \ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 86) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 87) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (@p2 > |oldz1-z1|) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (IkenagaRoots-Mandel)" maxiter = 1000 center = (-0.663, 0) magn = 140 method = multipass periodicity = 0 heading caption = "Slope Ikenaga Roots-Mandel" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal. Eighty eight different height \ value types are available. Use with Damien's Lighting formula, \ 3D Texturizer Enhanced III or Direct Color Slope." endheading $else heading caption = "This is a 'convergent' fractal." endheading heading caption = "Use with Damien's Lighting" endheading heading caption = "formula or 3D Texturizer III" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p2 caption = "Bailout value" default = 0.000001 max = 0.1 endparam param offset caption = "Orbit Separation" default = 0.001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 87 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 || @zmode==58 || @zmode==59 \ || @zmode==60 || @zmode==61 || @zmode==62 || @zmode==63 || @zmode==64 \ || @zmode==65 || @zmode==66 || @zmode==67 || @zmode==68 || @zmode==69 \ || @zmode==70 || @zmode==71 || @zmode==72 || @zmode==73 || @zmode==74 \ || @zmode==75 || @zmode==76 || @zmode==77 || @zmode==78 || @zmode==79 \ || @zmode==80 || @zmode==81 || @zmode==82 || @zmode==83 || @zmode==84 \ || @zmode==85 || @zmode==86 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 || @zmode==61 || @zmode==62 || @zmode==63 \ || @zmode==64 || @zmode==65 || @zmode==69 || @zmode==73 || @zmode==75 \ || @zmode==78 || @zmode==80 || @zmode==82 || @zmode==83 || @zmode==84 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@zmode==83 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 || @zmode==69 || @zmode==86 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 || @zmode==60 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc param sa1 caption = "Adjuster 1" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @zmode == 70 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @zmode == 70 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @zmode == 70 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @zmode == 70 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @zmode == 70 endparam func safn caption = "Adjuster Fn" default = ident() visible = @zmode == 67 || @zmode==70 endfunc param negroot caption = "Quad Neg Root" default = false visible=@zmode==58 || @zmode==61 || @zmode==66 || @zmode==74 || @zmode==77 endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeIkenagaRoots-Julia" p2 = @p2 p1 = #pixel offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b cp = @cp pn = @pn afn1 = @afn1 afn2 = @afn2 safn = @safn apwr = @apwr fn1 = @fn1 sa1 = @sa1 sa2 = @sa2 sa3 = @sa3 sa4 = @sa4 sa5 = @sa5 sa6 = @sa6 sa7 = @sa7 negroot = @negroot } SlopeIkenagaRoots-Julia { ; Ron Barnett, September 2000 ; Another Newton with mini-julias ; Based on the Ikenaga formula and the slope (Mandelbrot) ; formula of Damien Jones ; init: complex z1 = #pixel ; primary iterated point complex z2 = #pixel + @offset ; horizontally offset point complex z3 = #pixel + flip(@offset) ; vertically offset point a = ((1-@p1)/3)^0.5 int done = 2 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: complex oldz1 = z1 z1 = (2*z1*z1*z1 + a) / (3*z1*z1 + a - 1) complex oldz2 = z2 z2 = (2*z2*z2*z2 + a) / (3*z2*z2 + a - 1) complex oldz3 = z3 z3 = (2*z3*z3*z3 + a) / (3*z3*z3 + a - 1) IF (@zmode == 87) iterexp1 = iterexp1 + exp(-1/(cabs(oldz1 - z1))) iterexp2 = iterexp2 + exp(-1/(cabs(oldz2 - z2))) iterexp3 = iterexp3 + exp(-1/(cabs(oldz3 - z3))) ENDIF done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 58) ; smallest Knot curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 59) ; smallest Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(real(#z) + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 60) ; smallest Bean theta = atan(imag(#z)/real(#z)) af1 = @a*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) polar = ((af1*cos(theta))+flip((af1*sin(theta)))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 61) ; smallest Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*@b)^2 qc = (0.05*@b)^4 - (cy^2 - (0.05*@b)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = 2.25*@a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 62) ; smallest Bow theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 63) ; smallest Cassini Ovals theta = atan(imag(#z)/real(#z)) if @negroot == true rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 64) ; smallest Circle theta = atan(imag(#z)/real(#z)) rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 65) ; smallest Trident cx = real(#z) cy = cx^2 + 0.1*@b/cx polar = 0.1*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 66) ; smallest Stirrup Curve cy = imag(#z) qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 67) ; smallest Diamond polar = @a*@safn(abs((real(#z)*@sa1))+abs((flip(imag(#z))^@sa2))-1) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 68) ; smallest Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 polar = 4*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 69) ; smallest Teardrop Curve theta = atan(imag(#z)/real(#z)) af1 = @a*cos(theta) af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 70) ; smallest Happy Accident polar = 15*@a*@safn((((real(#z)*@sa4)^(1+@sa2))+ \ (flip(imag(#z))^2*@sa3))*atan2((flip(imag(#z))^@sa7)* \ (real(#z)^@sa5))-@sa1* \ (flip(imag(#z))^@sa6)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 71) ; smallest Hyperbola theta = atan(imag(#z)/real(#z)) rr = 0.35*@a*(1/cos(2*theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 72) ; smallest Kappa Curve theta = atan(imag(#z)/real(#z)) rr = 0.1*@a*tan(theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 73) ; smallest Piriform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1+sin(theta)) af2 = 0.1*@b*cos(theta)*(1+sin(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 74) ; smallest Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif polar = 2.5*@a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 75) ; smallest Serpentine Curve theta = atan(imag(#z)/real(#z)) af1 = 0.2*@a*cotan(theta) af2 = 0.2*@b*sin(theta)*cos(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 76) ; smallest Line cx = real(#z) cy = cx polar = 3*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 77) ; smallest Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 78) ; smallest Parabola cy = imag(#z) cx = 10*@b*cy^2 polar = 0.65*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 79) ; smallest Trefoil theta = atan(imag(#z)/real(#z)) rr = 0.1*@a/cos(3*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 80) ; smallest Trident of Descartes cx = real(#z) cy = (cx-0.2*@b)*(cx+0.2*@b)*(cx-0.4*@b)/cx polar = @a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 81) ; smallest Trisectrix of Maclaurin theta = atan(imag(#z)/real(#z)) rr = 0.5*@a*sin(3*theta)/sin(2*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 82) ; smallest Atzema Spiral theta = atan(imag(#z)/real(#z)) af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 83) ; smallest Rose of Troy theta = atan(imag(#z)/real(#z)) rr = @cp*(1+10*@a*sin(4*@b*theta)) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 84) ; smallest Cotes' Spiral theta = atan(imag(#z)/real(#z)) rr = @a/cosh(@b*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 85) ; smallest Dipole Curve theta = atan(imag(#z)/real(#z)) rr = @a*(cos(theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 86) ; smallest Polytrope cx = real(#z) cy = 1/cx^@pn polar = 0.00005*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF (@p2 > |oldz1-z1| || \ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 86) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 87) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (@p2 > |oldz1-z1|) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (IkenagaRoots-Julia)" maxiter = 1000 center = (0, 0) magn = 40 periodicity = 0 method = multipass heading caption = "Slope IkenagaRoots-Julia" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal. Eighty eight different height \ value types are available. Use with Damien's Lighting formula, \ 3D Texturizer Enhanced III or Direct Color Slope." endheading $else heading caption = "This is a 'convergent' fractal." endheading heading caption = "Use with Damien's Lighting" endheading heading caption = "formula or 3D Texturizer III" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p1 caption = "Parameter 1" default = (-0.66, 0.0017) endparam param p2 caption = "Bailout value" default = 0.000001 max = 0.1 endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 87 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 || @zmode==58 || @zmode==59 \ || @zmode==60 || @zmode==61 || @zmode==62 || @zmode==63 || @zmode==64 \ || @zmode==65 || @zmode==66 || @zmode==67 || @zmode==68 || @zmode==69 \ || @zmode==70 || @zmode==71 || @zmode==72 || @zmode==73 || @zmode==74 \ || @zmode==75 || @zmode==76 || @zmode==77 || @zmode==78 || @zmode==79 \ || @zmode==80 || @zmode==81 || @zmode==82 || @zmode==83 || @zmode==84 \ || @zmode==85 || @zmode==86 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 || @zmode==61 || @zmode==62 || @zmode==63 \ || @zmode==64 || @zmode==65 || @zmode==69 || @zmode==73 || @zmode==75 \ || @zmode==78 || @zmode==80 || @zmode==82 || @zmode==83 || @zmode==84 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@zmode==83 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 || @zmode==69 || @zmode==86 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 || @zmode==60 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc param sa1 caption = "Adjuster 1" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @zmode == 70 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @zmode == 70 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @zmode == 70 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @zmode == 70 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @zmode == 70 endparam func safn caption = "Adjuster Fn" default = ident() visible = @zmode == 67 || @zmode==70 endfunc param negroot caption = "Quad Neg Root" default = false visible=@zmode==58 || @zmode==61 || @zmode==66 || @zmode==74 || @zmode==77 endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam switch: type = "SlopeIkenagaRoots-Mandel" p2 = @p2 offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b cp = @cp pn = @pn afn1 = @afn1 afn2 = @afn2 safn = @safn apwr = @apwr fn1 = @fn1 sa1 = @sa1 sa2 = @sa2 sa3 = @sa3 sa4 = @sa4 sa5 = @sa5 sa6 = @sa6 sa7 = @sa7 negroot = @negroot } SlopeFrameRobertRoots-Mandel { ; Ron Barnett, September 2000 ; Another Newton with mini-mandelbrot like regions ; Based on the FrameRobert formula and the slope (Mandelbrot) ; formula of Damien Jones ; init: complex z1 = @init ; primary iterated point complex z2 = @init + @offset ; horizontally offset point complex z3 = @init + flip(@offset) ; vertically offset point a = #pixel int done = 2 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: complex oldz1 = z1 z1 = (2*z1*z1*z1/5 + z1*z1 - a) / (3*z1*z1/5 + 2*z1) complex oldz2 = z2 z2 = (2*z2*z2*z2/5 + z2*z2 - a) / (3*z2*z2/5 + 2*z2) complex oldz3 = z3 z3 = (2*z3*z3*z3/5 + z3*z3 - a) / (3*z3*z3/5 + 2*z3) IF (@zmode == 87) iterexp1 = iterexp1 + exp(-1/(cabs(oldz1 - z1))) iterexp2 = iterexp2 + exp(-1/(cabs(oldz2 - z2))) iterexp3 = iterexp3 + exp(-1/(cabs(oldz3 - z3))) ENDIF done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 58) ; smallest Knot curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 59) ; smallest Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(real(#z) + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 60) ; smallest Bean theta = atan(imag(#z)/real(#z)) af1 = @a*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) polar = ((af1*cos(theta))+flip((af1*sin(theta)))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 61) ; smallest Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*@b)^2 qc = (0.05*@b)^4 - (cy^2 - (0.05*@b)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = 2.25*@a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 62) ; smallest Bow theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 63) ; smallest Cassini Ovals theta = atan(imag(#z)/real(#z)) if @negroot == true rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 64) ; smallest Circle theta = atan(imag(#z)/real(#z)) rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 65) ; smallest Trident cx = real(#z) cy = cx^2 + 0.1*@b/cx polar = 0.1*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 66) ; smallest Stirrup Curve cy = imag(#z) qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 67) ; smallest Diamond polar = @a*@safn(abs((real(#z)*@sa1))+abs((flip(imag(#z))^@sa2))-1) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 68) ; smallest Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 polar = 4*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 69) ; smallest Teardrop Curve theta = atan(imag(#z)/real(#z)) af1 = @a*cos(theta) af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 70) ; smallest Happy Accident polar = 15*@a*@safn((((real(#z)*@sa4)^(1+@sa2))+ \ (flip(imag(#z))^2*@sa3))*atan2((flip(imag(#z))^@sa7)* \ (real(#z)^@sa5))-@sa1* \ (flip(imag(#z))^@sa6)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 71) ; smallest Hyperbola theta = atan(imag(#z)/real(#z)) rr = 0.35*@a*(1/cos(2*theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 72) ; smallest Kappa Curve theta = atan(imag(#z)/real(#z)) rr = 0.1*@a*tan(theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 73) ; smallest Piriform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1+sin(theta)) af2 = 0.1*@b*cos(theta)*(1+sin(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 74) ; smallest Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif polar = 2.5*@a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 75) ; smallest Serpentine Curve theta = atan(imag(#z)/real(#z)) af1 = 0.2*@a*cotan(theta) af2 = 0.2*@b*sin(theta)*cos(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 76) ; smallest Line cx = real(#z) cy = cx polar = 3*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 77) ; smallest Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 78) ; smallest Parabola cy = imag(#z) cx = 10*@b*cy^2 polar = 0.65*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 79) ; smallest Trefoil theta = atan(imag(#z)/real(#z)) rr = 0.1*@a/cos(3*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 80) ; smallest Trident of Descartes cx = real(#z) cy = (cx-0.2*@b)*(cx+0.2*@b)*(cx-0.4*@b)/cx polar = @a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 81) ; smallest Trisectrix of Maclaurin theta = atan(imag(#z)/real(#z)) rr = 0.5*@a*sin(3*theta)/sin(2*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 82) ; smallest Atzema Spiral theta = atan(imag(#z)/real(#z)) af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 83) ; smallest Rose of Troy theta = atan(imag(#z)/real(#z)) rr = @cp*(1+10*@a*sin(4*@b*theta)) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 84) ; smallest Cotes' Spiral theta = atan(imag(#z)/real(#z)) rr = @a/cosh(@b*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 85) ; smallest Dipole Curve theta = atan(imag(#z)/real(#z)) rr = @a*(cos(theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 86) ; smallest Polytrope cx = real(#z) cy = 1/cx^@pn polar = 0.00005*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF (@p2 > |oldz1-z1| || \ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 86) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 87) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (@p2 > |oldz1-z1|) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (FrameRobertRoots-Mandel)" maxiter = 1000 center = (5.25, 0) method = multipass periodicity = 0 magn = 6.5 heading caption = "Slope FrameRobertRoots-Mandel" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal. Eighty eight different height \ value types are available. Use with Damien's Lighting formula, \ 3D Texturizer Enhanced III or Direct Color Slope." endheading $else heading caption = "This is a 'convergent' fractal." endheading heading caption = "Use with Damien's Lighting" endheading heading caption = "formula or 3D Texturizer III" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p2 caption = "Bailout value" default = 0.000001 max = 0.1 endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 87 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 || @zmode==58 || @zmode==59 \ || @zmode==60 || @zmode==61 || @zmode==62 || @zmode==63 || @zmode==64 \ || @zmode==65 || @zmode==66 || @zmode==67 || @zmode==68 || @zmode==69 \ || @zmode==70 || @zmode==71 || @zmode==72 || @zmode==73 || @zmode==74 \ || @zmode==75 || @zmode==76 || @zmode==77 || @zmode==78 || @zmode==79 \ || @zmode==80 || @zmode==81 || @zmode==82 || @zmode==83 || @zmode==84 \ || @zmode==85 || @zmode==86 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 || @zmode==61 || @zmode==62 || @zmode==63 \ || @zmode==64 || @zmode==65 || @zmode==69 || @zmode==73 || @zmode==75 \ || @zmode==78 || @zmode==80 || @zmode==82 || @zmode==83 || @zmode==84 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@zmode==83 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 || @zmode==69 || @zmode==86 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 || @zmode==60 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc param sa1 caption = "Adjuster 1" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @zmode == 70 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @zmode == 70 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @zmode == 70 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @zmode == 70 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @zmode == 70 endparam func safn caption = "Adjuster Fn" default = ident() visible = @zmode == 67 || @zmode==70 endfunc param negroot caption = "Quad Neg Root" default = false visible=@zmode==58 || @zmode==61 || @zmode==66 || @zmode==74 || @zmode==77 endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam param init caption = "Iteration Initialization" default = (0.945,0) endparam switch: type = "SlopeFrameRobertRoots-Julia" p2 = @p2 p1 = #pixel offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b cp = @cp pn = @pn afn1 = @afn1 afn2 = @afn2 safn = @safn apwr = @apwr fn1 = @fn1 sa1 = @sa1 sa2 = @sa2 sa3 = @sa3 sa4 = @sa4 sa5 = @sa5 sa6 = @sa6 sa7 = @sa7 negroot = @negroot } SlopeFrameRobertRoots-Julia { ; Ron Barnett, September 2000 ; Another Newton with mini-julia like regions ; Based on the FrameRobert formula and the slope (Mandelbrot) ; formula of Damien Jones ; init: complex z1 = @init + #pixel ; primary iterated point complex z2 = @init + #pixel + @offset ; horizontally offset point complex z3 = @init + #pixel + flip(@offset) ; vertically offset point a = @p1 int done = 2 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: complex oldz1 = z1 z1 = (2*z1*z1*z1/5 + z1*z1 - a) / (3*z1*z1/5 + 2*z1) complex oldz2 = z2 z2 = (2*z2*z2*z2/5 + z2*z2 - a) / (3*z2*z2/5 + 2*z2) complex oldz3 = z3 z3 = (2*z3*z3*z3/5 + z3*z3 - a) / (3*z3*z3/5 + 2*z3) IF (@zmode == 87) iterexp1 = iterexp1 + exp(-1/(cabs(oldz1 - z1))) iterexp2 = iterexp2 + exp(-1/(cabs(oldz2 - z2))) iterexp3 = iterexp3 + exp(-1/(cabs(oldz3 - z3))) ENDIF done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 58) ; smallest Knot curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 59) ; smallest Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(real(#z) + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 60) ; smallest Bean theta = atan(imag(#z)/real(#z)) af1 = @a*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) polar = ((af1*cos(theta))+flip((af1*sin(theta)))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 61) ; smallest Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*@b)^2 qc = (0.05*@b)^4 - (cy^2 - (0.05*@b)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = 2.25*@a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 62) ; smallest Bow theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 63) ; smallest Cassini Ovals theta = atan(imag(#z)/real(#z)) if @negroot == true rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 64) ; smallest Circle theta = atan(imag(#z)/real(#z)) rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 65) ; smallest Trident cx = real(#z) cy = cx^2 + 0.1*@b/cx polar = 0.1*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 66) ; smallest Stirrup Curve cy = imag(#z) qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 67) ; smallest Diamond polar = @a*@safn(abs((real(#z)*@sa1))+abs((flip(imag(#z))^@sa2))-1) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 68) ; smallest Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 polar = 4*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 69) ; smallest Teardrop Curve theta = atan(imag(#z)/real(#z)) af1 = @a*cos(theta) af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 70) ; smallest Happy Accident polar = 15*@a*@safn((((real(#z)*@sa4)^(1+@sa2))+ \ (flip(imag(#z))^2*@sa3))*atan2((flip(imag(#z))^@sa7)* \ (real(#z)^@sa5))-@sa1* \ (flip(imag(#z))^@sa6)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 71) ; smallest Hyperbola theta = atan(imag(#z)/real(#z)) rr = 0.35*@a*(1/cos(2*theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 72) ; smallest Kappa Curve theta = atan(imag(#z)/real(#z)) rr = 0.1*@a*tan(theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 73) ; smallest Piriform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1+sin(theta)) af2 = 0.1*@b*cos(theta)*(1+sin(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 74) ; smallest Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif polar = 2.5*@a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 75) ; smallest Serpentine Curve theta = atan(imag(#z)/real(#z)) af1 = 0.2*@a*cotan(theta) af2 = 0.2*@b*sin(theta)*cos(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 76) ; smallest Line cx = real(#z) cy = cx polar = 3*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 77) ; smallest Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 78) ; smallest Parabola cy = imag(#z) cx = 10*@b*cy^2 polar = 0.65*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 79) ; smallest Trefoil theta = atan(imag(#z)/real(#z)) rr = 0.1*@a/cos(3*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 80) ; smallest Trident of Descartes cx = real(#z) cy = (cx-0.2*@b)*(cx+0.2*@b)*(cx-0.4*@b)/cx polar = @a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 81) ; smallest Trisectrix of Maclaurin theta = atan(imag(#z)/real(#z)) rr = 0.5*@a*sin(3*theta)/sin(2*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 82) ; smallest Atzema Spiral theta = atan(imag(#z)/real(#z)) af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 83) ; smallest Rose of Troy theta = atan(imag(#z)/real(#z)) rr = @cp*(1+10*@a*sin(4*@b*theta)) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 84) ; smallest Cotes' Spiral theta = atan(imag(#z)/real(#z)) rr = @a/cosh(@b*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 85) ; smallest Dipole Curve theta = atan(imag(#z)/real(#z)) rr = @a*(cos(theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 86) ; smallest Polytrope cx = real(#z) cy = 1/cx^@pn polar = 0.00005*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF (@p2 > |oldz1-z1| || \ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 86) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 87) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (@p2 > |oldz1-z1|) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (FrameRobertRoots-Julia)" maxiter = 1000 center = (-2.625, 0) magn = 4.5 method = multipass periodicity = 0 heading caption = "Slope FrameRobertRoots-Julia" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal. Eighty eight different height \ value types are available. Use with Damien's Lighting formula, \ 3D Texturizer Enhanced III or Direct Color Slope." endheading $else heading caption = "This is a 'convergent' fractal." endheading heading caption = "Use with Damien's Lighting" endheading heading caption = "formula or 3D Texturizer III" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p1 caption = "Parameter 1" default = (5.1885, 0.04) endparam param p2 caption = "Bailout value" default = 0.000001 max = 0.1 endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 87 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 || @zmode==58 || @zmode==59 \ || @zmode==60 || @zmode==61 || @zmode==62 || @zmode==63 || @zmode==64 \ || @zmode==65 || @zmode==66 || @zmode==67 || @zmode==68 || @zmode==69 \ || @zmode==70 || @zmode==71 || @zmode==72 || @zmode==73 || @zmode==74 \ || @zmode==75 || @zmode==76 || @zmode==77 || @zmode==78 || @zmode==79 \ || @zmode==80 || @zmode==81 || @zmode==82 || @zmode==83 || @zmode==84 \ || @zmode==85 || @zmode==86 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 || @zmode==61 || @zmode==62 || @zmode==63 \ || @zmode==64 || @zmode==65 || @zmode==69 || @zmode==73 || @zmode==75 \ || @zmode==78 || @zmode==80 || @zmode==82 || @zmode==83 || @zmode==84 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@zmode==83 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 || @zmode==69 || @zmode==86 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 || @zmode==60 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc param sa1 caption = "Adjuster 1" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @zmode == 70 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @zmode == 70 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @zmode == 70 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @zmode == 70 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @zmode == 70 endparam func safn caption = "Adjuster Fn" default = ident() visible = @zmode == 67 || @zmode==70 endfunc param negroot caption = "Quad Neg Root" default = false visible=@zmode==58 || @zmode==61 || @zmode==66 || @zmode==74 || @zmode==77 endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam param init caption = "Iteration Initialization" default = (0.945,0) endparam switch: type = "SlopeFrameRobertRoots-Mandel" p2 = @p2 offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b cp = @cp pn = @pn afn1 = @afn1 afn2 = @afn2 safn = @safn apwr = @apwr fn1 = @fn1 sa1 = @sa1 sa2 = @sa2 sa3 = @sa3 sa4 = @sa4 sa5 = @sa5 sa6 = @sa6 sa7 = @sa7 negroot = @negroot } CubicRoots-Mandel { ; Ron Barnett, September 2000 ; Another Newton with mini-mandelbrot like regions ; Based on the Cubic formula (Ron Barnett circa 1993) init: #z = @init oldz = 0 a = #pixel loop: oldz = #z #z = (2*#z*#z*#z - #z*#z +a -2) / (3*#z*#z - 2*#z - 1) bailout: |#z - oldz| >= @bailout default: title = "Cubic Roots-Mandel" maxiter = 1000 center = (0.51, 0) magn = 50 method = multipass periodicity = 0 heading caption = "Cubic Roots-Mandel" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal that \ has Mandelbrot-like regions." endheading $else heading caption = "This is a 'convergent' fractal" endheading heading caption = "that has Mandelbrot-like regions" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout value" default = 0.000001 endparam param init caption = "Iteration Initialization" default = (0.33,0) endparam switch: type = "CubicRoots-Julia" bailout = @bailout p1 = #pixel init = @init } CubicRoots-Julia { ; Ron Barnett, September 2000 ; Another Newton with mini-mandelbrot like regions ; Based on the Cubic formula (Ron Barnett circa 1993) init: #z = @init + #pixel oldz = 0 a = @p1 loop: oldz = #z #z = (2*#z*#z*#z - #z*#z +a -2) / (3*#z*#z - 2*#z - 1) bailout: |#z - oldz| >= @bailout default: title = "Cubic Roots-Julia" maxiter = 1000 center = (0, 0) magn = 12 method = multipass periodicity = 0 heading caption = "Cubic Roots-Julia" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal that \ has Julia-like regions." endheading $else heading caption = "This is a 'convergent' fractal" endheading heading caption = "that has Julia-like regions" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout value" default = 0.000001 endparam param p1 caption = "Parameter 1" default = (0.522375, -0.002875) endparam param init caption = "Iteration Initialization" default = (0.33,0) endparam switch: type = "CubicRoots-Mandel" bailout = @bailout init = @init } SlopeCubicRoots-Mandel { ; Ron Barnett, September 2000 ; Another Newton with mini-mandelbrot like regions ; Based on the Cubic formula and the slope (Mandelbrot) ; formula of Damien Jones ; init: complex z1 = @init ; primary iterated point complex z2 = @init + @offset ; horizontally offset point complex z3 = @init + flip(@offset) ; vertically offset point a = #pixel int done = 2 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: complex oldz1 = z1 z1 = (2*z1*z1*z1 - z1*z1 +a -2) / (3*z1*z1 - 2*z1 - 1) complex oldz2 = z2 z2 = (2*z2*z2*z2 - z2*z2 +a -2) / (3*z2*z2 - 2*z2 - 1) complex oldz3 = z3 z3 = (2*z3*z3*z3 - z3*z3 +a -2) / (3*z3*z3 - 2*z3 - 1) IF (@zmode == 87) iterexp1 = iterexp1 + exp(-1/(cabs(oldz1 - z1))) iterexp2 = iterexp2 + exp(-1/(cabs(oldz2 - z2))) iterexp3 = iterexp3 + exp(-1/(cabs(oldz3 - z3))) ENDIF done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 58) ; smallest Knot curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 59) ; smallest Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(real(#z) + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 60) ; smallest Bean theta = atan(imag(#z)/real(#z)) af1 = @a*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) polar = ((af1*cos(theta))+flip((af1*sin(theta)))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 61) ; smallest Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*@b)^2 qc = (0.05*@b)^4 - (cy^2 - (0.05*@b)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = 2.25*@a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 62) ; smallest Bow theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 63) ; smallest Cassini Ovals theta = atan(imag(#z)/real(#z)) if @negroot == true rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 64) ; smallest Circle theta = atan(imag(#z)/real(#z)) rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 65) ; smallest Trident cx = real(#z) cy = cx^2 + 0.1*@b/cx polar = 0.1*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 66) ; smallest Stirrup Curve cy = imag(#z) qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 67) ; smallest Diamond polar = @a*@safn(abs((real(#z)*@sa1))+abs((flip(imag(#z))^@sa2))-1) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 68) ; smallest Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 polar = 4*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 69) ; smallest Teardrop Curve theta = atan(imag(#z)/real(#z)) af1 = @a*cos(theta) af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 70) ; smallest Happy Accident polar = 15*@a*@safn((((real(#z)*@sa4)^(1+@sa2))+ \ (flip(imag(#z))^2*@sa3))*atan2((flip(imag(#z))^@sa7)* \ (real(#z)^@sa5))-@sa1* \ (flip(imag(#z))^@sa6)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 71) ; smallest Hyperbola theta = atan(imag(#z)/real(#z)) rr = 0.35*@a*(1/cos(2*theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 72) ; smallest Kappa Curve theta = atan(imag(#z)/real(#z)) rr = 0.1*@a*tan(theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 73) ; smallest Piriform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1+sin(theta)) af2 = 0.1*@b*cos(theta)*(1+sin(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 74) ; smallest Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif polar = 2.5*@a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 75) ; smallest Serpentine Curve theta = atan(imag(#z)/real(#z)) af1 = 0.2*@a*cotan(theta) af2 = 0.2*@b*sin(theta)*cos(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 76) ; smallest Line cx = real(#z) cy = cx polar = 3*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 77) ; smallest Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 78) ; smallest Parabola cy = imag(#z) cx = 10*@b*cy^2 polar = 0.65*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 79) ; smallest Trefoil theta = atan(imag(#z)/real(#z)) rr = 0.1*@a/cos(3*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 80) ; smallest Trident of Descartes cx = real(#z) cy = (cx-0.2*@b)*(cx+0.2*@b)*(cx-0.4*@b)/cx polar = @a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 81) ; smallest Trisectrix of Maclaurin theta = atan(imag(#z)/real(#z)) rr = 0.5*@a*sin(3*theta)/sin(2*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 82) ; smallest Atzema Spiral theta = atan(imag(#z)/real(#z)) af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 83) ; smallest Rose of Troy theta = atan(imag(#z)/real(#z)) rr = @cp*(1+10*@a*sin(4*@b*theta)) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 84) ; smallest Cotes' Spiral theta = atan(imag(#z)/real(#z)) rr = @a/cosh(@b*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 85) ; smallest Dipole Curve theta = atan(imag(#z)/real(#z)) rr = @a*(cos(theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 86) ; smallest Polytrope cx = real(#z) cy = 1/cx^@pn polar = 0.00005*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF (@p2 > |oldz1-z1| || \ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 86) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 87) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (@p2 > |oldz1-z1|) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (CubicRoots-Mandel)" center = (0.51, 0) magn = 50 method = multipass periodicity = 0 maxiter = 1000 heading caption = "Slope CubicRoots-Mandel" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal. Eighty eight different height \ value types are available. Use with Damien's Lighting formula, \ 3D Texturizer Enhanced III or Direct Color Slope." endheading $else heading caption = "This is a 'convergent' fractal." endheading heading caption = "Use with Damien's Lighting" endheading heading caption = "formula or 3D Texturizer III" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p2 caption = "Bailout value" default = 0.000001 max = 0.1 endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 87 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 || @zmode==58 || @zmode==59 \ || @zmode==60 || @zmode==61 || @zmode==62 || @zmode==63 || @zmode==64 \ || @zmode==65 || @zmode==66 || @zmode==67 || @zmode==68 || @zmode==69 \ || @zmode==70 || @zmode==71 || @zmode==72 || @zmode==73 || @zmode==74 \ || @zmode==75 || @zmode==76 || @zmode==77 || @zmode==78 || @zmode==79 \ || @zmode==80 || @zmode==81 || @zmode==82 || @zmode==83 || @zmode==84 \ || @zmode==85 || @zmode==86 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 || @zmode==61 || @zmode==62 || @zmode==63 \ || @zmode==64 || @zmode==65 || @zmode==69 || @zmode==73 || @zmode==75 \ || @zmode==78 || @zmode==80 || @zmode==82 || @zmode==83 || @zmode==84 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@zmode==83 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 || @zmode==69 || @zmode==86 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 || @zmode==60 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc param sa1 caption = "Adjuster 1" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @zmode == 70 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @zmode == 70 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @zmode == 70 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @zmode == 70 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @zmode == 70 endparam func safn caption = "Adjuster Fn" default = ident() visible = @zmode == 67 || @zmode==70 endfunc param negroot caption = "Quad Neg Root" default = false visible=@zmode==58 || @zmode==61 || @zmode==66 || @zmode==74 || @zmode==77 endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam param init caption = "Iteration Initialization" default = (0.33,0) endparam switch: type = "SlopeCubicRoots-Julia" p2 = @p2 p1 = #pixel offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b cp = @cp pn = @pn afn1 = @afn1 afn2 = @afn2 safn = @safn apwr = @apwr fn1 = @fn1 sa1 = @sa1 sa2 = @sa2 sa3 = @sa3 sa4 = @sa4 sa5 = @sa5 sa6 = @sa6 sa7 = @sa7 negroot = @negroot } SlopeCubicRoots-Julia { ; Ron Barnett, September 2000 ; Another Newton with mini-julia like regions ; Based on the Cubic formula and the slope (Mandelbrot) ; formula of Damien Jones ; init: complex z1 = @init + #pixel ; primary iterated point complex z2 = @init + #pixel + @offset ; horizontally offset point complex z3 = @init + #pixel + flip(@offset) ; vertically offset point a = @p1 int done = 2 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: complex oldz1 = z1 z1 = (2*z1*z1*z1 - z1*z1 +a -2) / (3*z1*z1 - 2*z1 - 1) complex oldz2 = z2 z2 = (2*z2*z2*z2 - z2*z2 +a -2) / (3*z2*z2 - 2*z2 - 1) complex oldz3 = z3 z3 = (2*z3*z3*z3 - z3*z3 +a -2) / (3*z3*z3 - 2*z3 - 1) IF (@zmode == 87) iterexp1 = iterexp1 + exp(-1/(cabs(oldz1 - z1))) iterexp2 = iterexp2 + exp(-1/(cabs(oldz2 - z2))) iterexp3 = iterexp3 + exp(-1/(cabs(oldz3 - z3))) ENDIF done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(fn1(z1))) + abs(imag(fn1(z1))) ; get current distances d2 = abs(real(fn1(z2))) + abs(imag(fn1(z2))) d3 = abs(real(fn1(z3))) + abs(imag(fn1(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(fn1(z1)) ; get current distances d2 = cabs(fn1(z2)) d3 = cabs(fn1(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 58) ; smallest Knot curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 59) ; smallest Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(real(#z) + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 60) ; smallest Bean theta = atan(imag(#z)/real(#z)) af1 = @a*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) polar = ((af1*cos(theta))+flip((af1*sin(theta)))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 61) ; smallest Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*@b)^2 qc = (0.05*@b)^4 - (cy^2 - (0.05*@b)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = 2.25*@a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 62) ; smallest Bow theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 63) ; smallest Cassini Ovals theta = atan(imag(#z)/real(#z)) if @negroot == true rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 64) ; smallest Circle theta = atan(imag(#z)/real(#z)) rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 65) ; smallest Trident cx = real(#z) cy = cx^2 + 0.1*@b/cx polar = 0.1*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 66) ; smallest Stirrup Curve cy = imag(#z) qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(qx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 67) ; smallest Diamond polar = @a*@safn(abs((real(#z)*@sa1))+abs((flip(imag(#z))^@sa2))-1) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 68) ; smallest Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 polar = 4*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 69) ; smallest Teardrop Curve theta = atan(imag(#z)/real(#z)) af1 = @a*cos(theta) af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 70) ; smallest Happy Accident polar = 15*@a*@safn((((real(#z)*@sa4)^(1+@sa2))+ \ (flip(imag(#z))^2*@sa3))*atan2((flip(imag(#z))^@sa7)* \ (real(#z)^@sa5))-@sa1* \ (flip(imag(#z))^@sa6)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 71) ; smallest Hyperbola theta = atan(imag(#z)/real(#z)) rr = 0.35*@a*(1/cos(2*theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 72) ; smallest Kappa Curve theta = atan(imag(#z)/real(#z)) rr = 0.1*@a*tan(theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 73) ; smallest Piriform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a*(1+sin(theta)) af2 = 0.1*@b*cos(theta)*(1+sin(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 74) ; smallest Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif polar = 2.5*@a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 75) ; smallest Serpentine Curve theta = atan(imag(#z)/real(#z)) af1 = 0.2*@a*cotan(theta) af2 = 0.2*@b*sin(theta)*cos(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 76) ; smallest Line cx = real(#z) cy = cx polar = 3*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 77) ; smallest Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif polar = @a*(cx + flip(qy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 78) ; smallest Parabola cy = imag(#z) cx = 10*@b*cy^2 polar = 0.65*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 79) ; smallest Trefoil theta = atan(imag(#z)/real(#z)) rr = 0.1*@a/cos(3*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 80) ; smallest Trident of Descartes cx = real(#z) cy = (cx-0.2*@b)*(cx+0.2*@b)*(cx-0.4*@b)/cx polar = @a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 81) ; smallest Trisectrix of Maclaurin theta = atan(imag(#z)/real(#z)) rr = 0.5*@a*sin(3*theta)/sin(2*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 82) ; smallest Atzema Spiral theta = atan(imag(#z)/real(#z)) af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 83) ; smallest Rose of Troy theta = atan(imag(#z)/real(#z)) rr = @cp*(1+10*@a*sin(4*@b*theta)) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 84) ; smallest Cotes' Spiral theta = atan(imag(#z)/real(#z)) rr = @a/cosh(@b*theta) polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 85) ; smallest Dipole Curve theta = atan(imag(#z)/real(#z)) rr = @a*(cos(theta))^0.5 polar = (rr*cos(theta))+flip((rr*sin(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 86) ; smallest Polytrope cx = real(#z) cy = 1/cx^@pn polar = 0.00005*@a*(cx + flip(cy)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF IF (@p2 > |oldz1-z1| || \ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 86) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 87) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (@p2 > |oldz1-z1|) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "Slope (CubicRoots-Julia)" maxiter = 1000 center = (0, 0) magn = 12 method = multipass periodicity = 0 heading caption = "Slope CubicRoots-Julia" endheading $ifdef VER40 heading text = "This is a 'convergent' fractal. Eighty eight different height \ value types are available. Use with Damien's Lighting formula, \ 3D Texturizer Enhanced III or Direct Color Slope." endheading $else heading caption = "This is a 'convergent' fractal." endheading heading caption = "Use with Damien's Lighting" endheading heading caption = "formula or 3D Texturizer III" endheading $endif param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p1 caption = "Parameter 1" default = (0.522375, -0.002875) endparam param p2 caption = "Bailout value" default = 0.000001 max = 0.1 endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 87 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn1 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 || @zmode==58 || @zmode==59 \ || @zmode==60 || @zmode==61 || @zmode==62 || @zmode==63 || @zmode==64 \ || @zmode==65 || @zmode==66 || @zmode==67 || @zmode==68 || @zmode==69 \ || @zmode==70 || @zmode==71 || @zmode==72 || @zmode==73 || @zmode==74 \ || @zmode==75 || @zmode==76 || @zmode==77 || @zmode==78 || @zmode==79 \ || @zmode==80 || @zmode==81 || @zmode==82 || @zmode==83 || @zmode==84 \ || @zmode==85 || @zmode==86 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 || @zmode==61 || @zmode==62 || @zmode==63 \ || @zmode==64 || @zmode==65 || @zmode==69 || @zmode==73 || @zmode==75 \ || @zmode==78 || @zmode==80 || @zmode==82 || @zmode==83 || @zmode==84 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@zmode==83 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 || @zmode==69 || @zmode==86 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 || @zmode==60 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 || @zmode==60 endfunc param sa1 caption = "Adjuster 1" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @zmode == 67 || @zmode==70 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @zmode == 70 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @zmode == 70 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @zmode == 70 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @zmode == 70 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @zmode == 70 endparam func safn caption = "Adjuster Fn" default = ident() visible = @zmode == 67 || @zmode==70 endfunc param negroot caption = "Quad Neg Root" default = false visible=@zmode==58 || @zmode==61 || @zmode==66 || @zmode==74 || @zmode==77 endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam param init caption = "Iteration Initialization" default = (0.33,0) endparam switch: type = "SlopeCubicRoots-Mandel" p2 = @p2 offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter a = @a b = @b cp = @cp pn = @pn afn1 = @afn1 afn2 = @afn2 safn = @safn apwr = @apwr fn1 = @fn1 sa1 = @sa1 sa2 = @sa2 sa3 = @sa3 sa4 = @sa4 sa5 = @sa5 sa6 = @sa6 sa7 = @sa7 negroot = @negroot } JuliaMix4_UF {; Ron Barnett, December 2000 ; This is the Julia version of the MandelbrotMix4 formula ; created by Jim Muth. init: float a = real(@p1) float b = imag(@p1) float d = real(@p2) float f = imag(@p2) #z = #pixel float k = real(p3) + 1 float l = imag(p3) + 100 complex c = @fn1(@seed) loop: #z = k*(a*#z^b + d*#z^f) + c bailout: (@test == 0 && |#z| <= l) || \ (@test == 1 && sqr(real(#z)) <= l) || \ (@test == 2 && sqr(imag(#z)) <= l) || \ (@test == 3 && (sqr(real(#z)) <= l && sqr(imag(#z)) < l)) || \ (@test == 4 && (sqr(real(#z)) <= l || sqr(imag(#z)) < l)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= l)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= l)) default: title = "JuliaMix4_UF" maxiter = 255 center = (0, 0) periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param p1 caption = "Parameter 1" default = (1,4) endparam param p2 caption = "Parameter 2" default = (2,2) endparam param p3 caption = "Parameter 3" default = (-0.5,0) endparam param seed caption = "Julia Seed" default = (0.43,0.16) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam func fn1 caption = "Function 1" default = abs() endfunc switch: type = "MandelbrotMix4_UF" p1 = @p1 p2 = @p2 p3 = @p3 fn1 = @fn1 test = @test } SlopeExpJuliaMix4_UF {; Ron Barnett, December 2000 ; This is the Julia version of the MandelbrotMix4 formula ; created by Jim Muth. ; Some of the code based upon the slope (Mandelbrot) ; formula of Damien Jones init: float a = real(@p1) float b = imag(@p1) float d = real(@p2) float f = imag(@p2) float k = real(@p3) + 1 complex c1 = @fn1(@seed) ; primary iterated point complex c2 = @fn1(@seed) + @offset ; horizontally offset point complex c3 = @fn1(@seed) + flip(@offset) ; vertically offset point complex z1 = #pixel ; primary iterated point complex z2 = #pixel + @offset ; horizontally offset point complex z3 = #pixel + flip(@offset) ; vertically offset point int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: z1 = k*(a*z1^b + d*z1^f) + c1 ; iterate each point z2 = k*(a*z2^b + d*z2^f) + c2 z3 = k*(a*z3^b + d*z3^f) + c3 iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout) ; we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (JuliaMix4_UF)" center = (0.0, 0.0) maxiter = 1000 periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam float param bailout caption = "bailout" default = 1e5 endparam param p1 caption = "Parameter 1" default = (1,4) endparam param p2 caption = "Parameter 2" default = (2,2) endparam param p3 caption = "Parameter 3" default = (-0.5,0) endparam param seed caption = "Julia Seed" default = (0.43,0.16) endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam func fn1 caption = "Function 1" default = ident() endfunc switch: type = "SlopeMandelbrotJuliaMix4_UF" p1 = @p1 p2 = @p2 p3 = @p3 test = @test fn1 = @fn1 offset = @offset zmode = @zmode xfer = @xfer zscale = @zscale zsacale2 = @zscale2 everyiter = @everyiter } fun_barnsleyj1 { init: #z = #pixel loop: IF real(#z) >= 0 #z = @fn1(#z) #z = (#z - 1) * @seed ELSE #z = @fn1(#z) #z = (#z + 1) * @seed ENDIF bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Fun Barnsley 1 (Julia)" maxiter = 1000 method = multipass periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param seed caption = "Seed" default = (0.9, 1.0) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10000.0 min = 1.0 endparam func fn1 caption = "Function" default = ident() endfunc switch: type = "fun_barnsleym1" bailout = bailout test = test fn1 = fn1 } fun_barnsleyj2 { init: #z = #pixel loop: IF real(#z) * imag(@start) + real(@start) * imag(#z) >= 0 #z = @fn1(#z) #z = (#z - 1) * @start ELSE #z = @fn1(#z) #z = (#z + 1) * @start ENDIF bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Fun Barnsley 2 (Julia)" maxiter = 149 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Parameter" default = (0.6, 1.1) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 endparam func fn1 caption = "Function" default = ident() endfunc switch: type = "fun_barnsleym2" bailout = bailout test = test fn1 = fn1 } fun_barnsleyj3 { init: #z = #pixel loop: IF real(#z) > 0 #z = @fn1(#z) #z = sqr(#z) - 1 ELSE #z = @fn1(#z) #z = sqr(#z) - 1 + @start * real(#z) ENDIF bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Fun Barnsley 3 (Julia)" maxiter = 149 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Parameter" default = (0.1, 0.36) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 endparam func fn1 caption = "Function" default = ident() endfunc switch: type = "fun_barnsleym3" bailout = bailout test = test fn1 = fn1 } fun_barnsleym1 { init: #z = #pixel + @start loop: IF real(#z) >= 0 #z = @fn1(#z) #z = (#z - 1) * #pixel ELSE #z = @fn1(#z) #z = (#z + 1) * #pixel ENDIF bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Fun Barnsley 1 (Mandelbrot)" maxiter = 1000 method = multipass periodicity = 0 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Perturbation" default = (0, 0) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 10000.0 min = 1.0 endparam func fn1 caption = "Function" default = ident() endfunc switch: type = "fun_barnsleyj1" seed = #pixel bailout = bailout test = test fn1 = fn1 } fun_barnsleym2 { init: #z = #pixel + @start loop: IF real(#z) * imag(#pixel) + real(#pixel) * imag(#z) >= 0 #z = @fn1(#z) #z = (#z - 1) * #pixel ELSE #z = @fn1(#z) #z = (#z + 1) * #pixel ENDIF bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Fun Barnsley 2 (Mandelbrot)" maxiter = 149 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Perturbation" default = (0, 0) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 endparam func fn1 caption = "Function" default = ident() endfunc switch: type = "fun_barnsleyj2" start = #pixel bailout = bailout test = test fn1 = fn1 } fun_barnsleym3 { init: #z = #pixel + @start loop: IF real(#z) > 0 #z = @fn1(#z) #z = sqr(#z) - 1 ELSE #z = @fn1(#z) #z = sqr(#z) - 1 + #pixel * real(#z) ENDIF bailout: (@test == 0 && |#z| <= @bailout) || \ (@test == 1 && sqr(real(#z)) <= @bailout) || \ (@test == 2 && sqr(imag(#z)) <= @bailout) || \ (@test == 3 && (sqr(real(#z)) <= @bailout && sqr(imag(#z)) < @bailout)) || \ (@test == 4 && (sqr(real(#z)) <= @bailout || sqr(imag(#z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(#z)) + abs(imag(#z))) <= @bailout)) || \ (@test == 6 && (sqr(real(#z) + imag(#z)) <= @bailout)) default: title = "Fun Barnsley 3 (Mandelbrot)" maxiter = 149 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param start caption = "Perturbation" default = (0, 0) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 endparam func fn1 caption = "Function" default = ident() endfunc switch: type = "fun_barnsleyj3" start = #pixel bailout = bailout test = test fn1 = fn1 } SlopeExpFun_BarnsleyM1 { ; Ron Barnett, April 2001 ; init: complex c1 = #pixel; primary iterated point complex c2 = #pixel + @offset; horizontally offset point complex c3 = #pixel + flip(@offset); vertically offset point complex z1 = 0 complex z2 = 0 complex z3 = 0 int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0 ; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20 ; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: IF real(z1) >= 0 z1 = @fn1(z1) z1 = (z1 - 1) * c1 ELSE z1 = @fn1(z1) z1 = (z1 + 1) * c1 ENDIF IF real(z2) >= 0 z2 = @fn1(z2) z2 = (z2 - 1) * c2 ELSE z2 = @fn1(z2) z2 = (z2 + 1) * c2 ENDIF IF real(z3) >= 0 z3 = @fn1(z3) z3 = (z3 - 1) * c3 ELSE z3 = @fn1(z3) z3 = (z3 + 1) * c3 ENDIF iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter z1 = fn2(z1) z2 = fn2(z2) z3 = fn2(z3) IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (Fun_BarnsleyM1)" maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam func fn1 caption = "Input Function" default = ident() endfunc func fn2 caption = "Scaling Function" default = ident() endfunc switch: type = "SlopeExpFun_BarnsleyJ1" seed = #pixel bailout = @bailout zmode = @zmode offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 everyiter = @everyiter fn1 = @fn1 fn2 = @fn2 } SlopeExpFun_BarnsleyJ1 { ; Ron Barnett, April 2001 ; init: complex z1 = #pixel; primary iterated point complex z2 = #pixel + @offset; horizontally offset point complex z3 = #pixel + flip(@offset); vertically offset point int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0 ; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20 ; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: IF real(z1) >= 0 z1 = @fn1(z1) z1 = (z1 - 1) * @seed ELSE z1 = @fn1(z1) z1 = (z1 + 1) * @seed ENDIF IF real(z2) >= 0 z2 = @fn1(z2) z2 = (z2 - 1) * @seed ELSE z2 = @fn1(z2) z2 = (z2 + 1) * @seed ENDIF IF real(z3) >= 0 z3 = @fn1(z3) z3 = (z3 - 1) * @seed ELSE z3 = @fn1(z3) z3 = (z3 + 1) * @seed ENDIF iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter z1 = fn2(z1) z2 = fn2(z2) z3 = fn2(z3) IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 4) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 5) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (Fun_BarnsleyJ1)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param seed caption = "Julia Seed" default = (0.9,1.0) hint = "This is the Julia seed, a constant parameter which \ defines the shape of the fractal." endparam param bailout caption = "Bail-out Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param zmode caption = "Height Value" default = 5 enum = "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" \ "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam func fn1 caption = "Input Function" default = ident() endfunc func fn2 caption = "Scaling Function" default = ident() endfunc switch: type = "SlopeExpFun_BarnsleyM1" bailout = @bailout zmode = @amode offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 everyiter = @everyiter fn1 = @fn1 fn2 = @fn2 } SlopeExpFun_BarnsleyM2 { ; Ron Barnett, April 2001 ; Modified with more Height Values July 2004 ; init: complex c1 = #pixel; primary iterated point complex c2 = #pixel + @offset; horizontally offset point complex c3 = #pixel + flip(@offset); vertically offset point complex z1 = 0 complex z2 = 0 complex z3 = 0 int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0 ; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20 ; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: IF real(z1) * imag(c1) + real(c1) * imag(z1) >= 0 z1 = @fn1(z1) z1 = (z1 - 1) * c1 ELSE z1 = @fn1(z1) z1 = (z1 + 1) * c1 ENDIF IF real(z2) * imag(c2) + real(c2) * imag(z2) >= 0 z2 = @fn1(z2) z2 = (z2 - 1) * c2 ELSE z2 = @fn1(z2) z2 = (z2 + 1) * c2 ENDIF IF real(z3) * imag(c3) + real(c3) * imag(z3) >= 0 z3 = @fn1(z3) z3 = (z3 - 1) * c3 ELSE z3 = @fn1(z3) z3 = (z3 + 1) * c3 ENDIF iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter z1 = fn2(z1) z2 = fn2(z2) z3 = fn2(z3) IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(@fn3(z1))) + abs(imag(@fn3(z1))) ; get current distances d2 = abs(real(@fn3(z2))) + abs(imag(@fn3(z2))) d3 = abs(real(@fn3(z3))) + abs(imag(@fn3(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(@fn3(z1)) ; get current distances d2 = cabs(@fn3(z2)) d3 = cabs(@fn3(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 57) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 58) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (Fun_BarnsleyM2)" maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param bailout caption = "Bailout Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 58 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn3 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 endparam func afn1 caption = "Polar Fn 1" default = cos() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible = @zmode==17 || @zmode==23 || @zmode==26 || @zmode==27 || @zmode==28 \ || @zmode==29 || @zmode==32 endfunc param xfer caption = "Height Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" "sin" "cos" "tan" hint = "This function will be applied to the height value \ before a slope is calculated." endparam param zscale caption = "Height Pre-Scale" default = 1.0 hint = "Specifies the ratio between height and distance. Higher \ values will exaggerate differences between high and low. \ In general, you will want to use smaller numbers here." endparam param zscale2 caption = "Height Post-Scale" default = 0.025 hint = "Specifies the ratio between height and distance; like \ Height Pre-Scale, except that this value is applied after \ the transfer function." endparam param everyiter caption = "Every Iteration" default = false hint = "If set, the surface normal will be computed at every \ iteration. If you are using a coloring algorithm which \ processes every iteration, you will need this." endparam func fn1 caption = "Input Function" default = ident() endfunc func fn2 caption = "Scaling Function" default = ident() endfunc switch: type = "SlopeExpFun_BarnsleyJ2" seed = #pixel bailout = @bailout offset = @offset xfer = @xfer zscale = @zscale zscale2 = @zscale2 zmode = @zmode everyiter = @everyiter fn1 = @fn1 fn2 = @fn2 a = @a b = @b pn = @pn afn1 = @afn1 afn2 = @afn2 fn3 = @fn3 } SlopeExpFun_BarnsleyJ2 { ; Ron Barnett, April 2001 ; Modified with more Height Values July 2004 ; init: complex z1 = #pixel; primary iterated point complex z2 = #pixel + @offset; horizontally offset point complex z3 = #pixel + flip(@offset); vertically offset point int done = 2 float modz = 0.0 float e1 = 0.0; potentials float e2 = 0.0 float e3 = 0.0 float vx = 0.0; normal vector float vy = 0.0 float vz = 0.0 float vd = 0.0 float d1 = 0.0 ; distances float d2 = 0.0 float d3 = 0.0 float s1 = 1.0e20 ; smallest distances float s2 = 1.0e20 float s3 = 1.0e20 float iterexp1 = 0.0 float iterexp2 = 0.0 float iterexp3 = 0.0 loop: IF real(z1) * imag(@seed) + real(@seed) * imag(z1) >= 0 z1 = @fn1(z1) z1 = (z1 - 1) * @seed ELSE z1 = @fn1(z1) z1 = (z1 + 1) * @seed ENDIF IF real(z2) * imag(@seed) + real(@seed) * imag(z2) >= 0 z2 = @fn1(z2) z2 = (z2 - 1) * @seed ELSE z2 = @fn1(z2) z2 = (z2 + 1) * @seed ENDIF IF real(z3) * imag(@seed) + real(@seed) * imag(z3) >= 0 z3 = @fn1(z3) z3 = (z3 - 1) * @seed ELSE z3 = @fn1(z3) z3 = (z3 + 1) * @seed ENDIF iterexp1 = iterexp1 + exp(-cabs(z1)) iterexp2 = iterexp2 + exp(-cabs(z2)) iterexp3 = iterexp3 + exp(-cabs(z3)) done = done + 1; increment iteration counter z1 = fn2(z1) z2 = fn2(z2) z3 = fn2(z3) IF (@zmode == 0) ; smallest |z| d1 = |z1| ; get current distances from origin d2 = |z2| d3 = |z3| IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 1) ; smallest |real(z)| d1 = abs(real(z1)) ; get current distances from i axis d2 = abs(real(z2)) d3 = abs(real(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 2) ; smallest |imag(z)| d1 = abs(imag(z1)) ; get current distances from r axis d2 = abs(imag(z2)) d3 = abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 3) ; smallest |real(z)|+|imag(z)| d1 = abs(real(z1))+abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))+abs(imag(z2)) d3 = abs(real(z3))+abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 4) ; smallest |real(z)|*|imag(z)| d1 = abs(real(z1))*abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))*abs(imag(z2)) d3 = abs(real(z3))*abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 5) ; smallest |real(z)|/|imag(z)| d1 = abs(real(z1))/abs(imag(z1)) ; get current distances from i axis d2 = abs(real(z2))/abs(imag(z2)) d3 = abs(real(z3))/abs(imag(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 6) ; smallest |atan(z)| d1 = abs(atan2(z1)) ; get current angles d2 = abs(atan2(z2)) d3 = abs(atan2(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 7) ; smallest |function1(z)| d1 = abs(real(@fn3(z1))) + abs(imag(@fn3(z1))) ; get current distances d2 = abs(real(@fn3(z2))) + abs(imag(@fn3(z2))) d3 = abs(real(@fn3(z3))) + abs(imag(@fn3(z3))) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 8) ; smallest |function2(z)| d1 = cabs(@fn3(z1)) ; get current distances d2 = cabs(@fn3(z2)) d3 = cabs(@fn3(z3)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 9) ; smallest Lemniscate Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(2*theta))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 10) ; smallest Cardiod Distance theta = atan(imag(#z)/real(#z)) r = 5*@a*(1-cos(theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 11) ; smallest Conchoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*(@a + @b*cos(theta))/cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 12) ; smallest Cycloid Distance theta = atan(imag(#z)/real(#z)) r = 2*cabs(#z) polar = r*(theta-sin(theta)) + flip(r*(1-cos(theta))) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 13) ; smallest Archimedes Distance theta = atan(imag(#z)/real(#z)) r = 3.5*@a*theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 14) ; smallest Log Spiral Distance theta = atan(imag(#z)/real(#z)) r = exp(@a*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 15) ; smallest Rose Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 16) ; smallest Bifolium Distance theta = atan(imag(#z)/real(#z)) r = 16*@a*sin(theta)^2*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 17) ; smallest Astroid Distance theta = atan(imag(#z)/real(#z)) af1 = @afn1(theta)^imag(@apwr) af2 = @afn2(theta)^imag(@apwr) polar = 1.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 18) ; smallest Cissoid of Diocles Distance theta = atan(imag(#z)/real(#z)) r = 2*@a*sin(theta)*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 19) ; smallest Cochleoid Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*sin(theta)/theta polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 20) ; smallest Folium of Descartes Distance theta = atan(imag(#z)/real(#z)) r = @a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 21) ; smallest Limacon of Pascal Distance theta = atan(imag(#z)/real(#z)) r = 0.03*@b + 1.5*@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 22) ; smallest Lituus Distance theta = atan(imag(#z)/real(#z)) r = 0.6*@a/theta^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 23) ; smallest Nephroid Distance theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) polar = 0.75*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 24) ; smallest Strophoid Distance theta = atan(imag(#z)/real(#z)) r = 0.2*@b*sin(@a-2*theta)/sin(@a-theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 25) ; smallest Witch of Agnesi theta = atan(imag(#z)/real(#z)) af1 = 2*cotan(theta) af2 = 1-cos(2*theta) polar = 0.1*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 26) ; smallest Curtate Cycloid theta = atan(imag(#z)/real(#z)) af1 = 2*@a*theta - 0.1*@b*@afn2(theta) af2 = 2*@a - 0.1*@b*@afn1(theta) polar = af1 + flip(af2) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 27) ; smallest Epicycloid theta = atan(imag(#z)/real(#z)) af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) polar = 0.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 28) ; smallest Ellipse Evolute theta = atan(imag(#z)/real(#z)) af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@apwr)) af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@apwr)) polar = 0.2*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 29) ; smallest Tractrix theta = atan(imag(#z)/real(#z)) af1 = @a*(log(tan(theta/2))-@afn1(theta)) af2 = @a*@afn2(theta) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 30) ; smallest Kampyle of Eudoxus Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta)^2 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 31) ; smallest Circle Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*@b*cos(theta)) polar = 1.5*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 32) ; smallest Deltoid Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) polar = 0.35*@a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 33) ; smallest Ellipse Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) polar = 0.25*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 34) ; smallest Log Spiral Catacaustic theta = atan(imag(#z)/real(#z)) af1 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)-sin(theta))/(1+(2*@b^2)) af2 = 2*@b*exp(2*@b*theta)*(2*@b*cos(theta)+sin(theta))/(1+(2*@b^2)) polar = @a*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 35) ; smallest Butterfly Distance theta = atan(imag(#z)/real(#z)) r = 1.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 36) ; smallest Gear Curve theta = atan(imag(#z)/real(#z)) af1 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*cos(theta) af2 = (0.25*@a+1/@b*tanh(@b*sin(@pn*theta)))*sin(theta) polar = (af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 37) ; smallest Arachnida 1 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn-1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 38) ; smallest Arachnida 2 Distance theta = atan(imag(#z)/real(#z)) r = @a*sin(@pn*theta)/sin((@pn+1)*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 39) ; smallest Cayley's Sextic Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*cos(theta)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 40) ; smallest Cycloid of Seva Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a*(1+2*cos(2*theta)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 41) ; smallest Devil's Curve Distance theta = atan(imag(#z)/real(#z)) r = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 42) ; smallest Eight Curve Distance theta = atan(imag(#z)/real(#z)) r = @a*cos(theta)^(-2)*cos(2*theta)^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 43) ; smallest Epispiral Distance theta = atan(imag(#z)/real(#z)) r = 0.25*@a/cos(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 44) ; smallest Hipopede Distance theta = atan(imag(#z)/real(#z)) r = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 45) ; smallest Maltese Cross Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 46) ; smallest Ophiuride Distance theta = atan(imag(#z)/real(#z)) r = (0.01*@b*sin(theta)-4.5*@a*cos(theta))*tan(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 47) ; smallest Quadratrix of Hippias Distance theta = atan(imag(#z)/real(#z)) r = @a*theta/sin(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 48) ; smallest Poinsot Spiral 1 Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a/cosh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 49) ; smallest Poinsot Spiral 2 Distance theta = atan(imag(#z)/real(#z)) r = @a/sinh(@pn*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 50) ; smallest Quadrifolium Distance theta = atan(imag(#z)/real(#z)) r = 2.5*@a*sin(2*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 51) ; smallest Scarabaeus Distance theta = atan(imag(#z)/real(#z)) r = 0.5*@b*cos(2*theta)-@a*cos(theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 52) ; smallest Semicubical Parabola Distance theta = atan(imag(#z)/real(#z)) r = 1.5*@a*(cos(3*@b*theta))^(1/(3*@b)) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 53) ; smallest Swastika Curve Distance theta = atan(imag(#z)/real(#z)) r = 2.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 54) ; smallest Trifolium Distance theta = atan(imag(#z)/real(#z)) r = -2*@a*cos(3*theta) polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 55) ; smallest Tschirnhausen Cubic Distance theta = atan(imag(#z)/real(#z)) r = @a/cos(theta/3)^3 polar = r*cos(theta) + flip(r*sin(theta)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 56) ; smallest Bicorn theta = atan(imag(#z)/real(#z)) af1 = @a*sin(theta) af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ELSEIF (@zmode == 57) ; smallest Cruciform theta = atan(imag(#z)/real(#z)) af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) polar = 1.5*(af1 + flip(af2)) d1 = abs(cabs(z1)-cabs(polar)) ; get current distances d2 = abs(cabs(z2)-cabs(polar)) d3 = abs(cabs(z3)-cabs(polar)) IF (d1 < s1) ; update smallest distances s1 = d1 ENDIF IF (d2 < s2) s2 = d2 ENDIF IF (d3 < s3) s3 = d3 ENDIF ENDIF modz = |z1| IF (modz > @bailout ||\ @everyiter ||\ done == #maxit + 2); done, or every iteration, or last ; determine continuous iteration (height) for each point IF (@zmode >= 0 && @zmode <= 57) ; height based on smallest |z| e1 = s1 * @zscale e2 = s2 * @zscale e3 = s3 * @zscale ELSEIF (@zmode == 58) e1 = iterexp1 * @zscale e2 = iterexp2 * @zscale e3 = iterexp3 * @zscale ENDIF ; apply transfer function ; a function is not used because these are floats ; and not all functions apply to floats IF (@xfer == 1); log e1 = log(e1) e2 = log(e2) e3 = log(e3) ELSEIF (@xfer == 2); sqrt e1 = sqrt(e1) e2 = sqrt(e2) e3 = sqrt(e3) ELSEIF (@xfer == 3); cuberoot e1 = (e1)^(1/3) e2 = (e2)^(1/3) e3 = (e3)^(1/3) ELSEIF (@xfer == 4); exp e1 = exp(e1) e2 = exp(e2) e3 = exp(e3) ELSEIF (@xfer == 5); sqr e1 = sqr(e1) e2 = sqr(e2) e3 = sqr(e3) ELSEIF (@xfer == 6); cube e1 = (e1)^3 e2 = (e2)^3 e3 = (e3)^3 ELSEIF (@xfer == 7); sin e1 = sin(e1) e2 = sin(e2) e3 = sin(e3) ELSEIF (@xfer == 8); cos e1 = cos(e1) e2 = cos(e2) e3 = cos(e3) ELSEIF (@xfer == 9); tan e1 = tan(e1) e2 = tan(e2) e3 = tan(e3) ENDIF ; apply post-scale e1 = e1 * @zscale2 e2 = e2 * @zscale2 e3 = e3 * @zscale2 vx = e2-e1 vy = e3-e1 vz = -@offset ; normalize vector vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd z = vx + flip(vy); fudge z from vector ELSE; didn't compute z this time z = z1; use primary iteration value to keep periodicity working ENDIF IF (modz > @bailout); we're done done = 0 ENDIF bailout: (done > 0) default: title = "SlopeExp (Fun_BarnsleyJ2)" center = (0.0, 0.0) maxiter = 1000 param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param seed caption = "Julia Seed" default = (0.6,1.1) hint = "This is the Julia seed, a constant parameter which \ defines the shape of the fractal." endparam param bailout caption = "Bail-out Value" default = 10000.0 min = 0.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param offset caption = "Orbit Separation" default = 0.00000001 hint = "Defines how far apart the simultaneous orbits are. Smaller \ distances will produce more accurate results." endparam param zmode caption = "Height Value" default = 58 enum = "smallest |z|" "smallest |real(z)|" "smallest |imag(z)|" \ "smallest |sum(z)|" "smallest |product(z)|" \ "|smallest quotient(z)|" "smallest |atan(z)|" \ "smallest |function1(z)|" "smallest |function2(z)|" \ "Lemniscate" "Cardiod" "Conchoid" "Cycloid" "Archimedes" \ "Log Spiral" "Rose" "Bifolium" "Astroid" "Cissoid of Diocles" \ "Cochleoid" "Folium of Descartes" "Limacon of Pascal" \ "Lituus" "Nephroid" "Strophoid" "Witch of Agnesi" \ "Curtate Cycloid" "Epicycloid" "Ellipse Evolute" "Tractrix" \ "Kampyle of Eudoxus" "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" "Butterfly" \ "Gear Curve" "Arachnida 1" "Arachnida 2" "Cayley's Sectic" \ "Cycloid of Seva" "Devil's Curve" "Eight Curve" "Epispiral" \ "Hipopede" "Maltese Cross" "Ophiuride" "Quadratrix of Hippias" \ "Poinsot Spiral 1" "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "smoothed iteration" hint = "Specifies what will be used to construct a height value." endparam func fn3 caption = "Transmute Function" default = sin() visible = @zmode==7 || @zmode ==8 endfunc param a caption = "Polar Parameter" default = 0.2 visible=@zmode==9 || @zmode==10 || @zmode==11 || @zmode==13 || @zmode==14 \ || @zmode==15 || @zmode==16 || @zmode==17 || @zmode==18 || @zmode==19 \ || @zmode==20 || @zmode==21 || @zmode==22 || @zmode==23 || @zmode==24 \ || @zmode==25 || @zmode==26 || @zmode==27 || @zmode==28 || @zmode==29 \ || @zmode==30 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==35 || @zmode==36 || @zmode==37 || @zmode==38 || @zmode==39 \ || @zmode==40 || @zmode==41 || @zmode==42 || @zmode==43 || @zmode==44 \ || @zmode==45 || @zmode==46 || @zmode==47 || @zmode==48 || @zmode==49 \ || @zmode==50 || @zmode==51 || @zmode==52 || @zmode==53 || @zmode==54 \ || @zmode==55 || @zmode==56 || @zmode==57 endparam param b caption = "2nd Polar Parameter" default = 1.0 visible=@zmode==11 || @zmode==21 || @zmode==24 || @zmode==26 || @zmode==27 \ || @zmode==28 || @zmode==31 || @zmode==32 || @zmode==33 || @zmode==34 \ || @zmode==36 || @zmode==41 || @zmode==44 || @zmode==46 || @zmode==51 \ || @zmode==52 || @zmode==57 endparam param pn caption = "Polar Integer" default = 3 visible=@zmode==36 || @zmode==37 || @zmode==38 || @zmode==43 || @zmode==48 \ || @zmode==49 endparam param apwr caption = "Polar Power" default = (3.0,3.0) visible = @zmode==17 || @zmode==28 endparam func afn1 caption = "Polar Fn 1" default = cos(