comment { MMF formulae V7.1 (July 2018) Added "Double Mandy" to the Transformation formula. (31st March 2006) Added the "Max. Iter." trapping option that allows the creation of hollow objects to the Solid 3D formulas and added more main formula options to the Quaternion and Hypercomplex formulas including extended Newton formulas and Barnsley 1. Plus added "Smart step" which is useful for getting better quality rendering in shorter times when setting up - though I don't recommend it for final "print-quality" renders and it doesn't really work with the solid based on trapping options. Added the solid conditions based on trapping either final z or all orbit z values and the option to add clipping to planes or to a sphere and the option of setting the lighting to follow the camera to all the Solid 3D formulas. Plus added the Newton for the roots of z^3-v for the quaternion formula and the Newton for the roots of z^n-v for the hypercomplex formula. (March 2006) Added convergent Hinrich to Formula wars and Transformation. Also added the "Integrate" formula option to both (try it with 'Iterate the Sum'. (November 2004) Added Earl Hinrich's smoothing to Formula Wars and updated it here and in the Transformation formula to include a loglog version. (July 2003) Added Earl Hinrichs' smoothing algorithm to the Transformation formula. (September 2002) Added switch scaling and centreing to Transformation as well as Chebyshev polynomials for arbitrary powers. Also added the same Chebyshevs along with Manowar and zold*z^p+c to Formula Wars plus some extra war conditions. (August 2002) Added the "Iterate the product" option to a number of formulas and added "Formula Wars". (April 2002) Added the "Extrapolation" formulae, the "Power" formula and added "z^iter+c" to Transformation. (March 2002) Fixed a bug in Solid3D quaternions, Lambda Julia. Please note that this will affect any old parameter files using the Lambda Julia quaternion. Also added the ability to use the switch-preview to rotate the fractals for all the Solid3D types. (24th September 2001) Added F(xy)G(xy)#2. (16th August 2001) Added "iterate the sum" to Transformation, Transpoly, Derivative, NotRot and F(xy)G(xy)#1, also added self-rotation to Transformation and Transpoly as well as offset and scaling of the switch previews to Transpoly plus the Lambda/Mu variants and presets to the F(xy)G(xy)#1 formula. (13th August 2001) Added "Derivative", "Not-rotation" and "Fxy,Gxy#1". (5th July 2001) Added the "Solid 3D" types, complex, polynomials, quaternions and hypercomplex. These effectively supercede the older 3D formulas, allowing true Phong lighting with shadows ! Plus colouring using any Inside colouring formula. (18th June 2001) Added MMFrac compatible bailouts (x*x/y, y*y/x) to the Trans and Transpoly formulas. (10th September 2000) Added some special polynomial types inspired by Morgan Owens' Fractint Chebyshev collection. These M/J formulas include the option of the initial function and the iterative transform plus the option of final scaling of z by the iteration count and/or a constant at the end of each iteration. This option of scaling z is also available for the Trans formulas. (1st-6th September 2000) Added the extra initial z = Fn2(z) to the "Trans" formulas and z = z^n + c where n is complex rather than just real. The addition of the initial "Fn2(z)" allows a far simpler method of producing the most interesting members of the family of fractals related to (x + y)^n - simply use the standard z^n + c formula with Fn2 set to flip (or conj). (23rd August 2000) Added more options to the "Trans" formulas, including a choice of divergent bailout tests and four more base formulas. (17th August 2000) Added the corrected standard Hypercomplex 3D Julias formula and the "Trans" formulas. (30th July 2000) Improved the 3D formulas and added Standard Quaternion and Hypercomplex 3D Julias. (18th February 2000) Some "more user-friendly" 3D formulas added. Helpfile created (MMF.html) (3rd/4th January 2000) Bugs fixed ! (9th December 1999) A truly 3D, 3D formula added. (8th December 1999) "Two cubed" fractals added. 3D formula finished. (7th December 1999) I have now added a "formula" allowing complete 4-D transformation for several fractal types. (19th November 1999) While developing MMFrac I initially decided to stick to mainly adding only fast drawing fractals that produce reasonably interesting results. Fastdraw was my first attempt, followed by X Squared. TwoSquare (and family) was my third attempt and was unsurprisingly inspired by the original Mandelbrot set and "the difference of two squares". The first example prompted me to investigate the other possibilities for +/-x*x+/-2*x*y+/-y*y. Using MMFrac I checked all 64 and the original and two best are given here along with a generic formula so you can investigate all 64 possibilities yourself, should you feel so inclined. One or two of the general combinations are very boring (not even fractals?) and some others are just visual transformations of each other. (2nd November 1999) Dave Makin (Makin' Magic) http://www.fractalgallery.co.uk/ http://website.lineone.net/~dave_makin/ https://www.facebook.com/david.makin.7/ https://www.facebook.com/Makin-Magic-Fractals-115292188862/ Please send any comments/suggestions about these formulae to: dave_makin@lineone.net } MMFa-Mandelbrot { ; Fastdraw ; For Iteration smoothing set the exponent to ; (1.95, 0) init: z = @start float x = real(z) float y = imag(z) float a = x float c = real(#pixel) float d = imag(#pixel) loop: a = x x = c - y*y y = a*y + d z = x + flip(y) bailout: |z| <= @bailout default: title = "Fastdraw, Mandelbrot" center = (0, 0) helpfile = "MMF.html" param start caption = "Starting point" default = (0,0) hint = "Perturbation of start Z, use to deform the fractal." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam switch: type = "MMFa-Julia" seed = #pixel bailout = bailout } MMFa-Julia { ; Fastdraw ; For Iteration smoothing set the exponent to ; (1.95, 0) init: z = #pixel float x = real(z) float y = imag(z) float a = x float c = real(@seed) float d = imag(@seed) loop: a = x x = c - y*y y = a*y + d z = x + flip(y) bailout: |z| <= @bailout default: title = "Fastdraw, Julia" center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (-0.10625, -1.275) hint = "Use this to create many different Julia sets. You can \ also set this value using the Switch feature." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam switch: type = "MMFa-Mandelbrot" bailout = bailout } MMFb-Mandelbrot { ; X Squared ; For Iteration smoothing set the exponent to ; (4, 0) init: z = @start float x = real(z) float y = imag(z) float a = x float c = real(#pixel) float d = imag(#pixel) loop: a = x*x x = a*a - y*y + c y = 2*a*y + d z = x + flip(y) bailout: |z| <= @bailout default: title = "X Squared, Mandelbrot" center = (0, 0) helpfile = "MMF.html" param start caption = "Starting point" default = (0,0) hint = "Perturbation of start Z, use to deform the fractal." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam switch: type = "MMFb-Julia" seed = #pixel bailout = bailout } MMFb-Julia { ; X Squared ; For Iteration smoothing set the exponent to ; (4, 0) init: z = #pixel float x = real(z) float y = imag(z) float a = x float c = real(@seed) float d = imag(@seed) loop: a = x*x x = a*a - y*y + c y = 2*a*y + d z = x + flip(y) bailout: |z| <= @bailout default: title = "X Squared, Julia" center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (-0.10625, -0.4125) hint = "Use this to create many different Julia sets. You can \ also set this value using the Switch feature." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam switch: type = "MMFb-Mandelbrot" bailout = bailout } MMFc-Mandelbrot { ; Two Square 1 ; This was my first "Two Square" fractal. ; For Iteration smoothing set the exponent to ; (2.06, 0) init: z = @start float x = real(z) float y = imag(z) float a = x float b = y float c = real(#pixel) float d = imag(#pixel) loop: a = x*x b = 2*x*y + y*y x = a + b + c y = a - b + d z = x + flip(y) bailout: |z| <= @bailout default: title = "Two Square 1, Mandelbrot" center = (-0.5, 0) helpfile = "MMF.html" param start caption = "Starting point" default = (0.5, 0) hint = "Perturbation of start Z, use to deform the fractal." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam switch: type = "MMFc-Julia" seed = #pixel bailout = bailout } MMFc-Julia { ; Two Square 1 ; This was my first "Two Square" fractal. ; For Iteration smoothing set the exponent to ; (2.06, 0) init: z = #pixel float x = real(z) float y = imag(z) float a = x float b = y float c = real(@seed) float d = imag(@seed) loop: a = x*x b = 2*x*y + y*y x = a + b + c y = a - b + d z = x + flip(y) bailout: |z| <= @bailout default: title = "Two Square 1, Julia" center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (-1.11875, 0.125) hint = "Use this to create many different Julia sets. You can \ also set this value using the Switch feature." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam switch: type = "MMFc-Mandelbrot" bailout = bailout } MMFd-Mandelbrot { ; Two Square 2 ; This really is truly two squares: ; (x+y)*(x+y) and (x-y)*(x-y) ; For Iteration smoothing set the exponent to ; (2.06, 0) init: z = @start float x = real(z) float y = imag(z) float a = x float b = y float c = real(#pixel) float d = imag(#pixel) loop: a = x+y b = x-y x = a*a + c y = b*b + d z = x + flip(y) bailout: |z| <= @bailout default: title = "Two Square 2, Mandelbrot" center = (-0.5, -0.25) helpfile = "MMF.html" param start caption = "Starting point" default = (0,0) hint = "Perturbation of start Z, use to deform the fractal." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam switch: type = "MMFd-Julia" seed = #pixel bailout = bailout } MMFd-Julia { ; Two Square 2 ; This really is truly two squares: ; (x+y)*(x+y) and (x-y)*(x-y) ; For Iteration smoothing set the exponent to ; (2.06, 0) init: z = #pixel float x = real(z) float y = imag(z) float a = x float b = y float c = real(@seed) float d = imag(@seed) loop: a = x+y b = x-y x = a*a + c y = b*b + d z = x + flip(y) bailout: |z| <= @bailout default: title = "Two Square 2, Julia" center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (-0.315625, -0.040625) hint = "Use this to create many different Julia sets. You can \ also set this value using the Switch feature." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam switch: type = "MMFd-Mandelbrot" bailout = bailout } MMFe-Mandelbrot { ; Two Square 3 ; This seems the most "Mandelbrot original" ; style fractal of the Two Square family. ; (except one other which I'll let you find) ; For Iteration smoothing set the exponent to ; (2.06, 0) init: z = @start float x = real(z) float y = imag(z) float a = x float b = y float c = real(#pixel) float d = imag(#pixel) loop: a = x*x - y*y b = 2*x*y x = a + b + c y = a - b + d z = x + flip(y) bailout: |z| <= @bailout default: title = "Two Square 3, Mandelbrot" center = (0, 0) helpfile = "MMF.html" param start caption = "Starting point" default = (0,0) hint = "Perturbation of start Z, use to deform the fractal." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam switch: type = "MMFe-Julia" seed = #pixel bailout = bailout } MMFe-Julia { ; Two Square 3 ; This seems the most "Mandelbrot original" ; style fractal of the Two Square family. ; (except one other which I'll let you find) ; For Iteration smoothing set the exponent to ; (2.06, 0) init: z = #pixel float x = real(z) float y = imag(z) float a = x float b = y float c = real(@seed) float d = imag(@seed) loop: a = x*x - y*y b = 2*x*y x = a + b + c y = a - b + d z = x + flip(y) bailout: |z| <= @bailout default: title = "Two Square 3, Julia" center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (0.075, 0.55) hint = "Use this to create many different Julia sets. You can \ also set this value using the Switch feature." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam switch: type = "MMFe-Mandelbrot" bailout = bailout } MMFf-Mandelbrot { ; Two Square Family ; This allows you to select any member of the ; Two Square family. ; For Iteration smoothing set the exponent to ; (2.06, 0) init: z = @start float x = real(z) float y = imag(z) float a = x float b = y float c = real(#pixel) float d = imag(#pixel) loop: a = x*x b = 2*x*y y = y*y if @xxx>0 x = -a else x = a endif if @xxy>0 x = x - b else x = x + b endif if @xyy>0 x = x - y + c else x = x + y + c endif if @yyy>0 y = -y endif if @yxx>0 y = y - a else y = y + a endif if @yxy>0 y = y - b + d else y = y + b + d endif z = x + flip(y) bailout: |z| <= @bailout default: title = "Two Square Family, Mandelbrot" center = (0, 0) helpfile = "MMF.html" param start caption = "Starting point" default = (0,0) hint = "Perturbation of start Z, use to deform the fractal." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param xxx caption = "Sign of x*x (real)" enum = "+ x*x" "- x*x" default = 0 endparam param xxy caption = "Sign of 2*x*y (real)" enum = "+ 2*x*y" "- 2*x*y" default = 0 endparam param xyy caption = "Sign of y*y (real)" enum = "+ y*y" "- y*y" default = 0 endparam param yxx caption = "Sign of x*x (imag)" enum = "+ x*x" "- x*x" default = 0 endparam param yxy caption = "Sign of 2*x*y (imag)" enum = "+ 2*x*y" "- 2*x*y" default = 0 endparam param yyy caption = "Sign of y*y (imag)" enum = "+ y*y" "- y*y" default = 1 endparam switch: type = "MMFf-Julia" seed = #pixel bailout = bailout xxx = xxx xxy = xxy xyy = xyy yxx = yxx yxy = yxy yyy = yyy } MMFf-Julia { ; Two Square Family ; This allows you to select any member of the ; Two Square family. ; For Iteration smoothing set the exponent to ; (2.06, 0) init: z = #pixel float x = real(z) float y = imag(z) float a = x float b = y float c = real(@seed) float d = imag(@seed) loop: a = x*x b = 2*x*y y = y*y if @xxx>0 x = -a else x = a endif if @xxy>0 x = x - b else x = x + b endif if @xyy>0 x = x - y + c else x = x + y + c endif if @yyy>0 y = -y endif if @yxx>0 y = y - a else y = y + a endif if @yxy>0 y = y - b + d else y = y + b + d endif z = x + flip(y) bailout: |z| <= @bailout default: title = "Two Square Family, Julia" center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (-0.43125, -0.475) hint = "Use this to create many different Julia sets. You can \ also set this value using the Switch feature." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param xxx caption = "Sign of x*x (real)" enum = "+ x*x" "- x*x" default = 0 endparam param xxy caption = "Sign of 2*x*y (real)" enum = "+ 2*x*y" "- 2*x*y" default = 0 endparam param xyy caption = "Sign of y*y (real)" enum = "+ y*y" "- y*y" default = 0 endparam param yxx caption = "Sign of x*x (imag)" enum = "+ x*x" "- x*x" default = 0 endparam param yxy caption = "Sign of 2*x*y (imag)" enum = "+ 2*x*y" "- 2*x*y" default = 0 endparam param yyy caption = "Sign of y*y (imag)" enum = "+ y*y" "- y*y" default = 1 endparam switch: type = "MMFf-Mandelbrot" bailout = bailout xxx = xxx xxy = xxy xyy = xyy yxx = yxx yxy = yxy yyy = yyy } MMFg-Transform { ; Complete 4D transform ; I have added the transform in the formula due ; to the seed (Julia) or Zstart (Mandelbrot) ; becoming variables rather than constants. ; For the Magnet fractals you should enable the ; small bailout. ; ; Please expect the rendering of fractals using ; this method to be somewhat slower than the ; "normal" method for the selected type, this is ; because (at the very least) Ultra-Fractal is ; performing 16 extra multiplies and 12 extra ; additions per pixel. ; ; The fact that I've allowed a choice of different ; fractals is probably also reducing performance. ; ; You could apply the 4D transform to any fractal ; type by judicious use of cut and paste ! ; ; Please send any suggestions/improvements to: ; makinmagic@themutual.net ; init: float a=#pi/180.0 float a1=a*@angle1 float a2=a*@angle2 float a3=a*@angle3 float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float c3=cos(a3) float s3=sin(a3) float m1r0c0=c1*c2 float m1r1c0=-s1*c2 float m1r2c0=s2 float m1r2c1=-c2*s3 float m1r2c2=c2*c3 float t1=s1*c3 float t2=s1*s3 float t3=c1*c3 float t4=c1*s3 float m1r0c1=t1+t4*s2 float m1r0c2=t2-t3*s2 float m1r1c1=t3-t2*s2 float m1r1c2=t4+t1*s2 a1=a*@angle4 a2=a*@angle5 a3=a*@angle6 c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) c3=cos(a3) s3=sin(a3) float m2r0c0=c1*c2 float m2r1c0=-s1*c2 float m2r3c0=s2 float m2r3c1=-c2*s3 float m2r3c3=c2*c3 t1=s1*c3 t2=s1*s3 t3=c1*c3 t4=c1*s3 float m2r0c1=t1+t4*s2 float m2r0c3=t2-t3*s2 float m2r1c1=t3-t2*s2 float m2r1c3=t4+t1*s2 float m3r0c0=m1r0c0*m2r0c0+m1r0c1*m2r1c0 float m3r0c1=m1r0c0*m2r0c1+m1r0c1*m2r1c1 float m3r0c2=m1r0c2 float m3r0c3=m1r0c0*m2r0c3+m1r0c1*m2r1c3 float m3r1c0=m1r1c0*m2r0c0+m1r1c1*m2r1c0 float m3r1c1=m1r1c0*m2r0c1+m1r1c1*m2r1c1 float m3r1c2=m1r1c2 float m3r1c3=m1r1c0*m2r0c3+m1r1c1*m2r1c3 float m3r2c0=m1r2c0*m2r0c0+m1r2c1*m2r1c0 float m3r2c1=m1r2c0*m2r0c1+m1r2c1*m2r1c1 float m3r2c2=m1r2c2 float m3r2c3=m1r2c0*m2r0c3+m1r2c1*m2r1c3 float m3r3c0=m2r3c0 float m3r3c1=m2r3c1 float m3r3c3=m2r3c3 a1=a*@angle7 a2=a*@angle8 a3=a*@angle9 c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) c3=cos(a3) s3=sin(a3) m1r0c0=c1*c2 m1r2c0=-s1*c2 float m1r3c0=s2 float m1r3c2=-c2*s3 float m1r3c3=c2*c3 t1=s1*c3 t2=s1*s3 t3=c1*c3 t4=c1*s3 m1r0c2=t1+t4*s2 float m1r0c3=t2-t3*s2 m1r2c2=t3-t2*s2 float m1r2c3=t4+t1*s2 a1=a*@angle10 a2=a*@angle11 a3=a*@angle12 c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) c3=cos(a3) s3=sin(a3) m2r1c1=c1*c2 float m2r2c1=-s1*c2 m2r3c1=s2 float m2r3c2=-c2*s3 m2r3c3=c2*c3 t1=s1*c3 t2=s1*s3 t3=c1*c3 t4=c1*s3 float m2r1c2=t1+t4*s2 m2r1c3=t2-t3*s2 float m2r2c2=t3-t2*s2 float m2r2c3=t4+t1*s2 float m4r0c0=m1r0c0 float m4r0c1=m1r0c2*m2r2c1+m1r0c3*m2r3c1 float m4r0c2=m1r0c2*m2r2c2+m1r0c3*m2r3c2 float m4r0c3=m1r0c2*m2r2c3+m1r0c3*m2r3c3 float m4r1c1=m2r1c1 float m4r1c2=m2r1c2 float m4r1c3=m2r1c3 float m4r2c0=m1r2c0 float m4r2c1=m1r2c2*m2r2c1+m1r2c3*m2r3c1 float m4r2c2=m1r2c2*m2r2c2+m1r2c3*m2r3c2 float m4r2c3=m1r2c2*m2r2c3+m1r2c3*m2r3c3 float m4r3c0=m1r3c0 float m4r3c1=m1r3c2*m2r2c1+m1r3c3*m2r3c1 float m4r3c2=m1r3c2*m2r2c2+m1r3c3*m2r3c2 float m4r3c3=m1r3c2*m2r2c3+m1r3c3*m2r3c3 m1r0c0=m3r0c0*m4r0c0+m3r0c2*m4r2c0+m3r0c3*m4r3c0 m1r0c1=m3r0c0*m4r0c1+m3r0c1*m4r1c1+m3r0c2*m4r2c1+m3r0c3*m4r3c1 m1r0c2=m3r0c0*m4r0c2+m3r0c1*m4r1c2+m3r0c2*m4r2c2+m3r0c3*m4r3c2 m1r0c3=m3r0c0*m4r0c3+m3r0c1*m4r1c3+m3r0c2*m4r2c3+m3r0c3*m4r3c3 m1r1c0=m3r1c0*m4r0c0+m3r1c2*m4r2c0+m3r1c3*m4r3c0 m1r1c1=m3r1c0*m4r0c1+m3r1c1*m4r1c1+m3r1c2*m4r2c1+m3r1c3*m4r3c1 m1r1c2=m3r1c0*m4r0c2+m3r1c1*m4r1c2+m3r1c2*m4r2c2+m3r1c3*m4r3c2 m1r1c3=m3r1c0*m4r0c3+m3r1c1*m4r1c3+m3r1c2*m4r2c3+m3r1c3*m4r3c3 m1r2c0=m3r2c0*m4r0c0+m3r2c2*m4r2c0+m3r2c3*m4r3c0 m1r2c1=m3r2c0*m4r0c1+m3r2c1*m4r1c1+m3r2c2*m4r2c1+m3r2c3*m4r3c1 m1r2c2=m3r2c0*m4r0c2+m3r2c1*m4r1c2+m3r2c2*m4r2c2+m3r2c3*m4r3c2 m1r2c3=m3r2c0*m4r0c3+m3r2c1*m4r1c3+m3r2c2*m4r2c3+m3r2c3*m4r3c3 m1r3c0=m3r3c0*m4r0c0+m3r3c3*m4r3c0 m1r3c1=m3r3c0*m4r0c1+m3r3c1*m4r1c1+m3r3c3*m4r3c1 m1r3c2=m3r3c0*m4r0c2+m3r3c1*m4r1c2+m3r3c3*m4r3c2 m1r3c3=m3r3c0*m4r0c3+m3r3c1*m4r1c3+m3r3c3*m4r3c3 zold=#pixel bool bail=true if @mandel>0 float a=real(#pixel)-real(@ccentre) float b=imag(#pixel)-imag(@ccentre) float x=real(@seed)-real(@zcentre) float y=imag(@seed)-imag(@zcentre) else float a=real(@seed)-real(@ccentre) float b=imag(@seed)-imag(@ccentre) float x=real(#pixel)-real(@zcentre) float y=imag(#pixel)-imag(@zcentre) endif z=@zcentre+x*m1r0c0+y*m1r1c0+a*m1r2c0+b*m1r3c0 \ +flip(x*m1r0c1+y*m1r1c1+a*m1r2c1+b*m1r3c1) c=@ccentre+x*m1r0c2+y*m1r1c2+a*m1r2c2+b*m1r3c2 \ +flip(x*m1r0c3+y*m1r1c3+a*m1r2c3+b*m1r3c3) if @fractal>2 x=real(z) y=imag(z) a=real(c) b=imag(c) float d=x float f=y endif loop: zold = z if @fractal==0 z=z^@power+c elseif @fractal==1 z = ((z^2+c-1)/(2*z+c-2))^2 elseif @fractal==2 z = ((z^3+3*(c-1)*z+(c-1)*(c-2))/(3*z^2+3*(c-2)*z+(c-1)*(c-2)+1))^2 elseif @fractal==3 d = x x = a - y*y y = d*y + b z = x + flip(y) elseif @fractal==4 d = x*x x = d*d - y*y + a y = 2*d*y + b z = x + flip(y) elseif @fractal==5 d = x*x - y*y f = 2*x*y x = d + f + a y = d - f + b z = x + flip(y) endif if @bail2==1 if |z-1.0|<@bailout2 bail=false endif elseif @bail2==2 if |z-zold|<@bailout2 bail=false endif elseif @bail2==3 if |z-zold|<@bailout2 if |z-1.0|<@bailout2 bail=false endif endif endif bailout: |z| < @bailout && bail default: title = "4D Transform" center = (0, 0) periodicity = 0 helpfile = "MMF.html" param fractal caption = "Fractal type" enum = "Standard" "Magnet1" "Magnet2" "Fastdraw" "X Squared" \ "Two Square 3" default = 0 endparam param mandel caption = "Mandelbrot Switch" enum = "Julia" "Mandelbrot" default = 0 endparam param power caption = "Standard Power" default = (2,0) endparam param seed caption = "Seed/Perturb" default = (0.28, 0) hint = "The standard Julia seed or \ the perturbation of Zstart." endparam param zcentre caption = "Zstart centre" default = (0, 0) hint = "These are the Zstart coordinates \ of the rotation centre." endparam param ccentre caption = "C centre" default = (0, 0) hint = "These are the C coordinates \ of the rotation centre." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param bail2 caption = "Small Bail flag" enum = "No Small bailout" "Magnet bailout" "General bailout" "Magnet-Verified" default = 0 endparam param bailout2 caption = "Small Bail value" default = 0.00001 hint = "Bailout for point convergence, \ ie. finite point attraction." endparam param angle1 caption = "Rot 1 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Zstartreal/Zstartimag \ around the Creal axis." endparam param angle2 caption = "Rot 2 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Creal/Zstartreal \ around the Zstartimag axis." endparam param angle3 caption = "Rot 3 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Zstartimag/Creal \ around the Zstartreal axis." endparam param angle4 caption = "Rot 4 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Zstartreal/Zstartimag \ around the Cimag axis." endparam param angle5 caption = "Rot 5 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Cimag/Zstartreal \ around the Zstartimag axis." endparam param angle6 caption = "Rot 6 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Zstartimag/Cimag \ around the Zstartreal axis." endparam param angle7 caption = "Rot 7 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Zstartreal/Creal \ around the Cimag axis." endparam param angle8 caption = "Rot 8 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Cimag/Zstartreal \ around the Creal axis." endparam param angle9 caption = "Rot 9 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Creal/Cimag \ around the Zstartreal axis." endparam param angle10 caption = "Rot 10 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Zstartimag/Creal \ around the Cimag axis." endparam param angle11 caption = "Rot 11 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Cimag/Zstartimag \ around the Creal axis." endparam param angle12 caption = "Rot 12 (degrees)" default = 0.0 min = -360 max = 360 hint = "Rotation of Creal/Cimag \ around the Zstartimag axis." endparam } MMFh-Mandelbrot3D { ; Standard Mandelbrot set in 3D ; Requires the MMF "3D" outside colouring mode ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; http://skyscraper.fortunecity.com/terabyte/966/ ; 7th & 9th December 1999 ; init: float il2 = 1/log(2) float lb = il2*log(log(@bailout)) float a=#pi/180.0 float a1=a*@angle1 float a2=a*@angle2 float a3=a*@angle3 float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float c3=cos(a3) float s3=sin(a3) float m1r0c1=s1*c2 float m1r1c1=c1*c2 float m1r2c0=c2*s3 float m1r2c1=-s2 float m1r2c2=c2*c3 float t1=s1*s3 float t2=s1*c3 float t3=c1*s3 float t4=c1*c3 float m1r0c0=t1*s2+t4 float m1r0c2=t2*s2-t3 float m1r1c0=t3*s2-t2 float m1r1c2=t4*s2-t1 if @light==1 a1=a*@light1 a2=a*@light2 c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) float r0c0=c2 float r0c1=s1*s2 float r0c2=-c1*s2 float r1c0=0 float r1c1=c1 float r1c2=s1 float r2c0=s2 float r2c1=-s1*c2 float r2c2=c1*c2 endif float a=a*@angle4 float x=real(#pixel)-real(#center) float y=imag(#pixel)-imag(#center) cs=(x*m1r0c0+y*m1r1c0+@f*m1r2c0 \ +flip(x*m1r0c1+y*m1r1c1+@f*m1r2c1))/@detail b=(x*m1r0c2+y*m1r1c2+@f*m1r2c2)/@detail zs=b*cos(a)+flip(b*sin(a)) csub=cs/2.0 zsub=zs/2.0 zc=@start cc=#center zt=@start ct=#center int subdiv=0 float ldir=0 float ldir1=0 float ldir2=0 float t=0 float v=0 float v1=0 float v2=0 float l=0 w=@start bool found=false float i=0.5+@detail*@view/@f if @exitz==0 || @exitz==2 v=1.0/(65536.0*65536.0*4096.0) if @light==0 z1=v*m1r0c2*cos(a)+flip(v*m1r0c2*sin(a)) cc1=v*m1r0c0+flip(v*m1r0c1) z2=v*m1r1c2*cos(a)+flip(v*m1r1c2*sin(a)) cc2=v*m1r1c0+flip(v*m1r1c1) z3=v*m1r2c2*cos(a)+flip(v*m1r2c2*sin(a)) cc3=v*m1r2c0+flip(v*m1r2c1) else z1=v*r0c2*cos(a)+flip(v*r0c2*sin(a)) cc1=v*r0c0+flip(v*r0c1) z2=v*r1c2*cos(a)+flip(v*r1c2*sin(a)) cc2=v*r1c0+flip(v*r1c1) z3=v*r2c2*cos(a)+flip(v*r2c2*sin(a)) cc3=v*r2c0+flip(v*r2c1) endif endif z=zc float lsq=0 int j=0 int k=0 repeat z=z*z+cc j=j+1 until j>=#maxiter || |z|>@bailout if j<#maxiter lsq=|z| k=j z=zc+zs/65536.0 c=cc+cs/65536.0 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout if j<#maxiter ldir=j-k if ldir==0 ldir=lsq-|z| endif repeat zc=zc+zs cc=cc+cs j=0 z=zc repeat z=z*z+cc j=j+1 until j>=#maxiter || |z|>@bailout k=j lsq=|z| w=z if j>=#maxiter found=true ldir1=-1 zt=zc ct=cc else z=zc+zs/65536.0 c=cc+cs/65536.0 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout ldir1=j-k if ldir1==0 ldir1=lsq-|z| endif zt=zc ct=cc if j>=#maxiter found=true ldir1=-1 zt=zc+zs/65536.0 ct=cc+cs/65536.0 endif endif if ldir>0 || found if ldir1<0 || found if @solid==1 found=true endif ldir2=ldir1 zsub=zs/2.0 csub=cs/2.0 subdiv=0 repeat subdiv=subdiv+1 if ldir2<0 zt=zt-zsub ct=ct-csub else zt=zt+zsub ct=ct+csub endif z=zt j=0 repeat z=z*z+ct j=j+1 until j>=#maxiter || |z|>@bailout k=j lsq=|z| w=z if j>=#maxiter found=true ldir2=-1 else z=zt+zs/65536.0 c=ct+cs/65536.0 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout ldir2=j-k if ldir2==0 ldir2=lsq-|z| endif if j>=#maxiter found=true ldir2=-1 endif endif zsub=zsub/2 csub=csub/2 until subdiv==26 if found==true if @exitz==0 || @exitz==2 z=zt-z1 c=ct-cc1 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout t=j+lb-il2*log(log(|z|)/2) z=zt+z1 c=ct+cc1 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout v=j+lb-il2*log(log(|z|)/2)-t z=zt-z2 c=ct-cc2 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout t=j+lb-il2*log(log(|z|)/2) z=zt+z2 c=ct+cc2 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout v1=j+lb-il2*log(log(|z|)/2)-t z=zt-z3 c=ct-cc3 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout t=j+lb-il2*log(log(|z|)/2) z=zt+z3 c=ct+cc3 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout v2=j+lb-il2*log(log(|z|)/2)-t l=(1.0+v2/sqrt(v*v+v1*v1+v2*v2)) \ /2.0 if l<0 l=0 elseif l>0.9975 l=0.9975 endif endif if @exitz==1 || @exitz==2 t=atan2(w) if (t<0) t=t+#pi*2 endif t=t/(#pi*2) if t<0 t=0 elseif t>0.9975 t=0.9975 endif endif if @exitz==2 l=l+(t-0.5)/20 if l<0 l=0 elseif l>0.9975 l=0.9975 endif endif endif endif endif ldir=ldir1 i=i-1 until i<=0 || found==true else found=true t=0 l=0 endif else found=true t=0 l=0 endif loop: if @exitz==0 || @exitz==2 z=l else z=t endif bailout: found==false default: title = "Mandelbrot 3D" helpfile = "MMF.html" center = (-1.25, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 10 param start caption = "Starting point" default = (-4,0) hint = "Camera Zstart co-ordinates" endparam param f caption = "Field of view" default = 4.0 min = 0.1 endparam param view caption = "Viewing range" default = 6.0 min = 0.1 endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out \ i.e. doesn't belong to the \ Mandelbrot set anymore." endparam param detail caption = "Detail level" default = 100.0 min = 1.0 hint = "Higher values produce more accuracy" endparam param exitz caption = "Colouring" enum = "Lighting" "Atan" "Mixed" default = 2 hint = "Sets value for MMF colouring." endparam param solid caption = "Solid condition" enum = "Max iteration" "Direction change" default = 0 hint = "Direction change colours more and \ works faster." endparam param angle1 caption = "Rot 1 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Creal,Cimag \ around the Zstart axis." endparam param angle2 caption = "Rot 2 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Cimag,Zstart \ around the Creal axis." endparam param angle3 caption = "Rot 3 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Creal,Zstart \ around the Cimag axis." endparam param angle4 caption = "Rot 4(degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Angle of the line in the plane \ of Zstart, used as the third axis. \ 0=Zstartreal, 90=Zstartimag" endparam param light caption = "Directional lighting" enum = "Off" "On" default = 0 hint = "If on then the object is lit by a \ light source independant of the \ 'camera' position." endparam param light1 caption = "Light 1 (degrees)" default = 0.0 min = -90.0 max = 90.0 hint = "Independant light elevation." endparam param light2 caption = "Light 2 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Independant light direction." endparam } MMFi-Mandelbrot { ; Two Cube Family ; This allows you to select any member of the ; Two Cube family. ; For Iteration smoothing set the exponent to ; (3, 0) init: z = @start float x = real(z) float y = imag(z) float a = x float b = y float t = x float c = real(#pixel) float d = imag(#pixel) loop: a = x*x*x b = 3*x*x*y t = 3*x*y*y y = y*y*y if @xxxx>0 x = -a else x = a endif if @xxxy>0 x = x - b else x = x + b endif if @xxyy>0 x = x - t else x = x + t endif if @xyyy>0 x = x - y + c else x = x + y + c endif if @yyyy>0 y = -y endif if @yxxx>0 y = y - a else y = y + a endif if @yxxy>0 y = y - b else y = y + b endif if @yxyy>0 y = y - t + d else y = y + t + d endif z = x + flip(y) bailout: |z| <= @bailout default: title = "Two Cube Family, Mandelbrot" center = (0, 0) helpfile = "MMF.html" param start caption = "Starting point" default = (0,0) hint = "Perturbation of start Z, use to deform the fractal." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param xxxx caption = "Sign of x*x*x (real)" enum = "+ x*x*x" "- x*x*x" default = 0 endparam param xxxy caption = "Sign of 3*x*x*y (real)" enum = "+ 3*x*x*y" "- 3*x*x*y" default = 0 endparam param xxyy caption = "Sign of 3*x*y*y (real)" enum = "+ 3*x*y*y" "- 3*x*y*y" default = 1 endparam param xyyy caption = "Sign of y*y*y (real)" enum = "+ y*y*y" "- y*y*y" default = 1 endparam param yxxx caption = "Sign of x*x*x (imag)" enum = "+ x*x*x" "- x*x*x" default = 0 endparam param yxxy caption = "Sign of 3*x*x*y (imag)" enum = "+ 3*x*x*y" "- 3*x*x*y" default = 1 endparam param yxyy caption = "Sign of 3*x*y*y (imag)" enum = "+ 3*x*y*y" "- 3*x*y*y" default = 1 endparam param yyyy caption = "Sign of y*y*y (imag)" enum = "+ y*y*y" "- y*y*y" default = 0 endparam switch: type = "MMFi-Julia" seed = #pixel bailout = bailout xxxx = xxxx xxxy = xxxy xxyy = xxyy xyyy = xyyy yxxx = yxxx yxxy = yxxy yxyy = yxyy yyyy = yyyy } MMFi-Julia { ; Two Cube Family ; This allows you to select any member of the ; Two Cube family. ; For Iteration smoothing set the exponent to ; (2.1, 0) init: z = #pixel float x = real(z) float y = imag(z) float a = x float b = y float t = x float c = real(@seed) float d = imag(@seed) loop: a = x*x*x b = 3*x*x*y t = 3*x*y*y y = y*y*y if @xxxx>0 x = -a else x = a endif if @xxxy>0 x = x - b else x = x + b endif if @xxyy>0 x = x - t else x = x + t endif if @xyyy>0 x = x - y + c else x = x + y + c endif if @yyyy>0 y = -y endif if @yxxx>0 y = y - a else y = y + a endif if @yxxy>0 y = y - b else y = y + b endif if @yxyy>0 y = y - t + d else y = y + t + d endif z = x + flip(y) bailout: |z| <= @bailout default: title = "Two Cube Family, Julia" center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (-0.43125, -0.475) hint = "Use this to create many different Julia sets. You can \ also set this value using the Switch feature." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param xxxx caption = "Sign of x*x*x (real)" enum = "+ x*x*x" "- x*x*x" default = 0 endparam param xxxy caption = "Sign of 3*x*x*y (real)" enum = "+ 3*x*x*y" "- 3*x*x*y" default = 0 endparam param xxyy caption = "Sign of 3*x*y*y (real)" enum = "+ 3*x*y*y" "- 3*x*y*y" default = 1 endparam param xyyy caption = "Sign of y*y*y (real)" enum = "+ y*y*y" "- y*y*y" default = 1 endparam param yxxx caption = "Sign of x*x*x (imag)" enum = "+ x*x*x" "- x*x*x" default = 0 endparam param yxxy caption = "Sign of 3*x*x*y (imag)" enum = "+ 3*x*x*y" "- 3*x*x*y" default = 1 endparam param yxyy caption = "Sign of 3*x*y*y (imag)" enum = "+ 3*x*y*y" "- 3*x*y*y" default = 1 endparam param yyyy caption = "Sign of y*y*y (imag)" enum = "+ y*y*y" "- y*y*y" default = 0 endparam switch: type = "MMFi-Mandelbrot" bailout = bailout xxxx = xxxx xxxy = xxxy xxyy = xxyy xyyy = xyyy yxxx = yxxx yxxy = yxxy yxyy = yxyy yyyy = yyyy } MMFj-M3D { ; ; Truly 3D fractal - 3 function iteration ! ; Requires the MMF "3D" outside colouring mode ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; http://skyscraper.fortunecity.com/terabyte/966/ ; 8th & 9th December 1999 ; init: float il2 = 1/log(2) float lb = il2*log(log(@bailout)) float a=#pi/180.0 float a1=a*@angle1 float a2=a*@angle2 float a3=a*@angle3 float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float c3=cos(a3) float s3=sin(a3) float m1r0c1=s1*c2 float m1r1c1=c1*c2 float m1r2c0=c2*s3 float m1r2c1=-s2 float m1r2c2=c2*c3 float t1=s1*s3 float t2=s1*c3 float t3=c1*s3 float t4=c1*c3 float m1r0c0=t1*s2+t4 float m1r0c2=t2*s2-t3 float m1r1c0=t3*s2-t2 float m1r1c2=t4*s2-t1 if @light==1 a1=a*@light1 a2=a*@light2 c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) float r0c0=c2 float r0c1=s1*s2 float r0c2=-c1*s2 float r1c0=0 float r1c1=c1 float r1c2=s1 float r2c0=s2 float r2c1=-s1*c2 float r2c2=c1*c2 endif float x=real(#pixel)-real(#center) float y=imag(#pixel)-imag(#center) float zz=0 float xs=(x*m1r0c0+y*m1r1c0+@f*m1r2c0)/@detail float ys=(x*m1r0c1+y*m1r1c1+@f*m1r2c1)/@detail float zs=(x*m1r0c2+y*m1r1c2+@f*m1r2c2)/@detail float xsub=xs/2.0 float ysub=ys/2.0 float zsub=zs/2.0 float xc=@xstart float yc=@ystart float zc=@zstart float cx=0 float cy=0 float cz=0 float xt=0 float yt=0 float zt=0 int subdiv=0 float ldir=0 float ldir1=0 float ldir2=0 float t=0 float v=0 float v1=0 float v2=0 float l=0 bool found=false float i=0.5+@detail*@view/@f v=1.0/(65536.0*65536.0*4096.0) if @light==0 float z1=v*m1r0c2 float x1=v*m1r0c0 float y1=v*m1r0c1 float z2=v*m1r1c2 float x2=v*m1r1c0 float y2=v*m1r1c1 float z3=v*m1r2c2 float x3=v*m1r2c0 float y3=v*m1r2c1 else float z1=v*r0c2 float x1=v*r0c0 float y1=v*r0c1 float z2=v*r1c2 float x2=v*r1c0 float y2=v*r1c1 float z3=v*r2c2 float x3=v*r2c0 float y3=v*r2c1 endif float x=@defx float y=@defy float zz=@defz float sq=0 float lsq=0 float t1=0 float t2=0 int j=0 int k=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+xc t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+yc zz=@xyz*t1*t2*zz+zc sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || sq>@bailout if j<#maxiter k=j lsq=sq cx=xc+xs/65536.0 cy=yc+ys/65536.0 cz=zc+zs/65536.0 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || sq>@bailout if j<#maxiter ldir=j-k if ldir==0 ldir=lsq-sq endif repeat xc=xc+xs yc=yc+ys zc=zc+zs x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+xc t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+yc zz=@xyz*t1*t2*zz+zc sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || \ sq>@bailout k=j lsq=sq if j>=#maxiter found=true ldir1=-1 xt=xc yt=yc zt=zc else cx=xc+xs/65536.0 cy=yc+ys/65536.0 cz=zc+zs/65536.0 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || \ sq>@bailout ldir1=j-k if ldir1==0 ldir1=lsq-sq endif xt=xc yt=yc zt=zc if j>=#maxiter found=true ldir1=-1 xt=xc+xs/65536.0 yt=yc+ys/65536.0 zt=zc+zs/65536.0 endif endif if ldir>0 || found if ldir1<0 || found if @solid==1 found=true endif ldir2=ldir1 xsub=xs/2.0 ysub=ys/2.0 zsub=zs/2.0 subdiv=0 repeat subdiv=subdiv+1 if ldir2<0 xt=xt-xsub yt=yt-ysub zt=zt-zsub else xt=xt+xsub yt=yt+ysub zt=zt+zsub endif x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+xt t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+yt zz=@xyz*t1*t2*zz+zt sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || \ sq>@bailout k=j lsq=sq if j>=#maxiter found=true ldir2=-1 else cx=xt+xs/65536.0 cy=yt+ys/65536.0 cz=zt+zs/65536.0 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz \ +cy zz=@xyz*t1*t2*zz+cz sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || \ sq>@bailout ldir2=j-k if ldir2==0 ldir2=lsq-sq endif if j>=#maxiter found=true ldir2=-1 endif endif xsub=xsub/2 ysub=ysub/2 zsub=zsub/2 until subdiv==26 if found==true cx=xt-x1 cy=yt-y1 cz=zt-z1 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout t=j+lb-il2*log(log(x*x+y*y+zz*zz)/2) cx=xt+x1 cy=yt+y1 cz=zt+z1 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout v=j+lb-il2* \ log(log(x*x+y*y+zz*zz)/2)-t cx=xt-x2 cy=yt-y2 cz=zt-z2 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout t=j+lb-il2*log(log(x*x+y*y+zz*zz)/2) cx=xt+x2 cy=yt+y2 cz=zt+z2 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout v1=j+lb-il2* \ log(log(x*x+y*y+zz*zz)/2)-t cx=xt-x3 cy=yt-y3 cz=zt-z3 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout t=j+lb-il2*log(log(x*x+y*y+zz*zz)/2) cx=xt+x3 cy=yt+y3 cz=zt+z3 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout v2=j+lb-il2* \ log(log(x*x+y*y+zz*zz)/2)-t l=(1.0+v2/sqrt(v*v+v1*v1+v2*v2))/2.0 if l<0 l=0 elseif l>0.9975 l=0.9975 endif endif endif endif ldir=ldir1 i=i-1 until i<=0 || found==true else found=true l=0 endif else found=true l=0 endif loop: z=l bailout: found==false default: title = "M-type true 3D" center = (0, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 5 helpfile = "MMF.html" param xstart caption = "Camera X" default = -0.5 hint = "Camera X co-ordinate" endparam param ystart caption = "Camera Y" default = -0.15 hint = "Camera Y co-ordinate" endparam param zstart caption = "Camera Z" default = -6.5 hint = "Camera Z co-ordinate" endparam param defx caption = "Perturbation of Xstart" default = 0.0 hint = "Modify to deform the fractal" endparam param defy caption = "Perturbation of Ystart" default = 0.0 hint = "Modify to deform the fractal" endparam param defz caption = "Perturbation of Zstart" default = 0.0 hint = "Modify to deform the fractal" endparam param xx caption = "Coefficient of X*X" default = 1.0 hint = "Value of a in a*X*X+b*Y*Y+c*Z*Z \ for the new X term in the iterations." endparam param yy caption = "Coefficient of Y*Y" default = -1.0 hint = "Value of b in a*X*X+b*Y*Y+c*Z*Z \ for the new X term in the iterations." endparam param zz caption = "Coefficient of Z*Z" default = 1.0 hint = "Value of c in a*X*X+b*Y*Y+c*Z*Z \ for the new X term in the iterations." endparam param xy caption = "Coefficient of X*Y" default = 2.0 hint = "Value of a in a*X*Y+b*X*Z+c*Y*Z \ for the new Y term in the iterations." endparam param xz caption = "Coefficient of X*Z" default = -2.0 hint = "Value of b in a*X*Y+b*X*Z+c*Y*Z \ for the new Y term in the iterations." endparam param yz caption = "Coefficient of Y*Z" default = -2.0 hint = "Value of c in a*X*Y+b*X*Z+c*Y*Z \ for the new Y term in the iterations." endparam param xyz caption = "Coefficient of X*Y*Z" default = 6.0 hint = "Value of a in a*X*Y*Z \ for the new Z term in the iterations." endparam param f caption = "Field of view" default = 4.0 min = 0.1 endparam param view caption = "Viewing range" default = 9.0 min = 0.1 endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out \ for the 'solid' test." endparam param detail caption = "Detail level" default = 250.0 min = 1.0 hint = "Higher values produce more accuracy" endparam param solid caption = "Solid condition" enum = "Max iteration" "Direction change" default = 0 hint = "Direction change colours more and \ works faster." endparam param angle1 caption = "Rot 1 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of X,Y \ around the Z axis." endparam param angle2 caption = "Rot 2 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Y, Z \ around the X axis." endparam param angle3 caption = "Rot 3 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of X, Z \ around the Y axis." endparam param light caption = "Directional lighting" enum = "Off" "On" default = 0 hint = "If on then the object is lit by a \ light source independant of the \ 'camera' position." endparam param light1 caption = "Light 1 (degrees)" default = 0.0 min = -90.0 max = 90.0 hint = "Independant light elevation." endparam param light2 caption = "Light 2 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Independant light direction." endparam } MMFk-M3D-userfriendly { ; ; Standard Mandelbrot set in 3D ; Requires the MMF "3D" outside colouring mode ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; http://skyscraper.fortunecity.com/terabyte/966/ ; 22nd December 1999 ; init: float il2 = 1/log(2) float lb = il2*log(log(@bailout)) float a=#pi/180.0 float a1=a*@angle1 float a2=a*@angle2 float a3=a*@angle3 float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float c3=cos(a3) float s3=sin(a3) float m1r0c1=s1*c2 float m1r1c1=c1*c2 float m1r2c0=c2*s3 float m1r2c1=-s2 float m1r2c2=c2*c3 float t1=s1*s3 float t2=s1*c3 float t3=c1*s3 float t4=c1*c3 float m1r0c0=t1*s2+t4 float m1r0c2=t2*s2-t3 float m1r1c0=t3*s2-t2 float m1r1c2=t4*s2-t1 if @light==1 a1=a*@light1 a2=a*@light2 c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) float r0c0=c2 float r0c1=s1*s2 float r0c2=-c1*s2 float r1c0=0 float r1c1=c1 float r1c2=s1 float r2c0=s2 float r2c1=-s1*c2 float r2c2=c1*c2 endif float a=a*@angle4 cc=@tx-@r*m1r2c0+flip(@ty-@r*m1r2c1) zc=(@tz-@r*m1r2c2)*cos(a)+ \ flip((@tz-@r*m1r2c2)*sin(a)) float x=0.25*(real(#pixel)-real(#center)) \ *#magn float y=0.25*(imag(#pixel)-imag(#center)) \ *#magn cs=(x*m1r0c0+y*m1r1c0+@f*m1r2c0 \ +flip(x*m1r0c1+y*m1r1c1+@f*m1r2c1))/@detail b=(x*m1r0c2+y*m1r1c2+@f*m1r2c2)/@detail zs=b*cos(a)+flip(b*sin(a)) csub=cs/2.0 zsub=zs/2.0 zt=zc ct=cc int subdiv=0 float ldir=0 float ldir1=0 float ldir2=0 float t=0 float v=0 float v1=0 float v2=0 float l=0 w=zt bool found=false float i=0.5+@detail*@view/@f if @exitz==0 || @exitz==2 || @exitz==4 v=1.0/(65536.0*65536.0*4096.0) if @light==0 z1=v*m1r0c2*cos(a)+flip(v*m1r0c2*sin(a)) cc1=v*m1r0c0+flip(v*m1r0c1) z2=v*m1r1c2*cos(a)+flip(v*m1r1c2*sin(a)) cc2=v*m1r1c0+flip(v*m1r1c1) z3=v*m1r2c2*cos(a)+flip(v*m1r2c2*sin(a)) cc3=v*m1r2c0+flip(v*m1r2c1) else z1=v*r0c2*cos(a)+flip(v*r0c2*sin(a)) cc1=v*r0c0+flip(v*r0c1) z2=v*r1c2*cos(a)+flip(v*r1c2*sin(a)) cc2=v*r1c0+flip(v*r1c1) z3=v*r2c2*cos(a)+flip(v*r2c2*sin(a)) cc3=v*r2c0+flip(v*r2c1) endif endif z=zc float lsq=0 int j=0 int k=0 repeat z=z*z+cc j=j+1 until j>=#maxiter || |z|>@bailout if j<#maxiter k=j lsq=|z| z=zc+zs/65536.0 c=cc+cs/65536.0 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout if j<#maxiter ldir=j-k if ldir==0 ldir=lsq-|z| endif repeat zc=zc+zs cc=cc+cs j=0 z=zc repeat z=z*z+cc j=j+1 until j>=#maxiter || |z|>@bailout k=j lsq=|z| w=z if j>=#maxiter found=true ldir1=-1 zt=zc ct=cc else z=zc+zs/65536.0 c=cc+cs/65536.0 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout ldir1=j-k if ldir1==0 ldir1=lsq-|z| endif zt=zc ct=cc if j>=#maxiter found=true ldir1=-1 zt=zc+zs/65536.0 ct=cc+cs/65536.0 endif endif if ldir>0 || found if ldir1<0 || found if @solid==1 found=true endif ldir2=ldir1 zsub=zs/2.0 csub=cs/2.0 subdiv=0 repeat subdiv=subdiv+1 if ldir2<0 zt=zt-zsub ct=ct-csub else zt=zt+zsub ct=ct+csub endif z=zt j=0 repeat z=z*z+ct j=j+1 until j>=#maxiter || |z|>@bailout k=j lsq=|z| w=z if j>=#maxiter found=true ldir2=-1 else z=zt+zs/65536.0 c=ct+cs/65536.0 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout ldir2=j-k if ldir2==0 ldir2=lsq-|z| endif if j>=#maxiter found=true ldir2=-1 endif endif zsub=zsub/2 csub=csub/2 until subdiv==26 if found==true if @exitz==0 || @exitz==2 || @exitz==4 z=zt-z1 c=ct-cc1 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout t=j+lb-il2*log(log(|z|)/2) z=zt+z1 c=ct+cc1 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout v=j+lb-il2*log(log(|z|)/2)-t z=zt-z2 c=ct-cc2 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout t=j+lb-il2*log(log(|z|)/2) z=zt+z2 c=ct+cc2 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout v1=j+lb-il2*log(log(|z|)/2)-t z=zt-z3 c=ct-cc3 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout t=j+lb-il2*log(log(|z|)/2) z=zt+z3 c=ct+cc3 j=0 repeat z=z*z+c j=j+1 until j>=#maxiter || |z|>@bailout v2=j+lb-il2*log(log(|z|)/2)-t l=(1.0+v2/sqrt(v*v+v1*v1+v2*v2)) \ /2.0 if l<0 l=0 else if @exitz==0 || @exitz==2 if l>0.9975 l=0.9975 endif else if l>1.0 l=1.0 endif endif endif endif if @exitz==1 || @exitz==2 t=atan2(w) if (t<0) t=t+#pi*2 endif t=t/(#pi*2) if t<0 t=0 elseif t>0.9975 t=0.9975 endif endif if @exitz==2 l=l+(t-0.5)/20 if l<0 l=0 elseif l>0.9975 l=0.9975 endif endif if @exitz==3 || @exitz==4 z=zt j=0 repeat z=z*z+ct if j==0 t=|z| elseif |z|=#maxiter || |z|>@bailout if @exitz==3 l=t else l=2*(l-0.5) if l<0 l=0 endif l=l/(400)+(200*(t%1)-(200*(t%1))%1)/200 endif endif endif endif endif ldir=ldir1 i=i-1 until i<=0 || found==true else found=true t=0 l=0 endif else found=true t=0 l=0 endif loop: if @exitz==0 || @exitz==2 || @exitz==3 || @exitz==4 z=l else z=t endif bailout: found==false default: title = "M3D-userfriendly" helpfile = "MMF.html" center = (0, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 10 helpfile = "MMF.html" param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out \ i.e. doesn't belong to the \ Mandelbrot set anymore." endparam param tx caption = "Target Xcoord" default = -1.2 endparam param ty caption = "Target Ycoord" default = 0.0 endparam param tz caption = "Target Zcoord" default = 0.0 endparam param f caption = "Field of view" default = 1.0 min = 0.1 hint = "Use to modify the perspective. \ Values <1 produce 'wide-angle'." endparam param r caption = "Distance to target" default = 3.75 min = 0.1 hint = "Use to pan the camera." endparam param view caption = "Viewing range" default = 7.0 min = 0.1 hint = "This is the maximum distance to \ scan from the camera." endparam param detail caption = "Detail level" default = 100.0 min = 1.0 hint = "Higher values produce more accuracy" endparam param exitz caption = "Colouring" enum = "Lighting" "Atan" "Mixed" "BoF60" "BoFshaded" default = 2 hint = "Sets value for MMF colouring." endparam param solid caption = "Solid condition" enum = "Max iteration" "Direction change" default = 0 hint = "Direction change colours more and \ works faster." endparam param angle1 caption = "Z Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Creal,Cimag \ around the Zstart axis. \ (roll)" endparam param angle2 caption = "X Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Cimag,Zstart \ around the Creal axis. \ (elevation)" endparam param angle3 caption = "Y Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Creal,Zstart \ around the Cimag axis. \ (direction)" endparam param angle4 caption = "Zstart Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Angle of the line in the plane \ of Zstart, used as the third axis. \ 0=Zstartreal, 90=Zstartimag" endparam param light caption = "Directional lighting" enum = "Off" "On" default = 0 hint = "If on then the object is lit by a \ light source independant of the \ 'camera' position." endparam param light1 caption = "Light 1 (degrees)" default = 0.0 min = -90.0 max = 90.0 hint = "Independant light elevation." endparam param light2 caption = "Light 2 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Independant light direction." endparam } MMFl-Mtrue3d-userfriendly { ; ; Truly 3D fractal - 3 function iteration ! ; Requires the MMF "3D" outside colouring mode ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; http://skyscraper.fortunecity.com/terabyte/966/ ; 3rd January 2000 ; init: float il2 = 1/log(2) float lb = il2*log(log(@bailout)) float a=#pi/180.0 float a1=a*@angle1 float a2=a*@angle2 float a3=a*@angle3 float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float c3=cos(a3) float s3=sin(a3) float m1r0c1=s1*c2 float m1r1c1=c1*c2 float m1r2c0=c2*s3 float m1r2c1=-s2 float m1r2c2=c2*c3 float t1=s1*s3 float t2=s1*c3 float t3=c1*s3 float t4=c1*c3 float m1r0c0=t1*s2+t4 float m1r0c2=t2*s2-t3 float m1r1c0=t3*s2-t2 float m1r1c2=t4*s2-t1 if @light==1 a1=a*@light1 a2=a*@light2 c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) float r0c0=c2 float r0c1=s1*s2 float r0c2=-c1*s2 float r1c0=0 float r1c1=c1 float r1c2=s1 float r2c0=s2 float r2c1=-s1*c2 float r2c2=c1*c2 endif float xc=@tx-@r*m1r2c0 float yc=@ty-@r*m1r2c1 float zc=@tz-@r*m1r2c2 float x=0.25*(real(#pixel)-real(#center)) \ *#magn float y=0.25*(imag(#pixel)-imag(#center)) \ *#magn float zz=0 float xs=(x*m1r0c0+y*m1r1c0+@f*m1r2c0)/@detail float ys=(x*m1r0c1+y*m1r1c1+@f*m1r2c1)/@detail float zs=(x*m1r0c2+y*m1r1c2+@f*m1r2c2)/@detail float xsub=xs/2.0 float ysub=ys/2.0 float zsub=zs/2.0 float cx=0 float cy=0 float cz=0 float xt=0 float yt=0 float zt=0 int subdiv=0 float ldir=0 float ldir1=0 float ldir2=0 float t=0 float v=0 float v1=0 float v2=0 float l=0 bool found=false float i=0.5+@detail*@view/@f if @exitz==0 v=1.0/(65536.0*65536.0*4096.0) if @light==0 float z1=v*m1r0c2 float x1=v*m1r0c0 float y1=v*m1r0c1 float z2=v*m1r1c2 float x2=v*m1r1c0 float y2=v*m1r1c1 float z3=v*m1r2c2 float x3=v*m1r2c0 float y3=v*m1r2c1 else float z1=v*r0c2 float x1=v*r0c0 float y1=v*r0c1 float z2=v*r1c2 float x2=v*r1c0 float y2=v*r1c1 float z3=v*r2c2 float x3=v*r2c0 float y3=v*r2c1 endif endif float x=@defx float y=@defy float zz=@defz float t1=0 float t2=0 float sq=0 float lsq=0 int j=0 int k=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+xc t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+yc zz=@xyz*t1*t2*zz+zc sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || sq>@bailout if j<#maxiter k=j lsq=sq cx=xc+xs/65536.0 cy=yc+ys/65536.0 cz=zc+zs/65536.0 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || sq>@bailout if j<#maxiter ldir=j-k if ldir==0 ldir=lsq-sq endif repeat xc=xc+xs yc=yc+ys zc=zc+zs x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+xc t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+yc zz=@xyz*t1*t2*zz+zc sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || \ sq>@bailout k=j lsq=sq if j>=#maxiter found=true ldir1=-1 xt=xc yt=yc zt=zc else cx=xc+xs/65536.0 cy=yc+ys/65536.0 cz=zc+zs/65536.0 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || \ sq>@bailout ldir1=j-k if ldir1==0 ldir1=lsq-sq endif xt=xc yt=yc zt=zc if j>=#maxiter found=true ldir1=-1 xt=xc+xs/65536.0 yt=yc+ys/65536.0 zt=zc+zs/65536.0 endif endif if ldir>0 || found if ldir1<0 || found if @solid==1 found=true endif ldir2=ldir1 xsub=xs/2.0 ysub=ys/2.0 zsub=zs/2.0 subdiv=0 repeat subdiv=subdiv+1 if ldir2<0 xt=xt-xsub yt=yt-ysub zt=zt-zsub else xt=xt+xsub yt=yt+ysub zt=zt+zsub endif x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+xt t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+yt zz=@xyz*t1*t2*zz+zt s=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || \ sq>@bailout k=j lsq=sq if j>=#maxiter found=true ldir2=-1 else cx=xt+xs/65536.0 cy=yt+ys/65536.0 cz=zt+zs/65536.0 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz \ +cy zz=@xyz*t1*t2*zz+cz sq=x*x+y*y+zz*zz j=j+1 until j>=#maxiter || \ sq>@bailout ldir2=j-k if ldir2==0 ldir2=lsq-sq endif if j>=#maxiter found=true ldir2=-1 endif endif xsub=xsub/2 ysub=ysub/2 zsub=zsub/2 until subdiv==26 if found==true if @exitz==0 cx=xt-x1 cy=yt-y1 cz=zt-z1 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout t=j+lb-il2*log(log(x*x+y*y+zz*zz)/2) cx=xt+x1 cy=yt+y1 cz=zt+z1 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout v=j+lb-il2* \ log(log(x*x+y*y+zz*zz)/2)-t cx=xt-x2 cy=yt-y2 cz=zt-z2 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout t=j+lb-il2*log(log(x*x+y*y+zz*zz)/2) cx=xt+x2 cy=yt+y2 cz=zt+z2 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout v1=j+lb-il2* \ log(log(x*x+y*y+zz*zz)/2)-t cx=xt-x3 cy=yt-y3 cz=zt-z3 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout t=j+lb-il2*log(log(x*x+y*y+zz*zz)/2) cx=xt+x3 cy=yt+y3 cz=zt+z3 x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz j=j+1 until j>=#maxiter || \ x*x+y*y+zz*zz>@bailout v2=j+lb-il2* \ log(log(x*x+y*y+zz*zz)/2)-t l=(1.0+v2/sqrt(v*v+v1*v1+v2*v2))/2.0 if l<0 l=0 elseif l>0.9975 l=0.9975 endif else cx=xt cy=yt cz=zt x=@defx y=@defy zz=@defz j=0 repeat t1=x x=@xx*x*x+@yy*y*y+@zz*zz*zz+cx t2=y y=@xy*t1*y+@xz*t1*zz+@yz*y*zz+cy zz=@xyz*t1*t2*zz+cz if j==0 l=x*x+y*y+zz*zz elseif x*x+y*y+zz*zz=#maxiter || \ x*x+y*y+zz*zz>@bailout endif endif endif endif ldir=ldir1 i=i-1 until i<=0 || found==true else found=true l=0 endif else found=true l=0 endif loop: z=l bailout: found==false default: title = "M-true3D userfriendly" center = (0, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 5 helpfile = "MMF.html" param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out \ i.e. doesn't belong to the \ 'Mandelbrot' set anymore." endparam param tx caption = "Target Xcoord" default = -0.5 endparam param ty caption = "Target Ycoord" default = 0.0 endparam param tz caption = "Target Zcoord" default = 0.0 endparam param defx caption = "Perturbation of Xstart" default = 0.0 hint = "Modify to deform the fractal" endparam param defy caption = "Perturbation of Ystart" default = 0.0 hint = "Modify to deform the fractal" endparam param defz caption = "Perturbation of Zstart" default = 0.0 hint = "Modify to deform the fractal" endparam param xx caption = "Coefficient of X*X" default = 1.0 hint = "Value of a in a*X*X+b*Y*Y+c*Z*Z \ for the new X term in the iterations." endparam param yy caption = "Coefficient of Y*Y" default = -1.0 hint = "Value of b in a*X*X+b*Y*Y+c*Z*Z \ for the new X term in the iterations." endparam param zz caption = "Coefficient of Z*Z" default = 1.0 hint = "Value of c in a*X*X+b*Y*Y+c*Z*Z \ for the new X term in the iterations." endparam param xy caption = "Coefficient of X*Y" default = 2.0 hint = "Value of a in a*X*Y+b*X*Z+c*Y*Z \ for the new Y term in the iterations." endparam param xz caption = "Coefficient of X*Z" default = -2.0 hint = "Value of b in a*X*Y+b*X*Z+c*Y*Z \ for the new Y term in the iterations." endparam param yz caption = "Coefficient of Y*Z" default = -2.0 hint = "Value of c in a*X*Y+b*X*Z+c*Y*Z \ for the new Y term in the iterations." endparam param xyz caption = "Coefficient of X*Y*Z" default = 6.0 hint = "Value of a in a*X*Y*Z \ for the new Z term in the iterations." endparam param f caption = "Field of view" default = 1.0 min = 0.1 hint = "Use to modify the perspective. \ Values <1 produce 'wide-angle'." endparam param r caption = "Distance to target" default = 5.5 min = 0.1 hint = "Use to pan the camera." endparam param view caption = "Viewing range" default = 7.0 min = 0.1 hint = "This is the maximum distance to \ scan from the camera." endparam param detail caption = "Detail level" default = 100.0 min = 1.0 hint = "Higher values produce more accuracy" endparam param exitz caption = "Colouring" enum = "Lighting" "BoF60" default = 0 hint = "Sets value for MMF colouring." endparam param solid caption = "Solid condition" enum = "Max iteration" "Direction change" default = 0 hint = "Direction change colours more and \ works faster." endparam param angle1 caption = "Z Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of X,Y \ around the Z axis." endparam param angle2 caption = "X Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Y, Z \ around the X axis." endparam param angle3 caption = "Y Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of X, Z \ around the Y axis." endparam param light caption = "Directional lighting" enum = "Off" "On" default = 0 hint = "If on then the object is lit by a \ light source independant of the \ 'camera' position." endparam param light1 caption = "Light 1 (degrees)" default = 0.0 min = -90.0 max = 90.0 hint = "Independant light elevation." endparam param light2 caption = "Light 2 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Independant light direction." endparam } MMFm-J3D-Quaternion1 { ; ; Standard Quaternion Julia sets in 3D ; Requires the MMF "3D" outside colouring mode ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; http://skyscraper.fortunecity.com/terabyte/966/ ; 17th February 2000 ; init: float il2 = 1/log(2) float lb = il2*log(log(@bailout)) float a=#pi/180.0 float a1=a*@angle1 float a2=a*@angle2 float a3=a*@angle3 float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float c3=cos(a3) float s3=sin(a3) float m1r0c1=s1*c2 float m1r1c1=c1*c2 float m1r2c0=c2*s3 float m1r2c1=-s2 float m1r2c2=c2*c3 float t1=s1*s3 float t2=s1*c3 float t3=c1*s3 float t4=c1*c3 float m1r0c0=t1*s2+t4 float m1r0c2=t2*s2-t3 float m1r1c0=t3*s2-t2 float m1r1c2=t4*s2-t1 if @light==1 a1=a*@light1 a2=a*@light2 c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) float r0c0=c2 float r0c1=s1*s2 float r0c2=-c1*s2 float r1c0=0 float r1c1=c1 float r1c2=s1 float r2c0=s2 float r2c1=-s1*c2 float r2c2=c1*c2 endif float a=a*@angle4 float xc=@tx-@r*m1r2c0 float yc=@ty-@r*m1r2c1 float zc=(@tz-@r*m1r2c2)*cos(a) float wc=(@tz-@r*m1r2c2)*sin(a) float x=0.25*(real(#pixel)-real(#center)) \ *#magn float y=0.25*(imag(#pixel)-imag(#center)) \ *#magn float xs=(x*m1r0c0+y*m1r1c0+@f*m1r2c0)/@detail float ys=(x*m1r0c1+y*m1r1c1+@f*m1r2c1)/@detail float b=(x*m1r0c2+y*m1r1c2+@f*m1r2c2)/@detail float zs=b*cos(a) float ws=b*sin(a) float xsub=xs/2.0 float ysub=ys/2.0 float zsub=zs/2.0 float wsub=ws/2.0 float xt=xc float yt=yc float zt=zc float wt=wc float xi=0 float sq=0 float xw=0 float yw=0 float zw=0 float ww=0 float zz=0 int subdiv=0 float ldir=0 float ldir1=0 float ldir2=0 float t=0 float v=0 float v1=0 float v2=0 float l=0 bool found=false float i=0.5+@detail*@view/@f if @exitz==0 || @exitz==2 || @exitz==4 v=1.0/(65536.0*65536.0*4096.0) if @light==0 float z1=v*m1r0c2*cos(a) float w1=v*m1r0c2*sin(a) float x1=v*m1r0c0 float y1=v*m1r0c1 float z2=v*m1r1c2*cos(a) float w2=v*m1r1c2*sin(a) float x2=v*m1r1c0 float y2=v*m1r1c1 float z3=v*m1r2c2*cos(a) float w3=v*m1r2c2*sin(a) float x3=v*m1r2c0 float y3=v*m1r2c1 else float z1=v*r0c2*cos(a) float w1=v*r0c2*sin(a) float x1=v*r0c0 float y1=v*r0c1 float z2=v*r1c2*cos(a) float w2=v*r1c2*sin(a) float x2=v*r1c0 float y2=v*r1c1 float z3=v*r2c2*cos(a) float w3=v*r2c2*sin(a) float x3=v*r2c0 float y3=v*r2c1 endif endif x=xc y=yc zz=zc float w=wc int j=0 int k=0 float lsq=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout if j<#maxiter k=j lsq=sq x=xc+xs/65536.0 y=yc+ys/65536.0 zz=zc+zs/65536.0 w=wc+ws/65536.0 j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout if j<#maxiter ldir=j-k if ldir==0 ldir=lsq-sq endif repeat xc=xc+xs yc=yc+ys zc=zc+zs wc=wc+ws j=0 x=xc y=yc zz=zc w=wc repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout k=j lsq=sq xw=x yw=y zw=zz ww=w if j>=#maxiter found=true ldir1=-1 xt=xc yt=yc zt=zc wt=wc else x=xc+xs/65536.0 y=yc+ys/65536.0 zz=zc+zs/65536.0 w=wc+ws/65536.0 j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout ldir1=j-k if ldir1==0 ldir1=lsq-sq endif xt=xc yt=yc zt=zc wt=wc if j>=#maxiter found=true ldir1=-1 xt=xc+xs/65536.0 yt=yc+ys/65536.0 zt=zc+zs/65536.0 wt=wc+ws/65536.0 endif endif if ldir>0 || found if ldir1<0 || found if @solid==1 found=true endif ldir2=ldir1 xsub=xs/2.0 ysub=ys/2.0 zsub=zs/2.0 wsub=ws/2.0 subdiv=0 repeat subdiv=subdiv+1 if ldir2<0 xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub else xt=xt+xsub yt=yt+ysub zt=zt+zsub wt=wt+wsub endif x=xt y=yt zz=zt w=wt j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout k=j lsq=sq xw=x yw=y zw=zz ww=w if j>=#maxiter found=true ldir2=-1 else x=xt+xs/65536.0 y=yt+ys/65536.0 zz=zt+zs/65536.0 w=wt+ws/65536.0 j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout ldir2=j-k if ldir2==0 ldir2=lsq-sq endif if j>=#maxiter found=true ldir2=-1 endif endif xsub=xsub/2 ysub=ysub/2 zsub=zsub/2 wsub=wsub/2 until subdiv==26 if found==true if @exitz==0 || @exitz==2 || @exitz==4 x=xt-x1 y=yt-y1 zz=zt-z1 w=wt-w1 j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout t=j+lb-il2*log(log(sq)/2) x=xt+x1 y=yt+y1 zz=zt+z1 w=wt+w1 j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout v=j+lb-il2*log(log(sq)/2)-t x=xt-x2 y=yt-y2 zz=zt-z2 w=wt-w2 j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout t=j+lb-il2*log(log(sq)/2) x=xt+x2 y=yt+y2 zz=zt+z2 w=wt+w2 j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout v1=j+lb-il2*log(log(sq)/2)-t x=xt-x3 y=yt-y3 zz=zt-z3 w=wt-w3 j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout t=j+lb-il2*log(log(sq)/2) x=xt+x3 y=yt+y3 zz=zt+z3 w=wt+w3 j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi j=j+1 until j>=#maxiter || sq>@bailout v2=j+lb-il2*log(log(sq)/2)-t l=(1.0+v2/sqrt(v*v+v1*v1+v2*v2)) \ /2.0 if l<0 l=0 else if @exitz==0 || @exitz==2 if l>0.9975 l=0.9975 endif else if l>1.0 l=1.0 endif endif endif endif if @exitz==1 || @exitz==2 z=xw+flip(yw) t=atan2(z) if (t<0) t=t+#pi*2 endif t=t/(#pi*2) if t<0 t=0 elseif t>0.9975 t=0.9975 endif endif if @exitz==2 l=l+(t-0.5)/20 if l<0 l=0 elseif l>0.9975 l=0.9975 endif endif if @exitz==3 || @exitz==4 x=xt y=yt zz=zt w=wt j=0 repeat xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi if j==0 t=sq elseif sq=#maxiter || sq>@bailout if @exitz==3 l=t else l=2*(l-0.5) if l<0 l=0 endif l=l/(400)+(200*(t%1)-(200*(t%1))%1)/200 endif endif endif endif endif ldir=ldir1 i=i-1 until i<=0 || found==true else found=true t=0 l=0 endif else found=true t=0 l=0 endif loop: if @exitz==0 || @exitz==2 || @exitz==3 || @exitz==4 z=l else z=t endif bailout: found==false default: title = "J3D-Standard Quaternion" helpfile = "MMF.html" center = (0, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 10 helpfile = "MMF.html" param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out \ i.e. is considered as tending \ to the infinite attractor." endparam param tx caption = "Target Xcoord" default = 0.0 endparam param ty caption = "Target Ycoord" default = 0.0 endparam param tz caption = "Target Zcoord" default = 0.0 endparam param f caption = "Field of view" default = 1.0 min = 0.1 hint = "Use to modify the perspective. \ Values <1 produce 'wide-angle'." endparam param r caption = "Distance to target" default = 3.75 min = 0.1 hint = "Use to pan the camera." endparam param view caption = "Viewing range" default = 7.0 min = 0.1 hint = "This is the maximum distance to \ scan from the camera." endparam param detail caption = "Detail level" default = 100.0 min = 1.0 hint = "Higher values produce more accuracy" endparam param exitz caption = "Colouring" enum = "Lighting" "Atan" "Mixed" "BoF60" "BoFshaded" default = 0 hint = "Sets value for MMF colouring." endparam param solid caption = "Solid condition" enum = "Max iteration" "Direction change" default = 0 hint = "Direction change colours more and \ works faster." endparam param angle1 caption = "Z Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of X and Y \ around the Z-axis. \ (roll)" endparam param angle2 caption = "X Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Y and Z \ around the X axis. \ (elevation)" endparam param angle3 caption = "Y Rot (degrees)" default = 45.0 min = -360.0 max = 360.0 hint = "Rotation of X and Z \ around the Y axis. \ (direction)" endparam param angle4 caption = "4D Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Angle of the line in the plane \ of the 3rd and 4th start values, \ used as the Z-axis. \ 0=3rd part (Z), 90=4th part (W)" endparam param xconst caption = "X constant" default = 0.0 hint = "Value of X constant \ (modify for different \ Julia sets)" endparam param yconst caption = "Y constant" default = 0.0 hint = "Value of Y constant \ (modify for different \ Julia sets)" endparam param zconst caption = "Z constant" default = 1.0 hint = "Value of Z constant \ (modify for different \ Julia sets)" endparam param wconst caption = "W constant" default = 0.0 hint = "Value of W constant \ (modify for different \ Julia sets)" endparam param light caption = "Directional lighting" enum = "Off" "On" default = 0 hint = "If on then the object is lit by a \ light source independant of the \ 'camera' position." endparam param light1 caption = "Light 1 (degrees)" default = 0.0 min = -90.0 max = 90.0 hint = "Independant light elevation." endparam param light2 caption = "Light 2 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Independant light direction." endparam } MMFn-J3D-Hypercomplex1 { ; ; This was meant to be: ; Standard Hypercomplex Julia sets in 3D ; However it contains a mistake - I got a ; sign wrong - but was quite ; interesting anyway, so I've left it here. ; Requires the MMF "3D" outside colouring mode ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; http://skyscraper.fortunecity.com/terabyte/966/ ; 17th February 2000 ; init: float il2 = 1/log(2) float lb = il2*log(log(@bailout)) float a=#pi/180.0 float a1=a*@angle1 float a2=a*@angle2 float a3=a*@angle3 float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float c3=cos(a3) float s3=sin(a3) float m1r0c1=s1*c2 float m1r1c1=c1*c2 float m1r2c0=c2*s3 float m1r2c1=-s2 float m1r2c2=c2*c3 float t1=s1*s3 float t2=s1*c3 float t3=c1*s3 float t4=c1*c3 float m1r0c0=t1*s2+t4 float m1r0c2=t2*s2-t3 float m1r1c0=t3*s2-t2 float m1r1c2=t4*s2-t1 if @light==1 a1=a*@light1 a2=a*@light2 c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) float r0c0=c2 float r0c1=s1*s2 float r0c2=-c1*s2 float r1c0=0 float r1c1=c1 float r1c2=s1 float r2c0=s2 float r2c1=-s1*c2 float r2c2=c1*c2 endif float a=a*@angle4 float xc=@tx-@r*m1r2c0 float yc=@ty-@r*m1r2c1 float zc=(@tz-@r*m1r2c2)*cos(a) float wc=(@tz-@r*m1r2c2)*sin(a) float x=0.25*(real(#pixel)-real(#center)) \ *#magn float y=0.25*(imag(#pixel)-imag(#center)) \ *#magn float xs=(x*m1r0c0+y*m1r1c0+@f*m1r2c0)/@detail float ys=(x*m1r0c1+y*m1r1c1+@f*m1r2c1)/@detail float b=(x*m1r0c2+y*m1r1c2+@f*m1r2c2)/@detail float zs=b*cos(a) float ws=b*sin(a) float xsub=xs/2.0 float ysub=ys/2.0 float zsub=zs/2.0 float wsub=ws/2.0 float xt=xc float yt=yc float zt=zc float wt=wc float xi=0 float yi=0 float zi=0 float sq=0 float xw=0 float yw=0 float zw=0 float ww=0 float zz=0 int subdiv=0 float ldir=0 float ldir1=0 float ldir2=0 float t=0 float v=0 float v1=0 float v2=0 float l=0 bool found=false float i=0.5+@detail*@view/@f if @exitz==0 || @exitz==2 || @exitz==4 v=1.0/(65536.0*65536.0) if @light==0 float z1=v*m1r0c2*cos(a) float w1=v*m1r0c2*sin(a) float x1=v*m1r0c0 float y1=v*m1r0c1 float z2=v*m1r1c2*cos(a) float w2=v*m1r1c2*sin(a) float x2=v*m1r1c0 float y2=v*m1r1c1 float z3=v*m1r2c2*cos(a) float w3=v*m1r2c2*sin(a) float x3=v*m1r2c0 float y3=v*m1r2c1 else float z1=v*r0c2*cos(a) float w1=v*r0c2*sin(a) float x1=v*r0c0 float y1=v*r0c1 float z2=v*r1c2*cos(a) float w2=v*r1c2*sin(a) float x2=v*r1c0 float y2=v*r1c1 float z3=v*r2c2*cos(a) float w3=v*r2c2*sin(a) float x3=v*r2c0 float y3=v*r2c1 endif endif x=xc y=yc zz=zc float w=wc int j=0 int k=0 float lsq=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout if j<#maxiter k=j lsq=sq x=xc+xs/65536.0 y=yc+ys/65536.0 zz=zc+zs/65536.0 w=wc+ws/65536.0 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout if j<#maxiter ldir=j-k if ldir==0 ldir=lsq-sq endif repeat xc=xc+xs yc=yc+ys zc=zc+zs wc=wc+ws j=0 x=xc y=yc zz=zc w=wc repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout k=j lsq=sq xw=x yw=y zw=zz ww=w if j>=#maxiter found=true ldir1=-1 xt=xc yt=yc zt=zc wt=wc else x=xc+xs/65536.0 y=yc+ys/65536.0 zz=zc+zs/65536.0 w=wc+ws/65536.0 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout ldir1=j-k if ldir1==0 ldir1=lsq-sq endif xt=xc yt=yc zt=zc wt=wc if j>=#maxiter found=true ldir1=-1 xt=xc+xs/65536.0 yt=yc+ys/65536.0 zt=zc+zs/65536.0 wt=wc+ws/65536.0 endif endif if ldir>0 || found if ldir1<0 || found if @solid==1 found=true endif ldir2=ldir1 xsub=xs/2.0 ysub=ys/2.0 zsub=zs/2.0 wsub=ws/2.0 subdiv=0 repeat subdiv=subdiv+1 if ldir2<0 xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub else xt=xt+xsub yt=yt+ysub zt=zt+zsub wt=wt+wsub endif x=xt y=yt zz=zt w=wt j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout k=j lsq=sq xw=x yw=y zw=zz ww=w if j>=#maxiter found=true ldir2=-1 else x=xt+xs/65536.0 y=yt+ys/65536.0 zz=zt+zs/65536.0 w=wt+ws/65536.0 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout ldir2=j-k if ldir2==0 ldir2=lsq-sq endif if j>=#maxiter found=true ldir2=-1 endif endif xsub=xsub/2 ysub=ysub/2 zsub=zsub/2 wsub=wsub/2 until subdiv==26 if found==true if @exitz==0 || @exitz==2 || @exitz==4 x=xt-x1 y=yt-y1 zz=zt-z1 w=wt-w1 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout t=j+lb-il2*log(log(sq)/2) x=xt+x1 y=yt+y1 zz=zt+z1 w=wt+w1 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout v=j+lb-il2*log(log(sq)/2)-t x=xt-x2 y=yt-y2 zz=zt-z2 w=wt-w2 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout t=j+lb-il2*log(log(sq)/2) x=xt+x2 y=yt+y2 zz=zt+z2 w=wt+w2 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout v1=j+lb-il2*log(log(sq)/2)-t x=xt-x3 y=yt-y3 zz=zt-z3 w=wt-w3 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout t=j+lb-il2*log(log(sq)/2) x=xt+x3 y=yt+y3 zz=zt+z3 w=wt+w3 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout v2=j+lb-il2*log(log(sq)/2)-t l=(1.0+v2/sqrt(v*v+v1*v1+v2*v2)) \ /2.0 if l<0 l=0 else if @exitz==0 || @exitz==2 if l>0.9975 l=0.9975 endif else if l>1.0 l=1.0 endif endif endif endif if @exitz==1 || @exitz==2 z=xw+flip(yw) t=atan2(z) if (t<0) t=t+#pi*2 endif t=t/(#pi*2) if t<0 t=0 elseif t>0.9975 t=0.9975 endif endif if @exitz==2 l=l+(t-0.5)/20 if l<0 l=0 elseif l>0.9975 l=0.9975 endif endif if @exitz==3 || @exitz==4 x=xt y=yt zz=zt w=wt j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w-y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi if j==0 t=sq elseif sq=#maxiter || sq>@bailout if @exitz==3 l=t else l=2*(l-0.5) if l<0 l=0 endif l=l/(400)+(200*(t%1)-(200*(t%1))%1)/200 endif endif endif endif endif ldir=ldir1 i=i-1 until i<=0 || found==true else found=true t=0 l=0 endif else found=true t=0 l=0 endif loop: if @exitz==0 || @exitz==2 || @exitz==3 || @exitz==4 z=l else z=t endif bailout: found==false default: title = "J3D-Standard Hypercomplex" helpfile = "MMF.html" center = (0, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 10 helpfile = "MMF.html" param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out \ i.e. is considered as tending \ to the infinite attractor." endparam param tx caption = "Target Xcoord" default = 0.0 endparam param ty caption = "Target Ycoord" default = 0.0 endparam param tz caption = "Target Zcoord" default = 0.0 endparam param f caption = "Field of view" default = 1.0 min = 0.1 hint = "Use to modify the perspective. \ Values <1 produce 'wide-angle'." endparam param r caption = "Distance to target" default = 3.75 min = 0.1 hint = "Use to pan the camera." endparam param view caption = "Viewing range" default = 7.0 min = 0.1 hint = "This is the maximum distance to \ scan from the camera." endparam param detail caption = "Detail level" default = 100.0 min = 1.0 hint = "Higher values produce more accuracy" endparam param exitz caption = "Colouring" enum = "Lighting" "Atan" "Mixed" "BoF60" "BoFshaded" default = 0 hint = "Sets value for MMF colouring." endparam param solid caption = "Solid condition" enum = "Max iteration" "Direction change" default = 0 hint = "Direction change colours more and \ works faster." endparam param angle1 caption = "Z Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of X and Y \ around the Z-axis. \ (roll)" endparam param angle2 caption = "X Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Y and Z \ around the X axis. \ (elevation)" endparam param angle3 caption = "Y Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of X and Z \ around the Y axis. \ (direction)" endparam param angle4 caption = "4D Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Angle of the line in the plane \ of the 3rd and 4th start values, \ used as the Z-axis. \ 0=3rd part (Z), 90=4th part (W)" endparam param xconst caption = "X constant" default = 0.0 hint = "Value of X constant \ (modify for different \ Julia sets)" endparam param yconst caption = "Y constant" default = 0.0 hint = "Value of Y constant \ (modify for different \ Julia sets)" endparam param zconst caption = "Z constant" default = 0.0 hint = "Value of Z constant \ (modify for different \ Julia sets)" endparam param wconst caption = "W constant" default = 0.0 hint = "Value of W constant \ (modify for different \ Julia sets)" endparam param light caption = "Directional lighting" enum = "Off" "On" default = 0 hint = "If on then the object is lit by a \ light source independant of the \ 'camera' position." endparam param light1 caption = "Light 1 (degrees)" default = 0.0 min = -90.0 max = 90.0 hint = "Independant light elevation." endparam param light2 caption = "Light 2 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Independant light direction." endparam } MMFo-J3D-Hyperfixed { ; ; This is the corrected version of: ; Standard Hypercomplex Julia sets in 3D ; Requires the MMF "3D" outside colouring mode ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; 21st July 2000 ; init: float il2 = 1/log(2) float lb = il2*log(log(@bailout)) float a=#pi/180.0 float a1=a*@angle1 float a2=a*@angle2 float a3=a*@angle3 float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float c3=cos(a3) float s3=sin(a3) float m1r0c1=s1*c2 float m1r1c1=c1*c2 float m1r2c0=c2*s3 float m1r2c1=-s2 float m1r2c2=c2*c3 float t1=s1*s3 float t2=s1*c3 float t3=c1*s3 float t4=c1*c3 float m1r0c0=t1*s2+t4 float m1r0c2=t2*s2-t3 float m1r1c0=t3*s2-t2 float m1r1c2=t4*s2-t1 if @light==1 a1=a*@light1 a2=a*@light2 c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) float r0c0=c2 float r0c1=s1*s2 float r0c2=-c1*s2 float r1c0=0 float r1c1=c1 float r1c2=s1 float r2c0=s2 float r2c1=-s1*c2 float r2c2=c1*c2 endif float a=a*@angle4 float xc=@tx-@r*m1r2c0 float yc=@ty-@r*m1r2c1 float zc=(@tz-@r*m1r2c2)*cos(a) float wc=(@tz-@r*m1r2c2)*sin(a) float x=0.25*(real(#pixel)-real(#center)) \ *#magn float y=0.25*(imag(#pixel)-imag(#center)) \ *#magn float xs=(x*m1r0c0+y*m1r1c0+@f*m1r2c0)/@detail float ys=(x*m1r0c1+y*m1r1c1+@f*m1r2c1)/@detail float b=(x*m1r0c2+y*m1r1c2+@f*m1r2c2)/@detail float zs=b*cos(a) float ws=b*sin(a) float xsub=xs/2.0 float ysub=ys/2.0 float zsub=zs/2.0 float wsub=ws/2.0 float xt=xc float yt=yc float zt=zc float wt=wc float xi=0 float yi=0 float zi=0 float sq=0 float xw=0 float yw=0 float zw=0 float ww=0 float zz=0 int subdiv=0 float ldir=0 float ldir1=0 float ldir2=0 float t=0 float v=0 float v1=0 float v2=0 float l=0 bool found=false float i=0.5+@detail*@view/@f if @exitz==0 || @exitz==2 || @exitz==4 v=1.0/(65536.0*65536.0) if @light==0 float z1=v*m1r0c2*cos(a) float w1=v*m1r0c2*sin(a) float x1=v*m1r0c0 float y1=v*m1r0c1 float z2=v*m1r1c2*cos(a) float w2=v*m1r1c2*sin(a) float x2=v*m1r1c0 float y2=v*m1r1c1 float z3=v*m1r2c2*cos(a) float w3=v*m1r2c2*sin(a) float x3=v*m1r2c0 float y3=v*m1r2c1 else float z1=v*r0c2*cos(a) float w1=v*r0c2*sin(a) float x1=v*r0c0 float y1=v*r0c1 float z2=v*r1c2*cos(a) float w2=v*r1c2*sin(a) float x2=v*r1c0 float y2=v*r1c1 float z3=v*r2c2*cos(a) float w3=v*r2c2*sin(a) float x3=v*r2c0 float y3=v*r2c1 endif endif x=xc y=yc zz=zc float w=wc int j=0 int k=0 float lsq=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout if j<#maxiter k=j lsq=sq x=xc+xs/65536.0 y=yc+ys/65536.0 zz=zc+zs/65536.0 w=wc+ws/65536.0 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout if j<#maxiter ldir=j-k if ldir==0 ldir=lsq-sq endif repeat xc=xc+xs yc=yc+ys zc=zc+zs wc=wc+ws j=0 x=xc y=yc zz=zc w=wc repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout k=j lsq=sq xw=x yw=y zw=zz ww=w if j>=#maxiter found=true ldir1=-1 xt=xc yt=yc zt=zc wt=wc else x=xc+xs/65536.0 y=yc+ys/65536.0 zz=zc+zs/65536.0 w=wc+ws/65536.0 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout ldir1=j-k if ldir1==0 ldir1=lsq-sq endif xt=xc yt=yc zt=zc wt=wc if j>=#maxiter found=true ldir1=-1 xt=xc+xs/65536.0 yt=yc+ys/65536.0 zt=zc+zs/65536.0 wt=wc+ws/65536.0 endif endif if ldir>0 || found if ldir1<0 || found if @solid==1 found=true endif ldir2=ldir1 xsub=xs/2.0 ysub=ys/2.0 zsub=zs/2.0 wsub=ws/2.0 subdiv=0 repeat subdiv=subdiv+1 if ldir2<0 xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub else xt=xt+xsub yt=yt+ysub zt=zt+zsub wt=wt+wsub endif x=xt y=yt zz=zt w=wt j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout k=j lsq=sq xw=x yw=y zw=zz ww=w if j>=#maxiter found=true ldir2=-1 else x=xt+xs/65536.0 y=yt+ys/65536.0 zz=zt+zs/65536.0 w=wt+ws/65536.0 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout ldir2=j-k if ldir2==0 ldir2=lsq-sq endif if j>=#maxiter found=true ldir2=-1 endif endif xsub=xsub/2 ysub=ysub/2 zsub=zsub/2 wsub=wsub/2 until subdiv==26 if found==true if @exitz==0 || @exitz==2 || @exitz==4 x=xt-x1 y=yt-y1 zz=zt-z1 w=wt-w1 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout t=j+lb-il2*log(log(sq)/2) x=xt+x1 y=yt+y1 zz=zt+z1 w=wt+w1 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout v=j+lb-il2*log(log(sq)/2)-t x=xt-x2 y=yt-y2 zz=zt-z2 w=wt-w2 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout t=j+lb-il2*log(log(sq)/2) x=xt+x2 y=yt+y2 zz=zt+z2 w=wt+w2 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout v1=j+lb-il2*log(log(sq)/2)-t x=xt-x3 y=yt-y3 zz=zt-z3 w=wt-w3 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout t=j+lb-il2*log(log(sq)/2) x=xt+x3 y=yt+y3 zz=zt+z3 w=wt+w3 j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi j=j+1 until j>=#maxiter || sq>@bailout v2=j+lb-il2*log(log(sq)/2)-t l=(1.0+v2/sqrt(v*v+v1*v1+v2*v2)) \ /2.0 if l<0 l=0 else if @exitz==0 || @exitz==2 if l>0.9975 l=0.9975 endif else if l>1.0 l=1.0 endif endif endif endif if @exitz==1 || @exitz==2 z=xw+flip(yw) t=atan2(z) if (t<0) t=t+#pi*2 endif t=t/(#pi*2) if t<0 t=0 elseif t>0.9975 t=0.9975 endif endif if @exitz==2 l=l+(t-0.5)/20 if l<0 l=0 elseif l>0.9975 l=0.9975 endif endif if @exitz==3 || @exitz==4 x=xt y=yt zz=zt w=wt j=0 repeat xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi if j==0 t=sq elseif sq=#maxiter || sq>@bailout if @exitz==3 l=t else l=2*(l-0.5) if l<0 l=0 endif l=l/(400)+(200*(t%1)-(200*(t%1))%1)/200 endif endif endif endif endif ldir=ldir1 i=i-1 until i<=0 || found==true else found=true t=0 l=0 endif else found=true t=0 l=0 endif loop: if @exitz==0 || @exitz==2 || @exitz==3 || @exitz==4 z=l else z=t endif bailout: found==false default: title = "J3D-Corrected Hypercomplex" helpfile = "MMF.html" center = (0, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 10 helpfile = "MMF.html" param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out \ i.e. is considered as tending \ to the infinite attractor." endparam param tx caption = "Target Xcoord" default = 0.0 endparam param ty caption = "Target Ycoord" default = 0.0 endparam param tz caption = "Target Zcoord" default = 0.0 endparam param f caption = "Field of view" default = 1.0 min = 0.1 hint = "Use to modify the perspective. \ Values <1 produce 'wide-angle'." endparam param r caption = "Distance to target" default = 3.75 min = 0.1 hint = "Use to pan the camera." endparam param view caption = "Viewing range" default = 7.0 min = 0.1 hint = "This is the maximum distance to \ scan from the camera." endparam param detail caption = "Detail level" default = 100.0 min = 1.0 hint = "Higher values produce more accuracy" endparam param exitz caption = "Colouring" enum = "Lighting" "Atan" "Mixed" "BoF60" "BoFshaded" default = 0 hint = "Sets value for MMF colouring." endparam param solid caption = "Solid condition" enum = "Max iteration" "Direction change" default = 0 hint = "Direction change colours more and \ works faster." endparam param angle1 caption = "Z Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of X and Y \ around the Z-axis. \ (roll)" endparam param angle2 caption = "X Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of Y and Z \ around the X axis. \ (elevation)" endparam param angle3 caption = "Y Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Rotation of X and Z \ around the Y axis. \ (direction)" endparam param angle4 caption = "4D Rot (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Angle of the line in the plane \ of the 3rd and 4th start values, \ used as the Z-axis. \ 0=3rd part (Z), 90=4th part (W)" endparam param xconst caption = "X constant" default = 0.0 hint = "Value of X constant \ (modify for different \ Julia sets)" endparam param yconst caption = "Y constant" default = 0.0 hint = "Value of Y constant \ (modify for different \ Julia sets)" endparam param zconst caption = "Z constant" default = 0.0 hint = "Value of Z constant \ (modify for different \ Julia sets)" endparam param wconst caption = "W constant" default = 0.0 hint = "Value of W constant \ (modify for different \ Julia sets)" endparam param light caption = "Directional lighting" enum = "Off" "On" default = 0 hint = "If on then the object is lit by a \ light source independant of the \ 'camera' position." endparam param light1 caption = "Light 1 (degrees)" default = 0.0 min = -90.0 max = 90.0 hint = "Independant light elevation." endparam param light2 caption = "Light 2 (degrees)" default = 0.0 min = -360.0 max = 360.0 hint = "Independant light direction." endparam } MMFp-TransMandel { ; ; This formula now includes the option to pass ; a smooth colouring value to the colouring formula ; as final z for divergent and/or convergent areas. ; The method was suggested by Earl Hinrichs: ; ; http://computerart.org/smoothcolor.html ; ; Also the decomposition value of the true final z ; value can be passed as the imaginary part of the ; z value given to the colouring. ; ; When considering the fact that IFS fractals ; are produced by iterating transformations, ; I wondered what would happen if a transformation ; was applied at each iteration as part of a ; Mandelbrot/Julia style formula and this is it ! ; ; You may set a generic rotation/scaling transform ; by setting your own 2 by 2 matrix as well as ; applying a separate rotation and translation. ; ; A "scaling" factor may also be applied to z at the ; end of each iteration , this may be the iteration ; count, a constant or a combination of both. ; ; You can also apply an initial function to z prior ; to the tranformation. ; This was added after I further investigated the ; "Two Square" and "Two Cube" series of fractal types, ; and discovered a far simpler and more general method ; of producing the most interesting members - namely ; by flipping z before applying the standard z^n + c. ; Please note that the "Two Cube" fractal type here ; is an error anyway - it was meant to produce the ; same fractal as the "Two Cube Family" default, but ; I managed to get a sign wrong (again) - I've left ; it alone in case anyone's used it. ; You can essentially produce the correct "Two Cube" ; fractal by using either the standard or complex ; versions of z^n + c, with the power set to 3 and ; Fn2 set to flip - similarly you can produce an ; entire family of this fractal type by leaving Fn2 ; set to flip with any value for the power. ; ; November 2004 ; Added convergent Hinrich and the Integrate formula option. ; Try Integrate with 'Iterate the sum'. ; "Iterate the product" and Nova added 6th April 2002 ; "Self-rotation" added 13th August 2001 ; The option to "iterate the sum" added 11th August 2001 ; Updated 10th September 2000 ; Updated 1st September 2000 ; Updated 23rd August 2000 ; Updated 17th August 2000 ; Created 21st-30th July 2000 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex p = #pixel if @usescale != 1.0 p = p/@usescale endif if @usecentre != (0,0) p = p + @usecentre endif complex z = @start float x = real(z) float y = imag(z) float t = x float t1 = 0 float t2 = 0 complex c = p complex zolder = z complex zold = z complex zs = (0,0) complex zp = (1,0) complex zolds = zs complex zoldp = zp complex q = zs float v = sqrt(@bailout) float v1 = sqrt(@bailout1) float m = 0 float m1 = 1e100 float ang = #pi*@ang/180.0 float r0c0 = @a*cos(ang)-@b*sin(ang) float r0c1 = @a*sin(ang)+@b*cos(ang) float r1c0 = @c*cos(ang)-@d*sin(ang) float r1c1 = @c*sin(ang)+@d*cos(ang) bool bail = true complex sum2 = @nr1 + @nr2 complex pro2 = @nr1*@nr2 complex sum3a = sum2 + @nr3 complex sum3b = pro2 + @nr3*sum2 complex pro3 = pro2*@nr3 complex sum4a = sum3a + @nr4 complex sum4b = sum3b + @nr4*sum3a complex sum4c = pro3 + @nr4*sum3b complex pro4 = pro3*@nr4 complex sum5a = sum4a + @nr5 complex sum5b = sum4b + @nr5*sum4a complex sum5c = sum4c + @nr5*sum4b complex sum5d = pro4 + @nr5*sum4c complex pro5 = pro4*@nr5 complex sum6a = sum5a + @nr6 complex sum6b = sum5b + @nr6*sum5a complex sum6c = sum5c + @nr6*sum5b complex sum6d = sum5d + @nr6*sum5c complex sum6e = pro5 + @nr6*sum5d if @fractal == 22 || @fractal == 27 c = @fn(c) endif complex F = @fn1(c) int i = 1 bool r = true float fac=1 float pwr=1 if @startpix z = c endif loop: zolder = zold zold = z zolds = zs zoldp = zp repeat if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif z = @fn2(z) if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + p endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 + @x y = t*r0c1 + y*r1c1 + @y z = x + flip(y) if @fractal == 0 z = z^@power + c elseif @fractal == 1 z = ((z^2+c-1)/(2*z+c-2))^2 elseif @fractal == 2 z = ((z^3+3*(c-1)*z+(c-1)*(c-2))/(3*z^2+3*(c-2)*z+(c-1)*(c-2)+1))^2 elseif @fractal == 3 z=@Fn(z)+c elseif @fractal == 4 z=1/@Fn(z)+c elseif @fractal == 5 z=z*@Fn(z)+c elseif @fractal == 6 z=(@Fn(z)-c)/z elseif @fractal == 7 z=z/(@Fn(z)-c) elseif @fractal == 8 z=z*@Fn(z)+z+c elseif @fractal == 9 z=@Fn(z)+z*z+c elseif @fractal == 10 z=z*(@Fn(z)+z)+c elseif @fractal == 11 z=c*@Fn(z) elseif @fractal == 12 z=@Fn(z)+z+c elseif @fractal == 13 z=c*@Fn(z)+z elseif @fractal == 14 t = x x = -y*y y = t*y z = x + flip(y) + c elseif @fractal == 15 t1 = x*x - y*y t2 = 2*x*y x = t1 + t2 y = t1 - t2 z = x + flip(y) + c elseif @fractal == 16 t = x*x x = t*t - y*y y = 2*t*y z = x + flip(y) + c elseif @fractal == 17 t = x*x*x t1 = 3*x*x*y t2 = 3*x*y*y y = y*y*y x = t + t1 - t2 + y y = t - t1 - t2 + y z = x + flip(y) + c elseif @fractal == 18 t = x x = real(c) - x*x + imag(c)*y z = x + flip(t) elseif @fractal == 19 z = c*z*(1-z) elseif @fractal == 20 z = z*(1-z) + c elseif @fractal == 21 z = @fn1(c*@fn(z)) elseif @fractal == 22 z = @fn1(z*c) elseif @fractal == 23 if x >= 0 z = (z-1)*c else z = (z+1)*c endif elseif @fractal == 24 if x*imag(c)+real(c)*y >= 0 z = (z-1)*c else z = (z+1)*c endif elseif @fractal == 25 z = z^@power1 + c elseif @fractal == 26 F = @fn(z) z = @fn1(c*F)/@fn1(F) elseif @fractal == 27 z = @fn1(z*c)/F elseif @fractal == 28 z = z^i + c elseif @fractal == 29 && @ndegree==0 z = z - (z-@nr1)*(z-@nr2)/(2*z-sum2) + c elseif @fractal == 29 && @ndegree==1 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)/(3*z^2 - 2*sum3a*z + sum3b) + c elseif @fractal == 29 && @ndegree==2 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)/(4*z^3 - 3*sum4a*z^2 + 2*sum4b*z - sum4c) + c elseif @fractal == 29 && @ndegree==3 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)*(z-@nr5) \ /(5*z^4 - 4*sum5a*z^3 + 3*sum5b*z^2 - 2*sum5c*z + sum5d) + c elseif @fractal == 29 && @ndegree==4 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)*(z-@nr5)*(z-@nr6) \ /(6*z^5 - 5*sum6a*z^4 + 4*sum6b*z^3 - 3*sum6c*z^2 + 2*sum6d*z - sum6e) + c elseif @fractal == 30 z = @fn1(@power1*@fn(z)) + c elseif @fractal == 31 F = @fn(z) z = @fn1((1+@power1)*F)/@fn3(F) + c elseif @fractal == 32 z = fac*z^pwr + c pwr=pwr+1 fac=fac/pwr elseif @fractal == 33 z = 2.0*((z+c-1.0)^@power1+(z-c)^@power1) endif if @doscale != 0 if @doscale == 1 z = z/i elseif @doscale == 2 z = z*i elseif @doscale == 3 z = z*@scale elseif @doscale == 4 z = z*@scale/i elseif @doscale == 5 z = z*@scale*i endif endif if r m = |z| if @smallbail != 0 && |z-zold| < @bailout1 if @smallbail < 2 || |z-1.0| < @bailout1 m1 = |z - zold| endif endif endif if (@smooth>0) if (m>@bailout)&&((@smooth<9)||(@smooth>12)) if r r = false q = z z = v*zold/cabs(zold) if @fixHinrich if @sigma == true zs = zolds endif if @product == true zp = zoldp endif else if @sigma == true zs = zs - zold endif if @product == true && (|zs|>0) zp = zp/zs endif endif else r = true if @smooth>4 x = log(0.5*log(|z|)) x = (x-log(0.5*log(|q|)))/(x-log(log(v))) if (x<0) x = 0 elseif x>1 x = 1 endif z = x else z = (z-q)/(z-v*q/sqrt(m)) if @smooth==1 || @smooth == 3 z = z^@fudge else z = ((@fudge^z)-1)/(@fudge-1) endif endif if @smooth==7 || @smooth==8 || @smooth>14 z = z + flip(atan2(q)) endif if @smooth==3 || @smooth==4 || @smooth==6 || @smooth==8 \ || @smooth==14 || @smooth==16 z = i + z endif if @smooth<5 z = (real(z)+flip(@fudge1*imag(z)))/@fudge2 endif bail = false endif elseif (@smooth>8)&&(@smallbail>0)&&(m1<@bailout1) if r r = false q = z-zold z = zold+(v1*(z-zold))/cabs(zold-zolder) if @sigma == true zs = zolds endif if @product == true zp = zoldp endif else r = true x = log(-0.5*log(|z-zold|)) x = -@cfudge*((x+log(-0.5*log(|q|)))/(x+log(-0.5*log(@bailout1)))-1) if x>=0 x = -1e-100 elseif x<-1.0 x = -1.0 endif if @smooth==11 || @smooth==12 || @smooth==15 || @smooth==16 z = flip(atan2(q)) endif if @smooth==10 || @smooth==12 || @smooth==14 || @smooth==16 x = x + i endif z = x + flip(imag(z)) bail = false endif endif endif until r if (@smallbail != 0) && (m1 < @bailout1) if @smallbail < 2 || |z-1.0| < @bailout1 bail = false endif endif i = i + 1 bailout: bail && ((@test==0 && m <= @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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Transformation, Mandelbrot" magn = 1.0 center = (-.5, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param fractal caption = "Fractal type" enum = "Standard" "Magnet1" "Magnet2" "Fn+p" "1/Fn+p" "z*Fn+p" \ "(Fn-p)/z" "z/(Fn-p)" "z*Fn+z+p" "Fn+z^2+p" "z*(Fn+z)+p" \ "p*Fn" "Fn+z+p" "p*Fn+z" "Fastdraw" "Two Square 3" \ "X Squared" "Two Cube" "Henon" "Lambda" "Breeder" \ "Cheb fn1(c*fn(z))" "Cheb1 fn1(z*fn(c))" "Barnsley 1" \ "Barnsley 2" "Complex z^n+c" "fn1(cfn(z))/fn1(fn(z))" \ "fn1(zfn(c))/fn1(fn(c))" "z^iter + c" "Nova" "Cheb1 (Power)" \ "Cheb2 (Power)" "Integrate" "Double Mandy" hint = "Some of these require convergence testing enabled, also \ sometimes a non-zero starting point is necessary. Please \ note that in these Mandelbrot-style types the 'p' and 'c' \ both refer to '#pixel'." default = 0 endparam param startpix caption = "Start with z=pixel" default = false endparam param start caption = "Starting point" default = (0,0) hint = "Perturbation of start Z, use to deform the fractal." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" "Magnet (1,0)" default = 0 hint = "Enables or disables convergence testing, some fractal \ types or other settings may require convergence testing \ to be enabled to produce any image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param smooth caption = "Smooth colouring" default = 0 enum = "Off" "Smooth#1" "Smooth#2" "+Iter#1" "+Iter#2" \ "loglog" "loglog+Iter" \ "Frac+Atan" "Frac+Atan+Iter" \ "Hinrich (Conv)" "Hinrich+Iter (Conv)" \ "Hinrich+Atan (Conv)" "Hinrich+Atan+Iter(Conv)" \ "Hinrich (Both)" "Hinrich+Iter (Both)" \ "Hinrich+Atan (Both)" "Hinrich+Atan+Iter(Both)" hint = "Modifies the final z value so it's a smoothing \ value. Use for colourings that are based on \ final z or for ones that use a final z smoothing fraction. \ The new Hinrich versions work best, note that the Divergent \ Hinrich versions still have the old names - loglog or Frac+." endparam param fixHinrich caption = "Fix Hinrich" default = false hint = "Use to fix Hinrich smoothing when using 'Iterate the sum' or \ 'Iterate the product'. Default is false to avoid breaking \ old UPRs." endparam param cfudge caption = "Convergent fudge" default = 1.0 hint = "Scaling factor for when the convergence smoothing fraction \ doesn't go all the way from 0 to 1." endparam param fudge caption = "Smooth fudge" default = 10.0 hint = "Use this in combination with the Smooth colouring variations \ to get the colouring as smooth as possible. Typically use \ values 2 - 200, but sometimes very large values, fractions \ or negative values may help. Not needed for the Hinrich versions." endparam param fudge1 caption = "Smooth scale imag" default = 100.0 hint = "This only applies when using the Smooth colouring. Use \ it to scale up the imaginary component of the final z, this \ will improve results with some colourings. \ Not used for the Hinrich versions." endparam param fudge2 caption = "Smooth divide" default = 1.0 hint = "This only applies when using the Smooth colouring. The final z \ value is divided by this value, eg. set it to Maximum Iterations. \ Not used for the Hinrich versions." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param x caption = "Translation (x)" default = 0.0 hint = "Translates (moves) the real value \ at each iteration." endparam param y caption = "Translation (y)" default = 0.0 hint = "Translates (moves) the imaginary value \ at each iteration." endparam param a caption = "Matrix r0,c0" default = 1.0 hint = "Row 0 Column 0 of a generalised \ transformation matrix - use 1.0 \ for the identity matrix." endparam param b caption = "Matrix r0,c1" default = 0.0 hint = "Row 0 Column 1 of a generalised \ transformation matrix - use 0.0 \ for the identity matrix." endparam param c caption = "Matrix r1,c0" default = 0.0 hint = "Row 1 Column 0 of a generalised \ transformation matrix - use 0.0 \ for the identity matrix." endparam param d caption = "Matrix r1,c1" default = 1.0 hint = "Row 1 Column 1 of a generalised \ transformation matrix - use 1.0 \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam param doscale caption = "z scaling" enum = "Off" "/iter" "*iter" "*Scale" "*Scale/iter" \ "*Scale*iter" hint = "Scaling modifies the value of z on each iteration \ after the main formula calculation." endparam param scale caption = "Scale value" default = (2.0,0) hint = "The constant for z scaling, generally speaking small values \ abs(v)<1 will increase the fractal's size and large values \ abs(v)>1 will decrease it. Try it in the 'Scale*iter' mode \ with abs(v)<1." endparam param power caption = "Power (standard)" default = 2.0 min = 2.0 hint = "Change for cubic, quartic etc." endparam param power1 caption = "Power (complex)" default = (2.0,0) hint = "Added to allow the complex powers. \ Use the standard fractal type and \ power parameter for real numbers as \ that should be faster." endparam param ndegree caption = "Nova degree" default = 1 enum = "2" "3" "4" "5" "6" hint = "Sets the degree used for the Nova formula type and \ hence the number of roots used." endparam param nr1 caption = "Nova 1st root" default = (1,0) hint = "Modify for different Nova fractals, used for all \ values of Nova degree." endparam param nr2 caption = "Nova 2nd root" default = (-0.5,0.8660254) hint = "Modify for different Nova fractals, used for all \ values of Nova degree." endparam param nr3 caption = "Nova 3rd root" default = (-0.5,-0.8660254) hint = "Modify for different Nova fractals, used when \ Nova degree is 3 or more." endparam param nr4 caption = "Nova 4th root" default = (-1,0) hint = "Modify for different Nova fractals, used when \ Nova degree is 4 or more." endparam param nr5 caption = "Nova 5th root" default = (0.5,0.8660254) hint = "Modify for different Nova fractals, used when \ Nova degree is 5 or 6." endparam param nr6 caption = "Nova 6th root" default = (0.5,-0.8660254) hint = "Modify for different Nova fractals, used when \ Nova degree is 6." endparam param usescale caption = "Current scale adjust" default = 1.0 hint = "Used for switching in combination with the Switch scale adjust. \ After switching you should really set this value back to 1.0." endparam param usecentre caption = "Current centre adjust" default = (0,0) hint = "Used for switching in combination with the Switch centre adjust. \ After switching you should really set this value back to (0,0)." endparam param swscale caption = "Switch scale adjust" default = 1.0 hint = "Used for switching in combination with the Current scale adjust. \ Modify the value to zoom the switch preview. 01.0 will magnify the switch. Particularly \ useful for finding interesting small Julias." endparam param swcentre caption = "Switch centre adjust" default = (0,0) hint = "Used for switching in combination with the Current centre adjust. \ Modify the value to centre the switch preview. Particularly useful \ for finding interesting small Julias." endparam func Fn caption = "Fn (all Fn types)" default = acos() hint = "Some settings will only produce convergence, \ or require a non-zero start value. \ Use 'acos' with the Chebyshev types for the \ standard Chebyshev polynomials." endfunc func Fn1 caption = "Fn1 (Chebyshevs)" default = cos() hint = "Some settings will only produce convergence, \ or require a non-zero start value. \ Use 'cos' with 'Cheb' and 'Cheb1' for the type 1 \ Chebyshev polynomials, use 'sin' with the \ 'fn1(a*fn(b))/fn1(fn(b))' types for the type 2 \ Chebyshev polynomials." endfunc func Fn2 caption = "Fn2 (done first)" default = ident() hint = "Try using Conj or Flip." endfunc func Fn3 caption = "Fn3 (Cheb2 (Power))" default = sin() hint = "Only used for the Cheb2 (Power) fractal type. This is \ of the form 'Fn1((power+1)*Fn(z))/Fn3(Fn(z)) + c'." endfunc switch: type = "MMFp-TransJulia" seed = #pixel fractal = fractal test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 smooth = smooth fixHinrich = fixHinrich cfudge = cfudge fudge = fudge fudge1 = fudge1 fudge2 = fudge2 ang = ang x = x y = y a = a b = b c = c d = d sigma = sigma product = product selfrot = selfrot doscale = doscale scale = scale power = power power1 = power1 ndegree = ndegree nr1 = nr1 nr2 = nr2 nr3 = nr3 nr4 = nr4 nr5 = nr5 nr6 = nr6 usescale = swscale usecentre = swcentre swscale = usescale swcentre = usecentre Fn = Fn Fn1 = Fn1 Fn2 = Fn2 Fn3 = Fn3 } MMFp-TransJulia { ; ; This formula now includes the option to pass ; a smooth colouring value to the colouring formula ; as final z for divergent and/or convergent areas. ; The method was suggested by Earl Hinrichs: ; ; http://computerart.org/smoothcolor.html ; ; Also the decomposition value of the true final z ; value can be passed as the imaginary part of the ; z value given to the colouring. ; ; When considering the fact that IFS fractals ; are produced by iterating transformations, ; I wondered what would happen if a transformation ; was applied at each iteration as part of a ; Mandelbrot/Julia style formula and this is it ! ; ; You may set a generic rotation/scaling transform ; by setting your own 2 by 2 matrix as well as ; applying a separate rotation and translation. ; ; A "scaling" factor may also be applied to z at the ; end of each iteration , this may be the iteration ; count, a constant or a combination of both. ; ; You can also apply an initial function to z prior ; to the tranformation. ; This was added after I further investigated the ; "Two Square" and "Two Cube" series of fractal types, ; and discovered a far simpler and more general method ; of producing the most interesting members - namely ; by flipping z before applying the standard z^n + c. ; Please note that the "Two Cube" fractal type here ; is an error anyway - it was meant to produce the ; same fractal as the "Two Cube Family" default, but ; I managed to get a sign wrong (again) - I've left ; it alone in case anyone's used it. ; You can essentially produce the correct "Two Cube" ; fractal by using either the standard or complex ; versions of z^n + c, with the power set to 3 and ; Fn2 set to flip - similarly you can produce the ; entire family of this fractal type by leaving Fn2 ; set to flip with any value for the power. ; ; "Iterate the product" and Nova added 6th April 2002 ; "Self-rotation" added 13th August 2001 ; The option to "iterate the sum" added 11th August 2001 ; Updated 10th September 2000 ; Updated 1st September 2000 ; Updated 23rd August 2000 ; Updated 17th August 2000 ; Created 21st-30th July 2000 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel if @usescale != 1.0 z = z/@usescale endif if @usecentre != (0,0) z = z + @usecentre endif float x = real(z) float y = imag(z) float t = x float t1 = 0 float t2 = 0 complex c = @seed complex zolder = z complex zold = z complex zs = (0,0) complex zp = (1,0) complex zolds = zs complex zoldp = zp complex q = zs float v = sqrt(@bailout) float v1 = sqrt(@bailout1) float m = 0 float m1 = 1e100 float ang = #pi*@ang/180.0 float r0c0 = @a*cos(ang)-@b*sin(ang) float r0c1 = @a*sin(ang)+@b*cos(ang) float r1c0 = @c*cos(ang)-@d*sin(ang) float r1c1 = @c*sin(ang)+@d*cos(ang) bool bail = true complex sum2 = @nr1 + @nr2 complex pro2 = @nr1*@nr2 complex sum3a = sum2 + @nr3 complex sum3b = pro2 + @nr3*sum2 complex pro3 = pro2*@nr3 complex sum4a = sum3a + @nr4 complex sum4b = sum3b + @nr4*sum3a complex sum4c = pro3 + @nr4*sum3b complex pro4 = pro3*@nr4 complex sum5a = sum4a + @nr5 complex sum5b = sum4b + @nr5*sum4a complex sum5c = sum4c + @nr5*sum4b complex sum5d = pro4 + @nr5*sum4c complex pro5 = pro4*@nr5 complex sum6a = sum5a + @nr6 complex sum6b = sum5b + @nr6*sum5a complex sum6c = sum5c + @nr6*sum5b complex sum6d = sum5d + @nr6*sum5c complex sum6e = pro5 + @nr6*sum5d if @fractal == 22 || @fractal == 27 c = @fn(c) endif complex F = @fn1(c) int i = 1 bool r = true float fac=1 int pwr=1 loop: zolder = zold zold = z zolds = zs zoldp = zp repeat if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif z = @fn2(z) if @selfrot > 0 ; z = z * (0,1)^(twodpi*atan2(z)) t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + @seed endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 + @x y = t*r0c1 + y*r1c1 + @y z = x + flip(y) if @fractal == 0 z = z^@power + c elseif @fractal == 1 z = ((z^2+c-1)/(2*z+c-2))^2 elseif @fractal == 2 z = ((z^3+3*(c-1)*z+(c-1)*(c-2))/(3*z^2+3*(c-2)*z+(c-1)*(c-2)+1))^2 elseif @fractal == 3 z=@Fn(z)+c elseif @fractal == 4 z=1/@Fn(z)+c elseif @fractal == 5 z=z*@Fn(z)+c elseif @fractal == 6 z=(@Fn(z)-c)/z elseif @fractal == 7 z=z/(@Fn(z)-c) elseif @fractal == 8 z=z*@Fn(z)+z+c elseif @fractal == 9 z=@Fn(z)+z*z+c elseif @fractal == 10 z=z*(@Fn(z)+z)+c elseif @fractal == 11 z=c*@Fn(z) elseif @fractal == 12 z=@Fn(z)+z+c elseif @fractal == 13 z=c*@Fn(z)+z elseif @fractal == 14 t = x x = -y*y y = t*y z = x + flip(y) + c elseif @fractal == 15 t1 = x*x - y*y t2 = 2*x*y x = t1 + t2 y = t1 - t2 z = x + flip(y) + c elseif @fractal == 16 t = x*x x = t*t - y*y y = 2*t*y z = x + flip(y) + c elseif @fractal == 17 t = x*x*x t1 = 3*x*x*y t2 = 3*x*y*y y = y*y*y x = t + t1 - t2 + y y = t - t1 - t2 + y z = x + flip(y) + c elseif @fractal == 18 t = x x = real(c) - x*x + imag(c)*y z = x + flip (t) elseif @fractal == 19 z = c*z*(1-z) elseif @fractal == 20 z = z*(1-z) + c elseif @fractal == 21 z = @fn1(c*@fn(z)) elseif @fractal == 22 z = @fn1(z*c) elseif @fractal == 23 if x >= 0 z = (z-1)*c else z = (z+1)*c endif elseif @fractal == 24 if x*imag(c)+real(c)*y >= 0 z = (z-1)*c else z = (z+1)*c endif elseif @fractal == 25 z = z^@power1 + c elseif @fractal == 26 F = @fn(z) z = @fn1(c*F)/@fn1(F) elseif @fractal == 27 z = @fn1(z*c)/F elseif @fractal == 28 z = z^i + c elseif @fractal == 29 && @ndegree==0 z = z - (z-@nr1)*(z-@nr2)/(2*z-sum2) + c elseif @fractal == 29 && @ndegree==1 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)/(3*z^2 - 2*sum3a*z + sum3b) + c elseif @fractal == 29 && @ndegree==2 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)/(4*z^3 - 3*sum4a*z^2 + 2*sum4b*z - sum4c) + c elseif @fractal == 29 && @ndegree==3 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)*(z-@nr5) \ /(5*z^4 - 4*sum5a*z^3 + 3*sum5b*z^2 - 2*sum5c*z + sum5d) + c elseif @fractal == 29 && @ndegree==4 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)*(z-@nr5)*(z-@nr6) \ /(6*z^5 - 5*sum6a*z^4 + 4*sum6b*z^3 - 3*sum6c*z^2 + 2*sum6d*z - sum6e) + c elseif @fractal == 30 z = @fn1(@power1*@fn(z)) + c elseif @fractal == 31 F = @fn(z) z = @fn1((1+@power1)*F)/@fn3(F) + c elseif @fractal == 32 z = fac*z^pwr + c pwr=pwr+1 fac=fac/pwr elseif @fractal == 33 z = 2.0*((z+c-1.0)^@power1+(z-c)^@power1) endif if @doscale != 0 if @doscale == 1 z = z/i elseif @doscale == 2 z = z*i elseif @doscale == 3 z = z*@scale elseif @doscale == 4 z = z*@scale/i elseif @doscale == 5 z = z*@scale*i endif endif if r m = |z| if @smallbail != 0 && |z-zold| < @bailout1 if @smallbail < 2 || |z-1.0| < @bailout1 m1 = |z - zold| endif endif endif if (@smooth>0) if (m>@bailout)&&((@smooth<9)||(@smooth>12)) if r r = false q = z z = v*zold/cabs(zold) if @fixHinrich if @sigma == true zs = zolds endif if @product == true zp = zoldp endif else if @sigma == true zs = zs - zold endif if @product == true && (|zs|>0) zp = zp/zs endif endif else r = true if @smooth>4 x = log(0.5*log(|z|)) x = (x-log(0.5*log(|q|)))/(x-log(log(v))) if (x<0) x = 0 elseif x>1 x = 1 endif z = x else z = (z-q)/(z-v*q/sqrt(m)) if @smooth==1 || @smooth == 3 z = z^@fudge else z = ((@fudge^z)-1)/(@fudge-1) endif endif if @smooth==7 || @smooth==8 || @smooth>14 z = z + flip(atan2(q)) endif if @smooth==3 || @smooth==4 || @smooth==6 || @smooth==8 \ || @smooth==14 || @smooth==16 z = i - 1 + z endif if @smooth<5 z = (real(z)+flip(@fudge1*imag(z)))/@fudge2 endif bail = false endif elseif (@smooth>8)&&(@smallbail>0)&&(m1<@bailout1) if r r = false q = z-zold z = zold+(v1*(z-zold))/cabs(zold-zolder) if @sigma == true zs = zolds endif if @product == true zp = zoldp endif r = true x = log(-0.5*log(|z-zold|)) x = -@cfudge*((x+log(-0.5*log(|q|)))/(x+log(-0.5*log(@bailout1)))-1) if x>=0 x = -1e-100 elseif x<-1.0 x = -1.0 endif if @smooth==11 || @smooth==12 || @smooth==15 || @smooth==16 z = flip(atan2(q)) endif if @smooth==10 || @smooth==12 || @smooth==14 || @smooth==16 x = x + i endif z = x + flip(imag(z)) bail = false endif endif endif until r if @smallbail != 0 && m1 < @bailout1 if @smallbail < 2 || |z-1.0| < @bailout1 bail = false endif endif i = i + 1 bailout: bail && ((@test == 0 && m <= @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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Transformation, Julia" method = multipass periodicity = 0 center = (0, 0) magn = 1.0 helpfile = "MMF.html" param fractal caption = "Fractal type" enum = "Standard" "Magnet1" "Magnet2" "Fn+c" "1/Fn+c" "z*Fn+c" \ "(Fn-c)/z" "z/(Fn-c)" "z*Fn+z+c" "Fn+z^2+c" "z*(Fn+z)+c" \ "c*Fn" "Fn+z+c" "c*Fn+z" "Fastdraw" "Two Square 3" \ "X Squared" "Two Cube" "Henon" "Lambda" "Breeder" \ "Cheb fn1(c*fn(z))" "Cheb1 fn1(z*fn(c))" "Barnsley 1" \ "Barnsley 2" "Complex z^n+c" "fn1(cfn(z))/fn1(fn(z))" \ "fn1(zfn(c))/fn1(fn(c))" "z^iter + c" "Nova" "Cheb1 (Power)" \ "Cheb2 (Power)" "Integrate" "Double Mandy" hint = "Some of these require convergence testing enabled. Please \ note that in these Julia-style types 'c' refers to the Julia \ constant or 'seed'." default = 0 endparam param seed caption = "Julia constant" default = (-0.80625,0.2875) hint = "Modify for different Julia sets." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Julia set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" "Magnet (1,0)" default = 0 hint = "Enables or disables convergence testing, some fractal \ types or other settings may require convergence testing \ to be enabled to produce any image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param smooth caption = "Smooth colouring" default = 0 enum = "Off" "Smooth#1" "Smooth#2" "+Iter#1" "+Iter#2" \ "loglog" "loglog+Iter" \ "Frac+Atan" "Frac+Atan+Iter" \ "Hinrich (Conv)" "Hinrich+Iter (Conv)" \ "Hinrich+Atan (Conv)" "Hinrich+Atan+Iter(Conv)" \ "Hinrich (Both)" "Hinrich+Iter (Both)" \ "Hinrich+Atan (Both)" "Hinrich+Atan+Iter(Both)" hint = "Modifies the final z value so it's a smoothing \ value. Use for colourings that are based on \ final z or for ones that use a final z smoothing fraction. \ The new Hinrich versions work best, note that the Divergent \ Hinrich versions still have the old names - loglog or Frac+." endparam param fixHinrich caption = "Fix Hinrich" default = false hint = "Use to fix Hinrich smoothing when using 'Iterate the sum' or \ 'Iterate the product'. Default is false to avoid breaking \ old UPRs." endparam param cfudge caption = "Convergent fudge" default = 1.0 hint = "Scaling factor for when the convergence smoothing fraction \ doesn't go all the way from 0 to 1." endparam param fudge caption = "Smooth fudge" default = 10.0 hint = "Use this in combination with the Smooth colouring variations \ to get the colouring as smooth as possible. Typically use \ values 2 - 200, but sometimes very large values, fractions \ or negative values may help. Not needed for the Hinrich smoothing." endparam param fudge1 caption = "Smooth scale imag" default = 100.0 hint = "This only applies when using the Smooth colouring. Use \ it to scale up the imaginary component of the final z, this \ will improve results with some colourings. \ Not used for the Hinrich smoothing." endparam param fudge2 caption = "Smooth divide" default = 1.0 hint = "This only applies when using the Smooth colouring. The final z \ value is divided by this value, eg. set it to Maximum Iterations. \ Not used for the Hinrich smoothing." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param x caption = "Translation (x)" default = 0.0 hint = "Translates (moves) the real value \ at each iteration." endparam param y caption = "Translation (y)" default = 0.0 hint = "Translates (moves) the imaginary value \ at each iteration." endparam param a caption = "Matrix r0,c0" default = 1.0 hint = "Row 0 Column 0 of a generalised \ transformation matrix - use 1.0 \ for the identity matrix." endparam param b caption = "Matrix r0,c1" default = 0.0 hint = "Row 0 Column 1 of a generalised \ transformation matrix - use 0.0 \ for the identity matrix." endparam param c caption = "Matrix r1,c0" default = 0.0 hint = "Row 1 Column 0 of a generalised \ transformation matrix - use 0.0 \ for the identity matrix." endparam param d caption = "Matrix r1,c1" default = 1.0 hint = "Row 1 Column 1 of a generalised \ transformation matrix - use 1.0 \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds the seed to the rotated value, it's \ only here as it produces some interesting results." endparam param doscale caption = "z scaling" enum = "Off" "/iter" "*iter" "*Scale" "*Scale/iter" \ "*Scale*iter" hint = "Scaling modifies the value of z on each iteration \ after the main formula calculation." endparam param scale caption = "Scale value" default = (2.0,0) hint = "The constant for z scaling, generally speaking small values \ abs(v)<1 will increase the fractal's size and large values \ abs(v)>1 will decrease it. Try it in the 'Scale*iter' mode \ with abs(v)<1." endparam param power caption = "Power (standard)" default = 2.0 min = 2.0 hint = "Change for cubic, quartic etc." endparam param power1 caption = "Power (complex)" default = (2.0,0) hint = "Added to allow the complex powers. \ Use the standard fractal type and \ power parameter for real numbers as \ that should be faster." endparam param ndegree caption = "Nova degree" default = 1 enum = "2" "3" "4" "5" "6" hint = "Sets the degree used for the Nova formula type and \ hence the number of roots used." endparam param nr1 caption = "Nova 1st root" default = (1,0) hint = "Modify for different Nova fractals, used for all \ values of Nova degree." endparam param nr2 caption = "Nova 2nd root" default = (-0.5,0.8660254) hint = "Modify for different Nova fractals, used for all \ values of Nova degree." endparam param nr3 caption = "Nova 3rd root" default = (-0.5,-0.8660254) hint = "Modify for different Nova fractals, used when \ Nova degree is 3 or more." endparam param nr4 caption = "Nova 4th root" default = (-1,0) hint = "Modify for different Nova fractals, used when \ Nova degree is 4 or more." endparam param nr5 caption = "Nova 5th root" default = (0.5,0.8660254) hint = "Modify for different Nova fractals, used when \ Nova degree is 5 or 6." endparam param nr6 caption = "Nova 6th root" default = (0.5,-0.8660254) hint = "Modify for different Nova fractals, used when \ Nova degree is 6." endparam param usescale caption = "Current scale adjust" default = 1.0 hint = "Used for switching in combination with the Switch scale adjust. \ After switching you should really set this value back to 1.0." endparam param usecentre caption = "Current centre adjust" default = (0,0) hint = "Used for switching in combination with the Switch centre adjust. \ After switching you should really set this value back to (0,0)." endparam param swscale caption = "Switch scale adjust" default = 1.0 hint = "Used for switching in combination with the Current scale adjust. \ Modify the value to zoom the switch preview. 01.0 will magnify the switch. Particularly \ useful for finding interesting small Julias." endparam param swcentre caption = "Switch centre adjust" default = (0,0) hint = "Used for switching in combination with the Current centre adjust. \ Modify the value to centre the switch preview. Particularly useful \ for finding interesting small Julias." endparam func Fn caption = "Fn (all Fn types)" default = acos() hint = "Some settings will only produce convergence. \ Use 'acos' with the Chebyshev types for the \ standard Chebyshev polynomials." endfunc func Fn1 caption = "Fn1 (Chebyshevs)" default = cos() hint = "Some settings will only produce convergence. \ Use 'cos' with 'Cheb' and 'Cheb1' for the type 1 \ Chebyshev polynomials, use 'sin' with the \ 'fn1(a*fn(b))/fn1(fn(b))' types for the type 2 \ Chebyshev polynomials." endfunc func Fn2 caption = "Fn2 (done first)" default = ident() hint = "Try using Conj or Flip." endfunc func Fn3 caption = "Fn3 (Cheb2 (Power))" default = sin() hint = "Only used for the Cheb2 (Power) fractal type. This is \ of the form 'Fn1((power+1)*Fn(z))/Fn3(Fn(z)) + c'." endfunc switch: type = "MMFp-TransMandel" start = #pixel fractal = fractal test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 smooth = smooth fixHinrich = fixHinrich cfudge = cfudge fudge = fudge fudge1 = fudge1 fudge2 = fudge2 ang = ang x = x y = y a = a b = b c = c d = d sigma = sigma product = product selfrot = selfrot doscale = doscale scale = scale power = power power1 = power1 ndegree = ndegree nr1 = nr1 nr2 = nr2 nr3 = nr3 nr4 = nr4 nr5 = nr5 nr6 = nr6 usescale = swscale usecentre = swcentre swscale = usescale swcentre = usecentre Fn = Fn Fn1 = Fn1 Fn2 = Fn2 Fn3 = Fn3 } MMFq-TransPolyM { ; ; This set of fractal types were inspired by ; Morgan Owen's Fractint Chebyshev collection ; and consists of a number of "special" polynomials. ; I've included the "Trans" options and implimented ; everything in the most flexible way I could, so ; you should find many different new fractal shapes ; using this formula. ; ; The polynomial types are all implimented using the ; relevant recurrence relations. ; ; "Iterate the product" added 6th April 2002 ; "Self-rotation", switch preview scale and offset ; added 13th August 2001 ; The option to "iterate the sum" added 11th August 2001 ; Updated 10th September 2000 ; Created 1st-6th September 2000 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = @start complex c = #pixel if @scalem != 1.0 c = c/@scalem endif if @centrem != (0,0) c = c + @centrem endif float x = real(z) float y = imag(z) float t = x complex zold = z complex zs = (0,0) complex zp = (1,0) float ang = #pi*@ang/180.0 float r0c0 = @a*cos(ang)-@b*sin(ang) float r0c1 = @a*sin(ang)+@b*cos(ang) float r1c0 = @c*cos(ang)-@d*sin(ang) float r1c1 = @c*sin(ang)+@d*cos(ang) bool bail = true complex F = @L0 complex F0 = @L0 complex F1 = @L1*z + @L2 int n = 0 int i = 1 complex kp1 = @k + 1 complex km1 = @k - 1 complex k2m2 = 2*km1 complex cp1 = c + 1 complex cm1 = c - 1 complex c2m2 = 2*cm1 complex albe = @al + @be complex albe1 = albe + 1 complex albe2 = albe + 2 complex al2be2 = albe*(@al - @be) complex j1 = @al + 1 - albe2/2 complex cbe = c + @be complex cbe1 = cbe + 1 complex cbe2 = cbe + 2 complex c2be2 = cbe*(c - @be) complex j2 = c + 1 - cbe2/2 complex alc = @al + c complex alc1 = alc + 1 complex alc2 = alc + 2 complex al2c2 = alc*(@al - c) complex j3 = @al + 1 - alc2/2 if @fractal == 6 || @fractal == 7 F0 = (1.0,0) F1 = z elseif @fractal == 10 || @fractal == 11 F0 = (1.0,0) F1 = 1 - z elseif @fractal == 14 || @fractal == 15 F0 = (1.0,0) F1 = 2*z elseif @fractal == 17 F0 = (1.0,0) F1 = cp1 - z elseif @fractal == 19 F0 = (1.0,0) F1 = 2*c*z n = 1 elseif @fractal == 22 || @fractal == 23 F0 = (1.0,0) F1 = kp1 - z elseif @fractal == 26 || @fractal == 27 F0 = (1.0,0) F1 = 2*@k*z n = 1 elseif @fractal == 30 || @fractal == 31 F0 = (1.0,0) F1 = j1 + albe2*z/2 elseif @fractal == 33 F0 = (1.0,0) F1 = j2 + cbe2*z/2 elseif @fractal == 35 F0 = (1.0,0) F1 = j3 + alc2*z/2 endif loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif z = @fn(z) if @selfrot > 0 ; z = z * (0,1)^(twodpi*atan2(z)) t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + c endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 + @x y = t*r0c1 + y*r1c1 + @y z = x + flip(y) if @fractal == 0 ;Lucas Pn(z)+c F0 = @L0 F1 = @L1*z + @L2 n = @degree - 1 while n > 0 F = F1 F1 = (@L4*z + @L5)*F1 + @L3*F0 F0 = F n = n - 1 endwhile z = F1 + c elseif @fractal == 1 ;Lucas c*Pn(z) F0 = @L0 F1 = @L1*z + @L2 n = @degree - 1 while n > 0 F = F1 F1 = (@L4*z + @L5)*F1 + @L3*F0 F0 = F n = n - 1 endwhile z = c*F1 elseif @fractal == 2 ;Lucas Piter(z)+c if n > 0 F = F1 F1 = (@L4*z + @L5)*F1 + @L3*F0 F0 = F endif z = F1 + c n = n + 1 elseif @fractal == 3 ;Lucas c*Piter(z) if n > 0 F = F1 F1 = (@L4*z + @L5)*F1 + @L3*F0 F0 = F endif z = c*F1 n = n + 1 elseif @fractal == 4 ;Legendre Pn(z)+c F0 = (1.0,0) F1 = z n = 1 while n < @degree F = F1 F1 = ((2*n + 1)*z*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 5 ;Legendre c*Pn(z) F0 = (1.0,0) F1 = z n = 1 while n < @degree F = F1 F1 = ((2*n + 1)*z*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 6 ;Legendre Piter(z)+c n = n + 1 F = F1 F1 = ((2*n + 1)*z*F1 - n*F0)/(n + 1) F0 = F z = F1 + c elseif @fractal == 7 ;Legendre c*Piter(z) n = n + 1 F = F1 F1 = ((2*n + 1)*z*F1 - n*F0)/(n + 1) F0 = F z = c*F1 elseif @fractal == 8 ;Laguerre Pn(z)+c F0 = (1.0,0) F1 = 1 - z n = 1 while n < @degree F = F1 F1 = ((2*n + 1 - z)*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 9 ;Laguerre c*Pn(z) F0 = (1.0,0) F1 = 1 - z n = 1 while n < @degree F = F1 F1 = ((2*n + 1 - z)*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 10 ;Laguerre Piter(z)+c n = n + 1 F = F1 F1 = ((2*n + 1 - z)*F1 - n*F0)/(n + 1) F0 = F z = F1 + c elseif @fractal == 11 ;Laguerre c*Piter(z) n = n + 1 F = F1 F1 = ((2*n + 1 - z)*F1 - n*F0)/(n + 1) F0 = F z = c*F1 elseif @fractal == 12 ;Hermite Pn(z)+c F0 = (1.0,0) F1 = 2*z n = 1 while n < @degree F = F1 F1 = 2*z*F1 - 2*n*F0 F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 13 ;Hermite c*Pn(z) F0 = (1.0,0) F1 = 2*z n = 1 while n < @degree F = F1 F1 = 2*z*F1 - 2*n*F0 F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 14 ;Hermite Piter(z)+c n = n + 1 F = F1 F1 = 2*z*F1 - 2*n*F0 F0 = F z = F1 + c elseif @fractal == 15 ;Hermite c*Piter(z) n = n + 1 F = F1 F1 = 2*z*F1 - 2*n*F0 F0 = F z = c*F1 elseif @fractal == 16 ;Laguerre Associated Pn(z) (k=c) F0 = (1.0,0) F1 = cp1 - z n = 1 while n < @degree F = F1 F1 = ((2*n + cp1 - z)*F1 - (n + c)*F0)/(n + 1) F0 = F n = n + 1 endwhile z = F1 elseif @fractal == 17 ;Laguerre Associated Piter(z) (k=c) n = n + 1 F = F1 F1 = ((2*n + cp1 - z)*F1 - (n + c)*F0)/(n + 1) F0 = F z = F1 elseif @fractal == 18 ;Ultraspherical Pn(z) (k=c) F0 = (1.0,0) F1 = 2*c*z n = 2 while n <= @degree F = F1 F1 = (2*(n + cm1)*z*F1 - (n + c2m2)*F0)/n F0 = F n = n + 1 endwhile z = F1 elseif @fractal == 19 ;Ultraspherical Piter(z) (k=c) n = n + 1 F = F1 F1 = (2*(n + cm1)*z*F1 - (n + c2m2)*F0)/n F0 = F z = F1 elseif @fractal == 20 ;Laguerre Associated Pkn(z)+c F0 = (1.0,0) F1 = kp1 - z n = 1 while n < @degree F = F1 F1 = ((2*n + kp1 - z)*F1 - (n + @k)*F0)/(n + 1) F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 21 ;Laguerre Associated c*Pkn(z) F0 = (1.0,0) F1 = kp1 - z n = 1 while n < @degree F = F1 F1 = ((2*n + kp1 - z)*F1 - (n + @k)*F0)/(n + 1) F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 22 ;Laguerre Associated Pkiter(z)+c n = n + 1 F = F1 F1 = ((2*n + kp1 - z)*F1 - (n + @k)*F0)/(n + 1) F0 = F z = F1 + c elseif @fractal == 23 ;Laguerre Associated c*Pkiter(z) n = n + 1 F = F1 F1 = ((2*n + kp1 - z)*F1 - (n + @k)*F0)/(n + 1) F0 = F z = c*F1 elseif @fractal == 24 ;Ultraspherical Pkn(z)+c F0 = (1.0,0) F1 = 2*@k*z n = 2 while n <= @degree F = F1 F1 = (2*(n + km1)*z*F1 - (n + k2m2)*F0)/n F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 25 ;Ultraspherical c*Pkn(z) F0 = (1.0,0) F1 = 2*@k*z n = 2 while n <= @degree F = F1 F1 = (2*(n + km1)*z*F1 - (n + k2m2)*F0)/n F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 26 ;Ultraspherical Pkiter(z)+c n = n + 1 F = F1 F1 = (2*(n + km1)*z*F1 - (n + k2m2)*F0)/n F0 = F z = F1 + c elseif @fractal == 27 ;Ultraspherical c*Pkiter(z) n = n + 1 F = F1 F1 = (2*(n + km1)*z*F1 - (n + k2m2)*F0)/n F0 = F z = c*F1 elseif @fractal == 28 ;Jacobi Pabn(z)+c F0 = (1.0,0) F1 = j1 + albe2*z/2 n = 1 while n < @degree F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*z)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F n = n + 1 endwhile z = F1 +c elseif @fractal == 29 ;Jacobi c*Pabn(z) F0 = (1.0,0) F1 = j1 + albe2*z/2 n = 1 while n < @degree F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*z)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 30 ;Jacobi Pabiter(z)+c n = n + 1 F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*z)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F z = F1 + c elseif @fractal == 31 ;Jacobi c*Pabiter(z) n = n + 1 F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*z)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F z = c*F1 elseif @fractal == 32 ;Jacobi Pcbn(z) F0 = (1.0,0) F1 = j2 + cbe2*z/2 n = 1 while n < @degree F = F1 F1 = (((2*n + cbe1)*c2be2 + (2*n + cbe)*(2*n + cbe1)*(2*n + cbe2)*z)*F1 \ - 2*(n + c)*(n + @be)*(2*n + cbe2)*F0)/(2*(n + 1)*(n + cbe1)*(2*n + cbe)) F0 = F n = n + 1 endwhile z = F1 elseif @fractal == 33 ;Jacobi Pcbiter(z) n = n + 1 F = F1 F1 = (((2*n + cbe1)*c2be2 + (2*n + cbe)*(2*n + cbe1)*(2*n + cbe2)*z)*F1 \ - 2*(n + c)*(n + @be)*(2*n + cbe2)*F0)/(2*(n + 1)*(n + cbe1)*(2*n + cbe)) F0 = F z = F1 elseif @fractal == 34 ;Jacobi Pacn(z) F0 = (1.0,0) F1 = j3 + alc2*z/2 n = 1 while n < @degree F = F1 F1 = (((2*n + alc1)*al2c2 + (2*n + alc)*(2*n + alc1)*(2*n + alc2)*z)*F1 \ - 2*(n + @al)*(n + c)*(2*n + alc2)*F0)/(2*(n + 1)*(n + alc1)*(2*n + alc)) F0 = F n = n + 1 endwhile z = F1 elseif @fractal == 35 ;Jacobi Paciter(z) n = n + 1 F = F1 F1 = (((2*n + alc1)*al2c2 + (2*n + alc)*(2*n + alc1)*(2*n + alc2)*z)*F1 \ - 2*(n + @al)*(n + c)*(2*n + alc2)*F0)/(2*(n + 1)*(n + alc1)*(2*n + alc)) F0 = F z = F1 endif if @doscale != 0 if @doscale == 1 z = z/i elseif @doscale == 2 z = z*i elseif @doscale == 3 z = z*@scale elseif @doscale == 4 z = z*@scale/i elseif @doscale == 5 z = z*@scale*i endif i = i + 1 endif if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "TransPoly, Mandelbrot" magn = 0.5 center = (0, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param fractal caption = "Fractal type" enum = "Lucas Pn(z)+c" "Lucas c*Pn(z)" "Lucas Piter(z)+c" "Lucas c*Piter(z)" \ "Legendre Pn(z)+c" "Legendre c*Pn(z)" "Lgndr Piter(z)+c" "Lgndr c*Piter(z)" \ "Laguerre Pn(z)+c" "Laguerre c*Pn(z)" "Lgrre Piter(z)+c" "Lgrre c*Piter(z)" \ "Hermite Pn(z)+c" "Hermite c*Pn(z)" "Hermite Piter(z)+c" "Hermite c*Piter(z)" \ "Lag.Ass. Pn(z)" "Lag.Ass. Piter(z)" "Ultrasph Pn(z)" "Ultrasph Piter(z)" \ "Lag.Ass. Pkn(z)+c" "Lag.Ass. c*Pkn(z)" "L.Ass. Pkiter(z)+c" "L.Ass. c*Pkiter(z)" \ "Ultrasph Pkn(z)+c" "Ultrasph c*Pkn(z)" "Ultsph Pkiter(z)+c" "Ultsph c*Pkiter(z)" \ "Jacobi Pabn(z)+c" "Jacobi c*Pabn(z)" "Jacobi Pabiter+c" "Jacobi c*Pabiter" \ "Jacobi Pbn(z)" "Jacobi Pbiter(z)" "Jacobi Pan(z)" "Jacobi Paiter(z)" hint = "Some of these require convergence testing enabled, also \ sometimes a non-zero starting point is necessary. Please \ note that in these Mandelbrot-style types the 'c' refers \ to '#pixel'." default = 24 endparam param start caption = "Starting point" default = (0,0) hint = "Perturbation of start Z, use to deform the fractal." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some fractal \ types or other settings may require convergence testing \ to be enabled to produce any image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param x caption = "Translation (x)" default = 0.0 hint = "Translates (moves) the real value \ at each iteration." endparam param y caption = "Translation (y)" default = 0.0 hint = "Translates (moves) the imaginary value \ at each iteration." endparam param a caption = "Matrix r0,c0" default = 1.0 hint = "Row 0 Column 0 of a generalised \ transformation matrix - use 1.0 \ for the identity matrix." endparam param b caption = "Matrix r0,c1" default = 0.0 hint = "Row 0 Column 1 of a generalised \ transformation matrix - use 0.0 \ for the identity matrix." endparam param c caption = "Matrix r1,c0" default = 0.0 hint = "Row 1 Column 0 of a generalised \ transformation matrix - use 0.0 \ for the identity matrix." endparam param d caption = "Matrix r1,c1" default = 1.0 hint = "Row 1 Column 1 of a generalised \ transformation matrix - use 1.0 \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam param doscale caption = "z scaling" enum = "Off" "/iter" "*iter" "*Scale" "*Scale/iter" \ "*Scale*iter" hint = "Scaling modifies the value of z on each iteration \ after the main formula calculation." default = 0 endparam param scale caption = "Scale value" default = (2.0,0) hint = "The constant for z scaling, generally speaking small values \ abs(v)<1 will increase the fractal's size and large values \ abs(v)>1 will decrease it. Try it in the 'Scale*iter' mode \ with abs(v)<1." endparam param degree caption = "Degree of Pn" default = 4 min = 2 hint = "Sets the degree of the polynomial \ to be used for the 'Pn' and 'Pkn' types." endparam param k caption = "k (Pkn types)" default = (0.25,0) hint = "Sets the extra constant term in the \ Pkn and Pkiter fractal types, eg. \ 'Ultrasph Pkn(z)+c'" endparam param al caption = "alpha (Jacobi)" default = (-.5,0) hint = "Sets the value of alpha in the Jacobi types" endparam param be caption = "beta (Jacobi)" default = (-.5,0) hint = "Sets the value of beta in the Jacobi types" endparam param L0 caption = "First constant" default = (1.0,0) hint = "Sets the base first constant for a Lucas polynomial, \ recurrence relation first term F0(z)." endparam param L1 caption = "Base Linear coeff" default = (1.0,0) hint = "Sets the base linear coefficient for a Lucas polynomial, \ recurrence relation second term F1(z)." endparam param L2 caption = "Base Linear const" default = (0,0) hint = "Sets the base linear constant for a Lucas polynomial, \ recurrence relation second term F1(z)." endparam param L3 caption = "c in c*Fn-2(z)" default = (-1.0,0) hint = "Sets the constant multiplier of Fn-2(z) \ for a Lucas polynomial, \ recurrence relation nth term Fn(z)." endparam param L4 caption = "a in (a*z+c)*Fn-1(z)" default = (2.0,0) hint = "Sets the coefficient a in (a*z+c)*Fn-1(z) \ for a Lucas polynomial, \ recurrence relation nth term Fn(z)." endparam param L5 caption = "c in (a*z+c)*Fn-1(z)" default = (0,0) hint = "Sets the constant c in (a*z+c)*Fn-1(z) \ for a Lucas polynomial, \ recurrence relation nth term Fn(z)." endparam func Fn caption = "Fn (done first)" default = ident() hint = "Try using Conj or Flip." endfunc param centrej caption = "Julia-switch offset" default = (0,0) hint = "Use this to adjust the position of the Julia set you wish to view \ using the switch function when it's off centre." endparam param scalej caption = "Julia-switch scale" default = 1.0 hint = "Use this adjust the scale of the Julia set you wish to view \ using the switch function when it's too large or too small. \ Use values >1.0 to zoom in and values 0 < v < 1.0 to zoom out." endparam param centrem caption = "Mandy-switch offset" default = (0,0) hint = "This should normally be (0,0), it should really only be modified \ when adjusting the switched Mandelbrot from the Julia version." endparam param scalem caption = "Mandy-switch scale" default = 1.0 hint = "This should normally be 1.0, it should really only be modified \ when adjusting the switched Mandelbrot from the Julia version." endparam switch: type = "MMFq-TransPolyJ" seed = #pixel fractal = fractal test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang x = x y = y a = a b = b c = c d = d sigma = sigma product = product selfrot = selfrot doscale = doscale scale = scale degree = degree k = k al = al be = be L0 = L0 L1 = L1 L2 = L2 L3 = L3 L4 = L4 L5 = L5 Fn = Fn centrej = centrej scalej = scalej centrem = centrem scalem = scalem } MMFq-TransPolyJ { ; ; This set of fractal types were inspired by ; Morgan Owen's Fractint Chebyshev collection ; and consists of a number of "special" polynomials. ; I've included the "Trans" options and implimented ; everything in the most flexible way I could, so ; you should find many different new fractal shapes ; using this formula. ; ; The polynomial types are all implimented using the ; relevant recurrence relations. ; ; "Iterate the product" added 6th April 2002 ; "Self-rotation", switch preview scale and offset ; added 13th August 2001 ; Updated 10th September 2000 ; Created 1st-6th September 2000 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel if @scalej != 1.0 z = z/@scalej endif if @centrej != (0,0) z = z + @centrej endif float x = real(z) float y = imag(z) float t = x complex c = @seed complex zold = z complex zs = (0,0) complex zp = (1,0) float ang = #pi*@ang/180.0 float r0c0 = @a*cos(ang)-@b*sin(ang) float r0c1 = @a*sin(ang)+@b*cos(ang) float r1c0 = @c*cos(ang)-@d*sin(ang) float r1c1 = @c*sin(ang)+@d*cos(ang) bool bail = true complex F = @L0 complex F0 = @L0 complex F1 = @L1*z + @L2 int n = 0 int i = 1 complex kp1 = @k + 1 complex km1 = @k - 1 complex k2m2 = 2*km1 complex cp1 = c + 1 complex cm1 = c - 1 complex c2m2 = 2*cm1 complex albe = @al + @be complex albe1 = albe + 1 complex albe2 = albe + 2 complex al2be2 = albe*(@al - @be) complex j1 = @al + 1 - albe2/2 complex cbe = c + @be complex cbe1 = cbe + 1 complex cbe2 = cbe + 2 complex c2be2 = cbe*(c - @be) complex j2 = c + 1 - cbe2/2 complex alc = @al + c complex alc1 = alc + 1 complex alc2 = alc + 2 complex al2c2 = alc*(@al - c) complex j3 = @al + 1 - alc2/2 if @fractal == 6 || @fractal == 7 F0 = (1.0,0) F1 = z elseif @fractal == 10 || @fractal == 11 F0 = (1.0,0) F1 = 1 - z elseif @fractal == 14 || @fractal == 15 F0 = (1.0,0) F1 = 2*z elseif @fractal == 17 F0 = (1.0,0) F1 = cp1 - z elseif @fractal == 19 F0 = (1.0,0) F1 = 2*c*z n = 1 elseif @fractal == 22 || @fractal == 23 F0 = (1.0,0) F1 = kp1 - z elseif @fractal == 26 || @fractal == 27 F0 = (1.0,0) F1 = 2*@k*z n = 1 elseif @fractal == 30 || @fractal == 31 F0 = (1.0,0) F1 = j1 + albe2*z/2 elseif @fractal == 33 F0 = (1.0,0) F1 = j2 + cbe2*z/2 elseif @fractal == 35 F0 = (1.0,0) F1 = j3 + alc2*z/2 endif loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif z = @fn(z) if @selfrot > 0 ; z = z * (0,1)^(twodpi*atan2(z)) t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + c endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 + @x y = t*r0c1 + y*r1c1 + @y z = x + flip(y) if @fractal == 0 ;Lucas Pn(z)+c F0 = @L0 F1 = @L1*z + @L2 n = @degree - 1 while n > 0 F = F1 F1 = (@L4*z + @L5)*F1 + @L3*F0 F0 = F n = n - 1 endwhile z = F1 + c elseif @fractal == 1 ;Lucas c*Pn(z) F0 = @L0 F1 = @L1*z + @L2 n = @degree - 1 while n > 0 F = F1 F1 = (@L4*z + @L5)*F1 + @L3*F0 F0 = F n = n - 1 endwhile z = c*F1 elseif @fractal == 2 ;Lucas Piter(z)+c if n > 0 F = F1 F1 = (@L4*z + @L5)*F1 + @L3*F0 F0 = F endif z = F1 + c n = n + 1 elseif @fractal == 3 ;Lucas c*Piter(z) if n > 0 F = F1 F1 = (@L4*z + @L5)*F1 + @L3*F0 F0 = F endif z = c*F1 n = n + 1 elseif @fractal == 4 ;Legendre Pn(z)+c F0 = (1.0,0) F1 = z n = 1 while n < @degree F = F1 F1 = ((2*n + 1)*z*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 5 ;Legendre c*Pn(z) F0 = (1.0,0) F1 = z n = 1 while n < @degree F = F1 F1 = ((2*n + 1)*z*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 6 ;Legendre Piter(z)+c n = n + 1 F = F1 F1 = ((2*n + 1)*z*F1 - n*F0)/(n + 1) F0 = F z = F1 + c elseif @fractal == 7 ;Legendre c*Piter(z) n = n + 1 F = F1 F1 = ((2*n + 1)*z*F1 - n*F0)/(n + 1) F0 = F z = c*F1 elseif @fractal == 8 ;Laguerre Pn(z)+c F0 = (1.0,0) F1 = 1 - z n = 1 while n < @degree F = F1 F1 = ((2*n + 1 - z)*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 9 ;Laguerre c*Pn(z) F0 = (1.0,0) F1 = 1 - z n = 1 while n < @degree F = F1 F1 = ((2*n + 1 - z)*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 10 ;Laguerre Piter(z)+c n = n + 1 F = F1 F1 = ((2*n + 1 - z)*F1 - n*F0)/(n + 1) F0 = F z = F1 + c elseif @fractal == 11 ;Laguerre c*Piter(z) n = n + 1 F = F1 F1 = ((2*n + 1 - z)*F1 - n*F0)/(n + 1) F0 = F z = c*F1 elseif @fractal == 12 ;Hermite Pn(z)+c F0 = (1.0,0) F1 = 2*z n = 1 while n < @degree F = F1 F1 = 2*z*F1 - 2*n*F0 F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 13 ;Hermite c*Pn(z) F0 = (1.0,0) F1 = 2*z n = 1 while n < @degree F = F1 F1 = 2*z*F1 - 2*n*F0 F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 14 ;Hermite Piter(z)+c n = n + 1 F = F1 F1 = 2*z*F1 - 2*n*F0 F0 = F z = F1 + c elseif @fractal == 15 ;Hermite c*Piter(z) n = n + 1 F = F1 F1 = 2*z*F1 - 2*n*F0 F0 = F z = c*F1 elseif @fractal == 16 ;Laguerre Associated Pn(z) (k=c) F0 = (1.0,0) F1 = cp1 - z n = 1 while n < @degree F = F1 F1 = ((2*n + cp1 - z)*F1 - (n + c)*F0)/(n + 1) F0 = F n = n + 1 endwhile z = F1 elseif @fractal == 17 ;Laguerre Associated Piter(z) (k=c) n = n + 1 F = F1 F1 = ((2*n + cp1 - z)*F1 - (n + c)*F0)/(n + 1) F0 = F z = F1 elseif @fractal == 18 ;Ultraspherical Pn(z) (k=c) F0 = (1.0,0) F1 = 2*c*z n = 2 while n <= @degree F = F1 F1 = (2*(n + cm1)*z*F1 - (n + c2m2)*F0)/n F0 = F n = n + 1 endwhile z = F1 elseif @fractal == 19 ;Ultraspherical Piter(z) (k=c) n = n + 1 F = F1 F1 = (2*(n + cm1)*z*F1 - (n + c2m2)*F0)/n F0 = F z = F1 elseif @fractal == 20 ;Laguerre Associated Pkn(z)+c F0 = (1.0,0) F1 = kp1 - z n = 1 while n < @degree F = F1 F1 = ((2*n + kp1 - z)*F1 - (n + @k)*F0)/(n + 1) F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 21 ;Laguerre Associated c*Pkn(z) F0 = (1.0,0) F1 = kp1 - z n = 1 while n < @degree F = F1 F1 = ((2*n + kp1 - z)*F1 - (n + @k)*F0)/(n + 1) F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 22 ;Laguerre Associated Pkiter(z)+c n = n + 1 F = F1 F1 = ((2*n + kp1 - z)*F1 - (n + @k)*F0)/(n + 1) F0 = F z = F1 + c elseif @fractal == 23 ;Laguerre Associated c*Pkiter(z) n = n + 1 F = F1 F1 = ((2*n + kp1 - z)*F1 - (n + @k)*F0)/(n + 1) F0 = F z = c*F1 elseif @fractal == 24 ;Ultraspherical Pkn(z)+c F0 = (1.0,0) F1 = 2*@k*z n = 2 while n <= @degree F = F1 F1 = (2*(n + km1)*z*F1 - (n + k2m2)*F0)/n F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 25 ;Ultraspherical c*Pkn(z) F0 = (1.0,0) F1 = 2*@k*z n = 2 while n <= @degree F = F1 F1 = (2*(n + km1)*z*F1 - (n + k2m2)*F0)/n F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 26 ;Ultraspherical Pkiter(z)+c n = n + 1 F = F1 F1 = (2*(n + km1)*z*F1 - (n + k2m2)*F0)/n F0 = F z = F1 + c elseif @fractal == 27 ;Ultraspherical c*Pkiter(z) n = n + 1 F = F1 F1 = (2*(n + km1)*z*F1 - (n + k2m2)*F0)/n F0 = F z = c*F1 elseif @fractal == 28 ;Jacobi Pabn(z)+c F0 = (1.0,0) F1 = j1 + albe2*z/2 n = 1 while n < @degree F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*z)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F n = n + 1 endwhile z = F1 + c elseif @fractal == 29 ;Jacobi c*Pabn(z) F0 = (1.0,0) F1 = j1 + albe2*z/2 n = 1 while n < @degree F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*z)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F n = n + 1 endwhile z = c*F1 elseif @fractal == 30 ;Jacobi Pabiter(z)+c n = n + 1 F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*z)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F z = F1 + c elseif @fractal == 31 ;Jacobi c*Pabiter(z) n = n + 1 F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*z)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F z = c*F1 elseif @fractal == 32 ;Jacobi Pbn(z) F0 = (1.0,0) F1 = j2 + cbe2*z/2 n = 1 while n < @degree F = F1 F1 = (((2*n + cbe1)*c2be2 + (2*n + cbe)*(2*n + cbe1)*(2*n + cbe2)*z)*F1 \ - 2*(n + c)*(n + @be)*(2*n + cbe2)*F0)/(2*(n + 1)*(n + cbe1)*(2*n + cbe)) F0 = F n = n + 1 endwhile z = F1 elseif @fractal == 33 ;Jacobi Pbiter(z) n = n + 1 F = F1 F1 = (((2*n + cbe1)*c2be2 + (2*n + cbe)*(2*n + cbe1)*(2*n + cbe2)*z)*F1 \ - 2*(n + c)*(n + @be)*(2*n + cbe2)*F0)/(2*(n + 1)*(n + cbe1)*(2*n + cbe)) F0 = F z = F1 elseif @fractal == 34 ;Jacobi Pan(z) F0 = (1.0,0) F1 = j3 + alc2*z/2 n = 1 while n < @degree F = F1 F1 = (((2*n + alc1)*al2c2 + (2*n + alc)*(2*n + alc1)*(2*n + alc2)*z)*F1 \ - 2*(n + @al)*(n + c)*(2*n + alc2)*F0)/(2*(n + 1)*(n + alc1)*(2*n + alc)) F0 = F n = n + 1 endwhile z = F1 elseif @fractal == 35 ;Jacobi Paiter(z) n = n + 1 F = F1 F1 = (((2*n + alc1)*al2c2 + (2*n + alc)*(2*n + alc1)*(2*n + alc2)*z)*F1 \ - 2*(n + @al)*(n + c)*(2*n + alc2)*F0)/(2*(n + 1)*(n + alc1)*(2*n + alc)) F0 = F z = F1 endif if @doscale != 0 if @doscale == 1 z = z/i elseif @doscale == 2 z = z*i elseif @doscale == 3 z = z*@scale elseif @doscale == 4 z = z*@scale/i elseif @doscale == 5 z = z*@scale*i endif i = i + 1 endif if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "TransPoly, Julia" method = multipass periodicity = 0 center = (0, 0) magn = 1.0 helpfile = "MMF.html" param fractal caption = "Fractal type" enum = "Lucas Pn(z)+c" "Lucas c*Pn(z)" "Lucas Piter(z)+c" "Lucas c*Piter(z)" \ "Legendre Pn(z)+c" "Legendre c*Pn(z)" "Lgndr Piter(z)+c" "Lgndr c*Piter(z)" \ "Laguerre Pn(z)+c" "Laguerre c*Pn(z)" "Lgrre Piter(z)+c" "Lgrre c*Piter(z)" \ "Hermite Pn(z)+c" "Hermite c*Pn(z)" "Hermite Piter(z)+c" "Hermite c*Piter(z)" \ "Lag.Ass. Pn(z)" "Lag.Ass. Piter(z)" "Ultrasph Pn(z)" "Ultrasph Piter(z)" \ "Lag.Ass. Pkn(z)+c" "Lag.Ass. c*Pkn(z)" "L.Ass. Pkiter(z)+c" "L.Ass. c*Pkiter(z)" \ "Ultrasph Pkn(z)+c" "Ultrasph c*Pkn(z)" "Ultsph Pkiter(z)+c" "Ultsph c*Pkiter(z)" \ "Jacobi Pabn(z)+c" "Jacobi c*Pabn(z)" "Jacobi Pabiter+c" "Jacobi c*Pabiter" \ "Jacobi Pbn(z)" "Jacobi Pbiter(z)" "Jacobi Pan(z)" "Jacobi Paiter(z)" hint = "Some of these require convergence testing enabled. Please \ note that in these Julia-style types 'c' refers to the Julia \ constant or 'seed'." default = 24 endparam param seed caption = "Julia constant" default = (-0.80625,0.2875) hint = "Modify for different Julia sets." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Julia set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some fractal \ types or other settings may require convergence testing \ to be enabled to produce any image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param x caption = "Translation (x)" default = 0.0 hint = "Translates (moves) the real value \ at each iteration." endparam param y caption = "Translation (y)" default = 0.0 hint = "Translates (moves) the imaginary value \ at each iteration." endparam param a caption = "Matrix r0,c0" default = 1.0 hint = "Row 0 Column 0 of a generalised \ transformation matrix - use 1.0 \ for the identity matrix." endparam param b caption = "Matrix r0,c1" default = 0.0 hint = "Row 0 Column 1 of a generalised \ transformation matrix - use 0.0 \ for the identity matrix." endparam param c caption = "Matrix r1,c0" default = 0.0 hint = "Row 1 Column 0 of a generalised \ transformation matrix - use 0.0 \ for the identity matrix." endparam param d caption = "Matrix r1,c1" default = 1.0 hint = "Row 1 Column 1 of a generalised \ transformation matrix - use 1.0 \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds the seed to the rotated value, it's \ only here as it produces some interesting results." endparam param doscale caption = "z scaling" enum = "Off" "/iter" "*iter" "*Scale" "*Scale/iter" \ "*Scale*iter" hint = "Scaling modifies the value of z on each iteration \ after the main formula calculation." default = 0 endparam param scale caption = "Scale value" default = (2.0,0) hint = "The constant for z scaling, generally speaking small values \ abs(v)<1 will increase the fractal's size and large values \ abs(v)>1 will decrease it. Try it in the 'Scale*iter' mode \ with abs(v)<1." endparam param degree caption = "Degree of Pn" default = 4 min = 2 hint = "Sets the degree of the polynomial \ to be used for the 'Pn' and 'Pkn' types." endparam param k caption = "k (Pkn types)" default = (0.25,0) hint = "Sets the extra constant term in the \ Pkn and Pkiter fractal types, eg. \ 'Ultrasph Pkn(z)+c'" endparam param al caption = "alpha (Jacobi)" default = (-.5,0) hint = "Sets the value of alpha in the Jacobi types" endparam param be caption = "beta (Jacobi)" default = (-.5,0) hint = "Sets the value of beta in the Jacobi types" endparam param L0 caption = "First constant" default = (1.0,0) hint = "Sets the base first constant for a Lucas polynomial, \ recurrence relation first term F0(z)." endparam param L1 caption = "Base Linear coeff" default = (1.0,0) hint = "Sets the base linear coefficient for a Lucas polynomial, \ recurrence relation second term F1(z)." endparam param L2 caption = "Base Linear const" default = (0,0) hint = "Sets the base linear constant for a Lucas polynomial, \ recurrence relation second term F1(z)." endparam param L3 caption = "c in c*Fn-2(z)" default = (-1.0,0) hint = "Sets the constant multiplier of Fn-2(z) \ for a Lucas polynomial, \ recurrence relation nth term Fn(z)." endparam param L4 caption = "a in (a*z+c)*Fn-1(z)" default = (2.0,0) hint = "Sets the coefficient a in (a*z+c)*Fn-1(z) \ for a Lucas polynomial, \ recurrence relation nth term Fn(z)." endparam param L5 caption = "c in (a*z+c)*Fn-1(z)" default = (0,0) hint = "Sets the constant c in (a*z+c)*Fn-1(z) \ for a Lucas polynomial, \ recurrence relation nth term Fn(z)." endparam func Fn caption = "Fn (done first)" default = ident() hint = "Try using Conj or Flip." endfunc param centrem caption = "Mandy-switch offset" default = (0,0) hint = "Use this to adjust the position of the Mandelbrot set you wish to view \ using the switch function when it's off centre." endparam param scalem caption = "Mandy-switch scale" default = 1.0 hint = "Use this adjust the scale of the Mandelbrot set you wish to view \ using the switch function when it's too large or too small. \ Use values >1.0 to zoom in and values 0 < v < 1.0 to zoom out." endparam param centrej caption = "Julia-switch offset" default = (0,0) hint = "This should normally be (0,0), it should really only be modified \ when adjusting the switched Julia from the Mandelbrot version." endparam param scalej caption = "Julia-switch scale" default = 1.0 hint = "This should normally be 1.0, it should really only be modified \ when adjusting the switched Julia from the Mandelbrot version." endparam switch: type = "MMFq-TransPolyM" start = #pixel fractal = fractal test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang x = x y = y a = a b = b c = c d = d sigma = sigma product = product selfrot = selfrot doscale = doscale scale = scale degree = degree k = k al = al be = be L0 = L0 L1 = L1 L2 = L2 L3 = L3 L4 = L4 L5 = L5 Fn = Fn centrem = centrem scalem = scalem centrej = centrej scalej = scalej } MMFr-Solid3DComplex { ; ; Solid 3D complex fractals ; (c) Dave Makin (Makin' Magic) ; http://www.crosswinds.net/~makinmagic/ ; http://website.lineone.net/~dave_makin/ ; http://skyscraper.fortunecity.com/terabyte/966/ ; ; Updated 24th September 2001 - added the ability ; to rotate the fractals using the switch-preview. ; ; Created 5th June 2001 ; init: float a=#pi/180.0 float twopi = 2.0*#pi float cs = @traprot*a float sn = sin(cs) float cs = cos(cs) complex tval = real(@trapval)*cs-imag(@trapval)*sn \ +flip(real(@trapval)*sn+imag(@trapval)*cs) complex z=cc=oo=(0,0) if @fractal==2 complex as=(0,0) elseif @fractal==8 complex lo=oo endif float a1=a*@angle1 + imag(@rot) float a2=a*@angle2 - real(@rot) float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float m1r0c0=c2 float m1r0c1=0 float m1r0c2=-s2 float m1r1c0=s1*s2 float m1r1c1=c1 float m1r1c2=s1*c2 float m1r2c0=c1*s2 float m1r2c1=-s1 float m1r2c2=c1*c2 float dtl=@detail if @smart dtl=0.1*(@detail+8.0) endif if @colour==0 float x0=0 float y0=0 float z0=0 float w0=0 float x1=0 float y1=0 float z1=0 float x2=0 float y2=0 float z2=0 float x3=0 float y3=0 float z3=0 float x4=0 float y4=0 float z4=0 float x5=0 float y5=0 float z5=0 if @light>0 if @movelight a1=a1+a*@light1 a2=a2+a*@light2 else a1=a*@light1 a2=a*@light2 endif c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) float r0c0=c2 float r0c1=0 float r0c2=-s2 float r1c0=s1*s2 float r1c1=c1 float r1c2=s1*c2 float r2c0=c1*s2 float r2c1=-s1 float r2c2=c1*c2 endif if @light==3 || @light==4 || @light>6 float shxs=0 float shys=0 float shzs=0 float shws=0 float shxb=0 float shyb=0 float shzb=0 float shwb=0 float shxsb=0 float shysb=0 float shzsb=0 float shwsb=0 float shv=0 bool shadow=false float shad=(1-@shadow) endif endif bool clipped = @cutlr || @cuttb || @cutfb if clipped && (@cutrot1!=0.0 || @cutrot2!=0.0) float cs1 = 0.0 cs = @cutrot1*a cs1 = @cutrot2*a sn = sin(cs) cs = cos(cs) float sn1 = sin(cs1) cs1 = cos(cs1) float cr0c0=cs1 float cr0c1=0.0 float cr0c2=-sn1 float cr1c0=sn*sn1 float cr1c1=cs float cr1c2=sn*cs1 float cr2c0=cs*sn1 float cr2c1=-sn float cr2c2=cs*cs1 endif a=a*@angle3 s1=sin(a) c1=cos(a) if @colour==0 float d=1/(160*#magn) float dzx=2*m1r2c0*d float dzy=2*m1r2c1*d float dzz=2*m1r2c2*d*c1 float dzw=2*m1r2c2*d*s1 if @f<1e-5 float dxx=m1r0c0*d float dxy=m1r0c1*d float dxz=m1r0c2*d*c1 float dxw=m1r0c2*d*s1 float dyx=m1r1c0*d float dyy=m1r1c1*d float dyz=m1r1c2*d*c1 float dyw=m1r1c2*d*s1 else float dd=d/@f float dxx=m1r0c0*dd float dxy=m1r0c1*dd float dxz=m1r0c2*dd*c1 float dxw=m1r0c2*dd*s1 float dyx=m1r1c0*dd float dyy=m1r1c1*dd float dyz=m1r1c2*dd*c1 float dyw=m1r1c2*dd*s1 dd = 0.0 endif if @usedensity float ldz=@ldelta*c1 float ldw=@ldelta*s1 float lb = log(0.5*log(@bailout)) float ilp = 1.0/log(@lpwr) endif endif complex o=#pixel-#center float x=real(o) float y=imag(o) bool found=false float v=@view float alpha = 1e200 float beta = 0.0 float aval = 0.0 float lcut = @leftcut*@cutscale+real(@cutcentre) float rcut = @rightcut*@cutscale+real(@cutcentre) float tcut = @topcut*@cutscale+imag(@cutcentre) float bcut = @btmcut*@cutscale+imag(@cutcentre) float fcut = @frontcut*@cutscale+@cutcentre1 float bkcut = @backcut*@cutscale+@cutcentre1 if @movecut lcut = lcut + real(@txy) rcut = rcut + real(@txy) tcut = tcut + imag(@txy) bcut = bcut + imag(@txy) fcut = fcut + @tz bkcut = bkcut + @tz endif float xcc = 0.0 float ycc = 0.0 float zcc = 0.0 float xss = 0.0 float yss = 0.0 float zss = 0.0 float wss = 0.0 float ccc = 0.0 if @f<1e-5 float xc=real(#center)+@trackin*(x*m1r0c0+y*m1r1c0)+real(@txy)-@r*m1r2c0 float yc=imag(#center)+@trackin*(x*m1r0c1+y*m1r1c1)+imag(@txy)-@r*m1r2c1 float zc=@trackin*(x*m1r0c2+y*m1r1c2)+@tz-@r*m1r2c2 float xs=m1r2c0 float ys=m1r2c1 float zs=m1r2c2 float xo float yo if clipped if (@cutrot1==0.0 && @cutrot2==0.0 && !@rotcut) xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs else xo = real(@txy) yo = imag(@txy) if @rotcut xcc=real(#center)+@trackin*x+xo ycc=imag(#center)+@trackin*y+yo zcc=@tz-@r xss = 0.0 yss = 0.0 zss = 1.0 else xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs endif if @cutrot1!=0.0 || @cutrot2!=0.0 aval = xo+(xcc-xo)*cr0c0 + (ycc-yo)*cr1c0 + (zcc-@tz)*cr2c0 ccc = yo+(xcc-xo)*cr0c1 + (ycc-yo)*cr1c1 + (zcc-@tz)*cr2c1 zcc = @tz+(xcc-xo)*cr0c2 + (ycc-yo)*cr1c2 + (zcc-@tz)*cr2c2 xcc = aval ycc = ccc aval = xss*cr0c0 + yss*cr1c0 + zss*cr2c0 ccc = xss*cr0c1 + yss*cr1c1 + zss*cr2c1 zss = xss*cr0c2 + yss*cr1c2 + zss*cr2c2 xss = aval yss = ccc endif endif endif if clipped || @cutsphere bool clr = @cutlr bool ctb = @cuttb bool cfb = @cutfb if abs(xss)<=1e-19 if @cutlr && (xccrcut) found = true else clr = false endif endif if abs(yss)<=1e-19 if @cuttb && (ycc>tcut || yccbkcut) found = true else cfb = false endif endif clipped = clr || ctb || cfb if !found && (clipped || @cutsphere) if clr && abs(xss)>1e-20 aval=(lcut-xcc)/xss if ctb xo = ycc+aval*yss endif if cfb yo = zcc+aval*zss endif if (!ctb || (xo<=tcut && xo>=bcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) alpha = aval beta = aval endif aval=(rcut-xcc)/xss if ctb xo = ycc+aval*yss endif if cfb yo = zcc+aval*zss endif if (!ctb || (xo<=tcut && xo>=bcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif endif if ctb && abs(yss)>1e-20 aval=(tcut-ycc)/yss if clr xo = xcc+aval*xss endif if cfb yo = zcc+aval*zss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif aval=(bcut-ycc)/yss if clr xo = xcc+aval*xss endif if cfb yo = zcc+aval*zss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif endif if cfb && abs(zss)>1e-20 aval=(fcut-zcc)/zss if clr xo = xcc+aval*xss endif if ctb yo = ycc+aval*yss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!ctb || (yo<=tcut && yo>=bcut)) if avalbeta beta = aval endif endif aval=(bkcut-zcc)/zss if clr xo = xcc+aval*xss endif if ctb yo = ycc+aval*yss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!ctb || (yo<=tcut && yo>=bcut)) if avalbeta beta = aval endif endif endif if @clipall && clipped && alpha>1e199 found = true elseif @cutsphere ccc = @spherecentre1 xo = real(@spherecentre) yo = imag(@spherecentre) if @movesphere xo = xo + real(@txy) yo = yo + imag(@txy) ccc = ccc + @tz endif float aa = 0.0 float bb = 0.0 if @rotsphere xo = xo-real(@txy) yo = yo-imag(@txy) ccc = ccc - @tz aa = real(@txy)+xo*m1r0c0+yo*m1r1c0+ccc*m1r2c0 bb = imag(@txy)+xo*m1r0c1+yo*m1r1c1+ccc*m1r2c1 ccc = @tz+xo*m1r0c2+yo*m1r1c2+ccc*m1r2c2 xo = aa yo = bb endif ccc = zc - ccc xo = xc - xo yo = yc - yo aa = 2.0*(xs*xs + ys*ys + zs*zs) bb = 2.0*(xs*xo+ys*yo+zs*ccc) ccc = bb*bb - 2.0*aa*(xo*xo + yo*yo + ccc*ccc - @rcut) if ccc<0.0 if @clipall found = true endif else aa = 1.0/aa xo = aa*(-bb + sqrt(ccc)) yo = aa*(-bb - sqrt(ccc)) if @clipall || !clipped if alpha>1e199 alpha = 0.0 beta = v endif if (xo>=beta && yo>=beta) || (xo<=alpha && yo<=alpha) found = true elseif xoalpha alpha = xo endif if yoalpha alpha = yo endif if xobeta beta = yo endif else if yobeta beta = xo endif endif endif endif if !found if alpha>=v || beta<=0.0 || alpha>beta found = true else if alpha>0.0 xc = xc + alpha*xs yc = yc + alpha*ys zc = zc + alpha*zs else alpha = 0.0 endif if beta>v beta=v endif v = beta - alpha endif endif endif endif if !found v = v*dtl float ws = 1.0/dtl xs = xs*ws ys = ys*ws zs = zs*ws ws=zs*s1 zs=zs*c1 float wc=zc*s1 zc=zc*c1 if @offset>0 zc=zc-@offset*s1 wc=wc+@offset*c1 endif xo=xc yo=yc float zzo=zc*c1+wc*s1 endif else float xo=real(#center)+real(@txy)-(@r+@f)*m1r2c0 float yo=imag(#center)+imag(@txy)-(@r+@f)*m1r2c1 float zo=@tz-(@r+@f)*m1r2c2 float wc = 0.0 float wo = 0.0 if @trackin!=1.0 wc = 1.0 - @trackin xo = xo + wc*m1r2c0 yo = yo + wc*m1r2c1 zo = zo + wc*m1r2c2 endif float xs=x*m1r0c0+y*m1r1c0+@f*m1r2c0 float ys=x*m1r0c1+y*m1r1c1+@f*m1r2c1 float zs=x*m1r0c2+y*m1r1c2+@f*m1r2c2 float zc = (@r+@f-@r1+@trackin-1)/@f float xc=xo+xs*zc float yc=yo+ys*zc float zc=zo+zs*zc float s2=1.0/sqrt(xs*xs+ys*ys+zs*zs) xs=xs*s2 ys=ys*s2 zs=zs*s2 if clipped if (@cutrot1==0.0 && @cutrot2==0.0 && !@rotcut) xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs else wc = real(@txy) wo = imag(@txy) if @rotcut xss = x yss = y zss = @f zcc = (@r+@f-@r1+@trackin-1)/@f xcc=real(#center)+wc+xss*zcc ycc=imag(#center)+wo+yss*zcc zcc=@tz-(@r+@f)+zss*zcc if @trackin!=1.0 zcc = zcc + 1.0 - @trackin endif xss=xss*s2 yss=yss*s2 zss=zss*s2 else xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs endif if @cutrot1!=0.0 || @cutrot2!=0.0 aval = wc+(xcc-wc)*cr0c0 + (ycc-wo)*cr1c0 + (zcc-@tz)*cr2c0 ccc = wo+(xcc-wc)*cr0c1 + (ycc-wo)*cr1c1 + (zcc-@tz)*cr2c1 zcc = @tz+(xcc-wc)*cr0c2 + (ycc-wo)*cr1c2 + (zcc-@tz)*cr2c2 xcc = aval ycc = ccc aval = xss*cr0c0 + yss*cr1c0 + zss*cr2c0 ccc = xss*cr0c1 + yss*cr1c1 + zss*cr2c1 zss = xss*cr0c2 + yss*cr1c2 + zss*cr2c2 xss = aval yss = ccc endif endif endif if clipped || @cutsphere bool clr = @cutlr bool ctb = @cuttb bool cfb = @cutfb if abs(xss)<=1e-19 if @cutlr && (xccrcut) found = true else clr = false endif endif if abs(yss)<=1e-19 if @cuttb && (ycc>tcut || yccbkcut) found = true else cfb = false endif endif clipped = clr || ctb || cfb if !found && (clipped || @cutsphere) if clr && abs(xss)>1e-20 aval=(lcut-xcc)/xss if ctb wc = ycc+aval*yss endif if cfb wo = zcc+aval*zss endif if (!ctb || (wc<=tcut && wc>=bcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) alpha = aval beta = aval endif aval=(rcut-xcc)/xss if ctb wc = ycc+aval*yss endif if cfb wo = zcc+aval*zss endif if (!ctb || (wc<=tcut && wc>=bcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif endif if ctb && abs(yss)>1e-20 aval=(tcut-ycc)/yss if clr wc = xcc+aval*xss endif if cfb wo = zcc+aval*zss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif aval=(bcut-ycc)/yss if clr wc = xcc+aval*xss endif if cfb wo = zcc+aval*zss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif endif if cfb && abs(zss)>1e-20 aval=(fcut-zcc)/zss if clr wc = xcc+aval*xss endif if ctb wo = ycc+aval*yss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!ctb || (wo<=tcut && wo>=bcut)) if avalbeta beta = aval endif endif aval=(bkcut-zcc)/zss if clr wc = xcc+aval*xss endif if ctb wo = ycc+aval*yss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!ctb || (wo<=tcut && wo>=bcut)) if avalbeta beta = aval endif endif endif if @clipall && clipped && alpha>1e199 found = true elseif @cutsphere ccc = @spherecentre1 wc = real(@spherecentre) wo = imag(@spherecentre) if @movesphere wc = wc + real(@txy) wo = wo + imag(@txy) ccc = ccc + @tz endif float aa = 0.0 float bb = 0.0 if @rotsphere wc = wc-real(@txy) wo = wo-imag(@txy) ccc = ccc - @tz aa = real(@txy)+wc*m1r0c0+wo*m1r1c0+ccc*m1r2c0 bb = imag(@txy)+wc*m1r0c1+wo*m1r1c1+ccc*m1r2c1 ccc = @tz+wc*m1r0c2+wo*m1r1c2+ccc*m1r2c2 wc = aa wo = bb endif ccc = zc - ccc wc = xc - wc wo = yc - wo float aa = 2.0*(xs*xs + ys*ys + zs*zs) float bb = 2.0*(xs*wc+ys*wo+zs*ccc) ccc = bb*bb - 2.0*aa*(wc*wc + wo*wo + ccc*ccc - @rcut) if ccc<0.0 if @clipall found = true endif else aa = 1.0/aa wc = aa*(-bb + sqrt(ccc)) wo = aa*(-bb - sqrt(ccc)) if @clipall || !clipped if alpha>1e199 alpha = 0.0 beta = v endif if (wc>=beta && wo>=beta) || (wc<=alpha && wo<=alpha) found = true elseif wcalpha alpha = wc endif if woalpha alpha = wo endif if wcbeta beta = wo endif else if wobeta beta = wc endif endif endif endif if !found if alpha>=v || beta<=0.0 || alpha>beta found = true else if alpha>0.0 xc = xc + alpha*xs yc = yc + alpha*ys zc = zc + alpha*zs else alpha = 0.0 endif if beta>v beta=v endif v = beta - alpha endif endif endif endif if !found v = v*dtl wc = 1.0/dtl xs = xs*wc ys = ys*wc zs = zs*wc wc=zc*s1 zc=zc*c1 if @offset>0 zc=zc-@offset*s1 wc=wc+@offset*c1 endif wo=zo*s1 zo=zo*c1 if @offset>0 zo=zo-@offset*s1 wo=wo+@offset*c1 endif float zzo=zo*c1+wo*s1 float ws=zs*s1 zs=zs*c1 endif endif if !found if @colour==0 && @light>4 float px=real(#center)+real(@txy)-@light3*r2c0 float py=imag(#center)+imag(@txy)-@light3*r2c1 float pz=@tz-@light3*r2c2 if @light<7 if @offset>0 s2=pz*s1+@offset*c1 pz=pz*c1-@offset*s1 pz=pz*c1+s2*s1 endif else float shz=pz*c1 float shw=pz*s1 if @offset>0 shz=shz-@offset*s1 shw=shw+@offset*c1 pz=shz*c1+shw*s1 endif endif endif float xb=0.0000152587890625*xs float yb=0.0000152587890625*ys float zb=0.0000152587890625*zs float wb=0.0000152587890625*ws xss = xs yss = ys zss = zs wss = ws float xsb=0.5*xs float ysb=0.5*ys float zsb=0.5*zs float wsb=0.5*ws float xsub=xsb float ysub=ysb float zsub=zsb float wsub=wsb float xt=xc float yt=yc float zt=zc float wt=wc float sq=0 float sqo=0 float xi=0 float yi=0 float zi=0 float zz=0 float w=wc int j=0 int k=0 float lsq=0 float min=0.0 float min1=0.0 complex tv=(0,0) float ldir=@bailout*@bailout float ldir1=ldir float ldir2=ldir int di=65536 int di1=di float i=0.0 int s=0 int p=0 float xp=xc float yp=yc float zp=zc float wp=wc bool b=true if @colour>0 p=-1 endif repeat i=0.0 found=false xc=xp yc=yp zc=zp wc=wp repeat s=0 repeat if s==0 ;iterate at current step b=true ;ready for binary search x=xc y=yc zz=zc w=wc elseif s==1 ;iterate at current step + a bit k=j lsq=sq if @smart x=xc+xs*0.0000152587890625 y=yc+ys*0.0000152587890625 zz=zc+zs*0.0000152587890625 w=wc+ws*0.0000152587890625 else x=xc+xb y=yc+yb zz=zc+zb w=wc+wb endif elseif s==2 && b ;initiate binary search if @solid==1 found=true endif if @smart xsub=0.5*xs ysub=0.5*ys zsub=0.5*zs wsub=0.5*ws else xsub=xsb ysub=ysb zsub=zsb wsub=wsb endif xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub x=xt y=yt zz=zt w=wt elseif s<@bindepth ;complete binary search if b xsub=0.5*xsub ysub=0.5*ysub zsub=0.5*zsub wsub=0.5*wsub if ldir2<0 xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub else xt=xt+xsub yt=yt+ysub zt=zt+zsub wt=wt+wsub endif x=xt y=yt zz=zt w=wt else x=xt+0.000030517578125*xsub y=yt+0.000030517578125*ysub zz=zt+0.000030517578125*zsub w=wt+0.000030517578125*wsub endif endif j=0 if @axes==0 ;"X,Y,Z,W" o=x+flip(y) cc=zz+flip(w) elseif @axes==1 ;"X,Y,W,Z" o=x+flip(y) cc=w+flip(zz) elseif @axes==2 ;"X,Z,Y,W" o=x+flip(zz) cc=y+flip(w) elseif @axes==3 ;"X,Z,W,Y" o=x+flip(zz) cc=w+flip(y) elseif @axes==4 ;"X,W,Y,Z" o=x+flip(w) cc=y+flip(zz) elseif @axes==5 ;"X,W,Z,Y" o=x+flip(w) cc=zz+flip(y) elseif @axes==6 ;"Y,X,Z,W" o=y+flip(x) cc=zz+flip(w) elseif @axes==7 ;"Y,X,W,Z" o=y+flip(x) cc=w+flip(zz) elseif @axes==8 ;"Y,Z,X,W" o=y+flip(zz) cc=x+flip(w) elseif @axes==9 ;"Y,Z,W,X" o=y+flip(zz) cc=w+flip(x) elseif @axes==10 ;"Y,W,X,Z" o=y+flip(w) cc=x+flip(zz) elseif @axes==11 ;"Y,W,Z,X" o=y+flip(w) cc=zz+flip(x) elseif @axes==12 ;"Z,X,Y,W" o=zz+flip(x) cc=y+flip(w) elseif @axes==13 ;"Z,X,W,Y" o=zz+flip(x) cc=w+flip(y) elseif @axes==14 ;"Z,Y,X,W" o=zz+flip(y) cc=x+flip(w) elseif @axes==15 ;"Z,Y,W,X" o=zz+flip(y) cc=w+flip(x) elseif @axes==16 ;"Z,W,X,Y" o=zz+flip(w) cc=x+flip(y) elseif @axes==17 ;"Z,W,Y,X" o=zz+flip(w) cc=y+flip(x) elseif @axes==18 ;"W,X,Y,Z" o=w+flip(x) cc=y+flip(zz) elseif @axes==19 ;"W,X,Z,Y" o=w+flip(x) cc=zz+flip(y) elseif @axes==20 ;"W,Y,X,Z" o=w+flip(y) cc=x+flip(zz) elseif @axes==21 ;"W,Y,Z,X" o=w+flip(y) cc=zz+flip(x) elseif @axes==22 ;"W,Z,X,Y" o=w+flip(zz) cc=x+flip(y) elseif @axes==23 ;"W,Z,Y,X" o=w+flip(zz) cc=y+flip(x) endif if @fractal==2 as=3*o^2 elseif @fractal==8 lo=o endif repeat if @usedensity && @colour==0 && p>1 sqo=sq endif oo=o o=fn2(o) if @fractal==0 o=o^@k+cc elseif @fractal==1 o=((@k-1)*o^@k+cc)/(@k*o^(@k-1)) elseif @fractal==2 o=o^3-as*o+cc elseif @fractal==3 o=fn3(o)+cc elseif @fractal==4 o=fn3(o)+o^@k+cc elseif @fractal==5 o=fn3(o)*o^@k+cc elseif @fractal==6 o=cc*o*(1-o) elseif @fractal==7 o=o*(1-o)+cc elseif @fractal==8 o=o^@k+lo+cc lo=oo endif if @converge==1 sq=1/|o-oo| else sq=|o| endif if @method==2 tv = o - tval if @traptype==0 min = |tv| elseif @traptype==1 min = real(tv) elseif @traptype==2 min = imag(tv) elseif @traptype==3 min = atan2(tv) endif if @traptype>3 min = real(tv) if @usethreshold min = abs(min-@threshold) else min = abs(min) endif min1 = imag(tv) if @usethreshold min1 = abs(min1-@threshold) else min1 = abs(min1) endif if (@traptype==4 && min<@minval && min1<@minval) \ ||(@traptype==5 && (min<@minval || min1<@minval)) if min1#pi min = min - twopi endif if min<0 min = min + twopi endif endif elseif @traptype>0 && @traptype!=3 min = abs(min) elseif @traptype==3 if @useangle==0 min = abs(min) elseif min<0 min = min + twopi endif endif endif j=j+1 until j>=#maxiter || sq>@bailout || (@method==2 && min<@minval) if @method==1 || (@method==3 && j>=#maxiter) tv = o - tval if @traptype==0 sq = |tv| elseif @traptype==1 sq = real(tv) elseif @traptype==2 sq = imag(tv) elseif @traptype==3 sq = atan2(tv) endif if @traptype>3 sq = real(tv) if @usethreshold sq = abs(sq-@threshold) else sq = abs(sq) endif min1 = imag(tv) if @usethreshold min1 = abs(min1-@threshold) else min1 = abs(min1) endif if (@traptype==4 && sq<@minval && min1<@minval) \ ||(@traptype==5 && (sq<@minval || min1<@minval)) if min1#pi sq = sq - twopi endif if sq<0 sq = sq + twopi endif endif elseif @traptype>0 && @traptype<3 sq = abs(sq) elseif @traptype==3 if @useangle==0 sq = abs(sq) elseif sq<0 sq = sq + twopi endif endif elseif @method==2 sq = min endif if s==0 ;iteration at current step if @usedensity && @colour==0 && p>1 s=-1 found = true else s=1 ;iterate at current step + a bit next time if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true xt=xc yt=yc zt=zc wt=wc s=2 ;initiate binary search next time endif if @nobinary s=-1 endif endif elseif s==1 ;iteration at current step + a bit if @method==0 di1=j-k ldir1=di1 ;direction, towards/away if di1==0 ;if same iteration ldir1=lsq-sq ;use bailout value for direction endif elseif @method!=3 ldir1=lsq-sq elseif (ldir1=di1=j-k)==0 ldir1 = lsq-sq endif xt=xc yt=yc zt=zc wt=wc s=-1 ;Nothing found, move to next main step position if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true s=2 ;initiate binary search next time elseif (!@change && (ldir>0 && ldir1<0) || (@method==0 && dildir1) s=2 ;initiate binary search next time endif elseif s<@bindepth ;the binary search if b if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true ldir2=-1 s=s+1 else k=j lsq=sq b=false endif else if @method==0 ldir2=j-k if ldir2==0 ldir2=lsq-sq endif elseif @method!=3 ldir2=lsq-sq elseif (ldir2=j-k)==0 ldir2 = lsq-sq endif if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true ldir2=-1 xt=xt+0.000030517578125*xsub yt=yt+0.000030517578125*ysub zt=zt+0.000030517578125*zsub wt=wt+0.000030517578125*wsub endif b=true s=s+1 endif endif if s==@bindepth s=-1 endif until s<0 if !found if @smart if j<=1 xs = xss ys = yss zs = zss ws = wss i=i+1.0 elseif j==2 xs = 0.5*xss ys = 0.5*yss zs = 0.5*zss ws = 0.5*wss i=i+0.5 elseif j==3 xs = 0.25*xss ys = 0.25*yss zs = 0.25*zss ws = 0.25*wss i=i+0.25 elseif j==3 xs = 0.125*xss ys = 0.125*yss zs = 0.125*zss ws = 0.125*wss i=i+0.125 elseif j==4 xs = 0.0625*xss ys = 0.0625*yss zs = 0.0625*zss ws = 0.0625*wss i=i+0.0625 elseif j==5 xs = 0.03125*xss ys = 0.03125*yss zs = 0.03125*zss ws = 0.03125*wss i=i+0.03125 elseif j==6 xs = 0.015625*xss ys = 0.015625*yss zs = 0.015625*zss ws = 0.015625*wss i=i+0.015625 elseif j==7 xs = 0.0078125*xss ys = 0.0078125*yss zs = 0.0078125*zss ws = 0.0078125*wss i=i+0.0078125 elseif j==8 xs = 0.00390625*xss ys = 0.00390625*yss zs = 0.00390625*zss ws = 0.00390625*wss i=i+0.00390625 elseif j==6 xs = 0.001953125*xss ys = 0.001953125*yss zs = 0.001953125*zss ws = 0.001953125*wss i=i+0.001953125 elseif j==7 xs = 0.0009765625*xss ys = 0.0009765625*yss zs = 0.0009765625*zss ws = 0.0009765625*wss i=i+0.0009765625 else xs = 0.00048828125*xss ys = 0.00048828125*yss zs = 0.00048828125*zss ws = 0.00048828125*wss i=i+0.00048828125 endif else i=i+1.0 endif xc=xc+xs yc=yc+ys zc=zc+zs wc=wc+ws ldir=ldir1 endif until i>=v || found==true if @colour==0 if p==0 if found==true x0=xt y0=yt z0=zt w0=wt if @light<3 || (@light>4 && @light<7) if @usedensity xp=xt yp=yt zp=zt-ldz wp=wt-ldw elseif @f<1e-5 xp=xt+dxx-dzx yp=yt+dxy-dzy zp=zt+dxz-dzz wp=wt+dxw-dzw else xp=xt-xo yp=yt-yo zp=zt-zo wp=wt-wo dd=sqrt(xp*xp+yp*yp+zp*zp+wp*wp) xp=xt-dzx+dxx*dd yp=yt-dzy+dxy*dd zp=zt-dzz+dxz*dd wp=wt-dzw+dxw*dd endif ldir=1 di=0 p=2 else if @smart shxs=xss shys=yss shzs=zss shws=wss else shxs=xs shys=ys shzs=zs shws=ws endif shxb=xb shyb=yb shzb=zb shwb=wb shxsb=xsb shysb=ysb shzsb=zsb shwsb=wsb shv=v if @light<5 zs=1.0/dtl xs=-r2c0*zs ys=-r2c1*zs zs=-r2c2*zs ws=zs*s1 zs=zs*c1 else xs=px-xt ys=py-yt zs=shz-zt ws=shw-wt if (s2=dtl*sqrt(xs*xs+ys*ys+zs*zs+ws*ws))6 shadow=found xs=shxs ys=shys zs=shzs ws=shws if @smart xss=xs yss=ys zss=zs wss=ws endif xb=shxb yb=shyb zb=shzb wb=shwb xsb=shxsb ysb=shysb zsb=shzsb wsb=shwsb v=shv if @usedensity xp=x0 yp=y0 zp=z0-ldz wp=w0-ldw elseif @f<1e-5 xp=x0+dxx-dzx yp=y0+dxy-dzy zp=z0+dxz-dzz wp=w0+dxw-dzw else xp=x0-xo yp=y0-yo zp=z0-zo wp=w0-wo dd=sqrt(xp*xp+yp*yp+zp*zp+wp*wp) xp=x0-dzx+dxx*dd yp=y0-dzy+dxy*dd zp=z0-dzz+dxz*dd wp=w0-dzw+dxw*dd endif ldir=1 di=0 p=2 endif elseif @usedensity if @method==0 sq=log(sq) else sq=-log(1.0+sq) endif if p==2 if @method==0 if j<2 x1=y1=z1=j+real(lb-log(0.5*sq))*ilp else x1=y1=z1=j+real(lb-log(0.5*sq))/log(sq/log(sqo)) endif else x1=y1=z1=sq endif xp=x0-@ldelta yp=y0 zp=z0-ldz wp=w0-ldw ldir=1 di=0 p=3 elseif p==3 if @method==0 if j<2 x1=x1-j-real(lb-log(0.5*sq))*ilp else x1=x1-j-real(lb-log(0.5*sq))/log(sq/log(sqo)) endif else x1=x1-sq endif xp=x0 yp=y0-@ldelta zp=z0-ldz wp=w0-ldw ldir=1 di=0 p=4 elseif p==4 if @method==0 if j<2 y1=y1-j-real(lb-log(0.5*sq))*ilp else y1=y1-j-real(lb-log(0.5*sq))/log(sq/log(sqo)) endif else y1=y1-sq endif xp=x0 yp=y0 zp=z0-2.0*ldz wp=w0-2.0*ldw ldir=1 di=0 p=6 elseif p==6 if @method==0 if j<2 z1=z1-j-real(lb-log(0.5*sq))*ilp else z1=z1-j-real(lb-log(0.5*sq))/log(sq/log(sqo)) endif else z1=z1-sq endif p=-1 endif elseif p==2 if found==true x1=xt y1=yt z1=zt*c1+wt*s1 else x1=xc y1=yc z1=zc*c1+wc*s1 endif if @f<1e-5 xp=xp-2*dxx yp=yp-2*dxy zp=zp-2*dxz wp=wp-2*dxw else xp=x0-2*dxx*dd yp=y0-2*dxy*dd zp=z0-2*dxz*dd wp=w0-2*dxw*dd endif ldir=1 di=0 p=3 elseif p==3 if found==true x2=xt y2=yt z2=zt*c1+wt*s1 else x2=xc y2=yc z2=zc*c1+wc*s1 endif if @f<1e-5 xp=xp+dxx+dyx yp=yp+dxy+dyy zp=zp+dxz+dyz wp=wp+dxw+dyw else xp=x0+(dxx+dyx)*dd yp=y0+(dxy+dyy)*dd zp=z0+(dxz+dyz)*dd wp=w0+(dxw+dyw)*dd endif ldir=1 di=0 p=4 elseif p==4 if found==true x3=xt y3=yt z3=zt*c1+wt*s1 else x3=xc y3=yc z3=zc*c1+wc*s1 endif if @f<1e-5 xp=xp-2*dyx yp=yp-2*dyy zp=zp-2*dyz wp=wp-2*dyw else xp=x0-2*dyx*dd yp=y0-2*dyy*dd zp=z0-2*dyz*dd wp=w0-2*dyw*dd endif ldir=1 di=0 p=5 elseif p==5 if found==true x4=xt y4=yt z4=zt*c1+wt*s1 else x4=xc y4=yc z4=zc*c1+wc*s1 found=true endif p=-1 endif endif until p<0 if found==true if @colour==3 z=fn1(sqrt((xt-xo)^2+(yt-yo)^2+(zt*c1+wt*s1-zzo)^2)) ; check this zzzzzz elseif @colour==2 x=xt y=yt zz=zt w=wt elseif @colour==1 if @axes==0 x=xt y=yt zz=zt w=wt elseif @axes==1 ;"X,Y,W,Z" x=xt y=yt zz=wt w=zt elseif @axes==2 ;"X,Z,Y,W" x=xt y=zt zz=yt w=wt elseif @axes==3 ;"X,Z,W,Y" x=xt y=zt zz=wt w=yt elseif @axes==4 ;"X,W,Y,Z" x=xt y=wt zz=yt w=zt elseif @axes==5 ;"X,W,Z,Y" x=xt y=wt zz=zt w=yt elseif @axes==6 ;"Y,X,Z,W" x=yt y=xt zz=zt w=wt elseif @axes==7 ;"Y,X,W,Z" x=yt y=xt zz=wt w=zt elseif @axes==8 ;"Y,Z,X,W" x=yt y=zt zz=xt w=wt elseif @axes==9 ;"Y,Z,W,X" x=yt y=zt zz=wt w=xt elseif @axes==10 ;"Y,W,X,Z" x=yt y=wt zz=xt w=zt elseif @axes==11 ;"Y,W,Z,X" x=yt y=wt zz=zt w=xt elseif @axes==12 ;"Z,X,Y,W" x=zt y=xt zz=yt w=wt elseif @axes==13 ;"Z,X,W,Y" x=zt y=xt zz=wt w=yt elseif @axes==14 ;"Z,Y,X,W" x=zt y=yt zz=xt w=wt elseif @axes==15 ;"Z,Y,W,X" x=zt y=yt zz=wt w=xt elseif @axes==16 ;"Z,W,X,Y" x=zt y=wt zz=xt w=yt elseif @axes==17 ;"Z,W,Y,X" x=zt y=wt zz=yt w=xt elseif @axes==18 ;"W,X,Y,Z" x=wt y=xt zz=yt w=zt elseif @axes==19 ;"W,X,Z,Y" x=wt y=xt zz=zt w=yt elseif @axes==20 ;"W,Y,X,Z" x=wt y=yt zz=xt w=zt elseif @axes==21 ;"W,Y,Z,X" x=wt y=yt zz=zt w=xt elseif @axes==22 ;"W,Z,X,Y" x=wt y=zt zz=xt w=yt elseif @axes==23 ;"W,Z,Y,X" x=wt y=zt zz=yt w=xt endif o=x+flip(y) cc=zz+flip(w) if @fractal==2 as=3*o^2 elseif @fractal==8 lo=o endif endif if @colour>0 && @colour<3 if @inside==0 z=fn1(x+flip(y)) elseif @inside==1 z=fn1(x*x+y*y+flip(zz*zz+w*w)) elseif @inside==2 z=fn1(sqr(x*x+y*y)+flip(sqr(zz*zz+w*w))) elseif @inside==3 z=fn1(x+flip(zz)) elseif @inside==4 z=fn1(x+flip(w)) elseif @inside==5 z=fn1(y+flip(x)) elseif @inside==6 z=fn1(y+flip(zz)) elseif @inside==7 z=fn1(y+flip(w)) elseif @inside==8 z=fn1(zz+flip(x)) elseif @inside==9 z=fn1(zz+flip(y)) elseif @inside==10 z=fn1(zz+flip(w)) elseif @inside==11 z=fn1(w+flip(x)) elseif @inside==12 z=fn1(w+flip(y)) elseif @inside==13 z=fn1(w+flip(zz)) elseif @inside==14 z=fn1(x+flip(sqrt(y*y+zz*zz+w*w))) endif elseif @colour==0 if @usedensity z0=1.0/sqrt(x1*x1+y1*y1+z1*z1) x0=x1*z0 y0=y1*z0 z0=z1*z0 else xt=x0 yt=y0 zt=z0*c1+w0*s1 z0=zt x5=x0-x4 y5=y0-y4 z5=z0-z4 x4=x3-x0 y4=y3-y0 z4=z3-z0 x3=x0-x2 y3=y0-y2 z3=z0-z2 x2=x1-x0 y2=y1-y0 z2=z1-z0 x0=y2*z4-y4*z2 y0=x4*z2-x2*z4 z0=x2*y4-x4*y2 s2=1.0/sqrt(x0*x0+y0*y0+z0*z0) x0=x0*s2 y0=y0*s2 z0=z0*s2 x1=y2*z5-y5*z2 y1=x5*z2-x2*z5 z1=x2*y5-x5*y2 s2=1.0/sqrt(x1*x1+y1*y1+z1*z1) x1=x1*s2 y1=y1*s2 z1=z1*s2 x2=y3*z4-y4*z3 y2=x4*z3-x3*z4 z2=x3*y4-x4*y3 s2=1.0/sqrt(x2*x2+y2*y2+z2*z2) x2=x2*s2 y2=y2*s2 z2=z2*s2 x4=y3*z5-y5*z3 y4=x5*z3-x3*z5 z4=x3*y5-x5*y3 s2=1.0/sqrt(x4*x4+y4*y4+z4*z4) x4=x4*s2 y4=y4*s2 z4=z4*s2 x0=x0+x1+x2+x4 y0=y0+y1+y2+y4 z0=z0+z1+z2+z4 w0=1.0/sqrt(x0*x0+y0*y0+z0*z0) x0=x0*w0 ;N y0=y0*w0 z0=z0*w0 endif if @light==0 || @light==2 || @light==4 \ || @light==6 || @light==8 if @f<1e-5 x2=x0*m1r2c0+y0*m1r2c1+z0*m1r2c2 ;N.L else x5=xt-xo y5=yt-yo z5=zt-zzo s2=1.0/sqrt(x5*x5+y5*y5+z5*z5) x5=x5*s2 y5=y5*s2 z5=z5*s2 x2=x0*x5+y0*y5+z0*z5 ;N.L endif if x2>1.0 x2=1.0 endif if x2>0 if @f<1e-5 x3=(2*x0*x2-m1r2c0)*m1r2c0 \ +(2*y0*x2-m1r2c1)*m1r2c1 \ +(2*z0*x2-m1r2c2)*m1r2c2 ;(2*N*(N.L)-L).V else x3=(2*x0*x2-x5)*x5 \ +(2*y0*x2-y5)*y5 \ +(2*z0*x2-z5)*z5 ;(2*N*(N.L)-L).V endif if x3<0 x3=0 elseif x3>1 x3=1 endif if @diffuse<0 x2=-0.5*@diffuse*(1+x2) else x2=@diffuse*x2 endif else x3=0 if @diffuse<0 x2=-0.5*@diffuse*(1+x2) else x2=0 endif endif endif if @light==0 w0=@ambient+x2+@specular*x3^@specsize ;Ka+Kd*(N.L)+Ks*(R.V)^n if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+abs(@diffuse)+@specular) else z=w0 endif else if @light<5 ;Remote x1=r2c0 ;L y1=r2c1 z1=r2c2 else ;Point x1=xt-px y1=yt-py z1=zt-pz s2=1.0/sqrt(x1*x1+y1*y1+z1*z1) x1=x1*s2 ;L y1=y1*s2 z1=z1*s2 endif w0=x0*x1+y0*y1+z0*z1 ;N.L if w0>1.0 w0=1.0 endif if w0>0 if @f>=1e-5 && (@light==1 || @light==3 || @light==5 \ || @light==7) x5=xt-xo y5=yt-yo z5=zt-zzo s2=1.0/sqrt(x5*x5+y5*y5+z5*z5) x5=x5*s2 y5=y5*s2 z5=z5*s2 endif if @f>=1e-5 x0=(2*x0*w0-x1)*x5 \ +(2*y0*w0-y1)*y5 \ +(2*z0*w0-z1)*z5 ;(2*N*(N.L)-L).V else x0=(2*x0*w0-x1)*m1r2c0 \ +(2*y0*w0-y1)*m1r2c1 \ +(2*z0*w0-z1)*m1r2c2 ;(2*N*(N.L)-L).V endif if x0<0 x0=0 elseif x0>1 x0=1 endif if @diffuse<0 w0=-0.5*@diffuse*(1+w0) else w0=@diffuse*w0 endif else x0=0 if @diffuse<0 w0=-0.5*@diffuse*(1+w0) else w0=0 endif endif if @light==3 || @light==4 || @light>6 if shadow==true x0=x0*shad w0=w0*shad endif endif if @light==2 || @light==4 || @light==6 || @light==8 w0=@ambient+x2+@specular*x3^@specsize \ +@light4*(w0+@specular*x0^@specsize) if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+(1+@light4)*(abs(@diffuse)+@specular)) else z=w0 endif else w0=@ambient+w0+@specular*x0^@specsize ;Ka+Kd*(N.L)+Ks*(R.V)^n if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+abs(@diffuse)+@specular) else z=w0 endif endif endif endif endif else ; found (clipped) found = false endif loop: if @colour==1 && found==true ; oo=o o=@fn2(o) if @fractal==0 o=o^@k+cc elseif @fractal==1 o=((@k-1)*o^@k+cc)/(@k*o^(@k-1)) elseif @fractal==2 o=o^3-as*o+cc elseif @fractal==3 o=fn3(o)+cc elseif @fractal==4 o=fn3(o)+o^@k+cc elseif @fractal==5 o=fn3(o)*o^@k+cc elseif @fractal==6 o=cc*o*(1-o) elseif @fractal==7 o=o*(1-o)+cc elseif @fractal==8 o=o^@k+lo+cc lo=oo endif x=real(o) y=imag(o) ; if @converge==1 ; sq=1/|o-oo| ; else ; sq=|o| ; endif if @inside==0 z=fn1(x+flip(y)) elseif @inside==1 z=fn1(x*x+y*y+flip(zz*zz+w*w)) elseif @inside==2 z=fn1(sqr(x*x+y*y)+flip(sqr(zz*zz+w*w))) elseif @inside==3 z=fn1(x+flip(zz)) elseif @inside==4 z=fn1(x+flip(w)) elseif @inside==5 z=fn1(y+flip(x)) elseif @inside==6 z=fn1(y+flip(zz)) elseif @inside==7 z=fn1(y+flip(w)) elseif @inside==8 z=fn1(zz+flip(x)) elseif @inside==9 z=fn1(zz+flip(y)) elseif @inside==10 z=fn1(zz+flip(w)) elseif @inside==11 z=fn1(w+flip(x)) elseif @inside==12 z=fn1(w+flip(y)) elseif @inside==13 z=fn1(w+flip(zz)) elseif @inside==14 z=fn1(x+flip(sqrt(y*y+zz*zz+w*w))) endif endif bailout: found==true default: title = "Solid-3D Complex" helpfile = "MMF.html" center = (0, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 10 param fractal caption = "Fractal type" default = 0 enum = "z^n+c" "Newton (^n)" "Cubic" "fn3(z)+c" "fn3(z)+z^n+c" "fn3(z)*z^n+c" \ "Lambda" "Breeder" "z^n+oldz+c" endparam param k caption = "Power" default = (2,0) hint = "Power for the fractals that use it, \ e.g. z^n, fn3(z)+z^n, Newton etc." endparam param converge caption = "Bailout type" default = 0 enum = "Divergent" "Convergent" hint = "Some options (eg. Newton) require Convergent detection." endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 hint = "Defines how soon an orbit bails out \ i.e. is considered as tending to the infinite attractor. \ When using Convergent bailout the reciprocal of cabs(z-zold)^2 \ is tested against this value." endparam param txy caption = "Target X and Y coord" default = (0,0) hint = "Note that using the dropper only works \ properly when the 3D rotations are zero." endparam param tz caption = "Target Zcoord" default = 0.0 endparam param r caption = "View-plane distance" default = 0.0 hint = "Sets the distance of the view-plane from the target. \ In parallel projection mode the view plane is also the \ front-clipping plane, in perspective projection mode it \ controls the perspective along with the magnification and \ the focal length." endparam param r1 caption = "Front-clipping distance" default = 2.0 hint = "Sets the distance of the front-clipping plane from the \ target when using perspective projection. You can set \ the front-clipping plane to be at a position either \ nearer the target or nearer the camera than the view-plane." endparam param view caption = "Viewing range" default = 4.0 min = 0.1 hint = "This is the maximum distance to \ scan from the front-clipping plane." endparam param f caption = "Focal length" default = 12.0 min = 0.0 hint = "Use to adjust the focal length of the camera, a value of zero \ will cause parallel projection to be used instead of perspective \ projection. In perspective projection mode this sets the distance \ of the camera from the view-plane." endparam param trackin caption = "Track in/out" default = 1.0 hint = "In perspective viewing mode this allows you to track the camera in \ and out, 1.0 is the default position and values >1 track away \ and values <1 track towards. In parallel viewing mode it's simply \ a magnification factor giving the effect of tracking the camera \ but in this case values between 0 and 1 track towards the camera \ i.e. magnify, and values >1 track away from the camera." endparam param cutlr caption = "Cut left/right ?" default = false endparam param leftcut caption = "Left cut" default = -1.0 endparam param rightcut caption = "Right cut" default = 1.0 endparam param cuttb caption = "Cut top/btm ?" default = false endparam param btmcut caption = "Bottom cut" default = -1.0 endparam param topcut caption = "Top cut" default = 1.0 endparam param cutfb caption = "Cut front/back ?" default = false endparam param frontcut caption = "Front cut" default = -1.0 endparam param backcut caption = "Back cut" default = 1.0 endparam param cutscale caption = "Plane cut scale" default = 1.0 hint = "Provides a way of scaling the cut planes/box for ease of animation." endparam param cutcentre caption = "Plane cut centre (x,y)" default = (0,0) hint = "Provides a quick way of recentreing the cutting planes." endparam param cutcentre1 caption = "Plane cut centre z" default = 0.0 hint = "Provides a quick way of recentreing the cutting planes." endparam param movecut caption = "Move cut planes" default = false hint = "When enabled the plane cut centre is adjusted to be offset from \ the current target coords." endparam param rotcut caption = "Rotate cut with camera" default = false endparam param cutrot1 caption = "Cut plane elevation" default = 0.0 endparam param cutrot2 caption = "Cut plane direction" default = 0.0 endparam param cutsphere caption = "Cut to sphere" default = false endparam param rcut caption = "Cut radius" default = 1.0 endparam param spherecentre caption = "Sphere (x,y)" default = (0,0) endparam param spherecentre1 caption = "Sphere z" default = 0.0 endparam param movesphere caption = "Move cut sphere" default = false hint = "When enabled the cut sphere centre is offset from the target." endparam param rotsphere caption = "Rotate cut sphere" default = false hint = "When enabled the sphere rotates around the target with the camera." endparam param clipall caption = "Clip all" default = true hint = "If enabled the fractal is clipped both spherically and to the \ cutting planes i.e. only areas not clipped by either method are \ visible. When disabled the two clipping are treated \ separately i.e. only areas clipped by both methods are removed." endparam param detail caption = "Detail level" default = 10.0 min = 2.0 hint = "Higher values produce more accuracy, use values \ under 40 for speed, more for detail. Around \ 100 produces reasonable final results at up to #maxiter 10. \ A #maxiter of 20 may require a value of 1000 or more ! \ You won't need values anywhere near so high when using 'Smart \ step' - in this case you're unlikely to require values over 100." endparam param smart caption = "Smart step" default = false hint = "When enabled the step distance is adjusted based on the iteration \ depth as rays are traced, producing good results at low \ 'Detail level' in quick time, very useful for when setting up. \ Currently only functions properly when using 'Iteration' as the \ solid method." endparam param nobinary caption = "Disable binary search" default = false hint = "Disable the binary search for fast but poor quality rendering." endparam param bindepth caption = "Binary search depth" default = 23 min = 8 max = 23 hint = "Min=8, Max=23. Reducing the value at higher detail levels may \ speed up rendering without visible loss of accuracy." endparam param change caption = "High Detail" default = false hint = "When enabled can vastly improve rendering quality at \ the expense of vastly reducing speed of \ calculation. Actually only worth using for final renders where \ speed of rendering is completely unimportant. Only used when the \ binary search is enabled." endparam param method caption = "Solid method" enum = "Iteration" "Final Z Trap" "Orbit Trap" "Max. Iter. trap" default = 0 hint = "Iteration is the standard method. The Traps consider points to \ be solid when the magnitude of the trapped value for any point \ throughout the iteration is below a minimum." endparam param trapval caption = "Trap Value" default = (0,0) hint = "The value to trap to." endparam param traprot caption = "Trap Rotation" default = 0.0 hint = "Rotates the Trap Value by this number of degrees, useful for \ producing animations." endparam param traptype caption = "Trap type" enum = "Magnitude" "Real" "Imag" "Angle" "Real and Imag" "Real or Imag" default = 0 endparam param useangle caption = "Angle method" enum = "Abs(angle)" "All angles" default = 1 hint = "Only for Trap type Angle" endparam param usethreshold caption = "Use Threshold" default = false hint = "When enabled the distance found is compared to this value. Note \ that the effective range when using Magnitude is >=0, using Real \ and Imag is any value and when using Angle is -pi to +pi." endparam param threshold caption = "Threshold" default = 0.5 hint = "When enabled the distance found is compared to this value. Note \ that the effective range when using Magnitude is >=0, using Real \ and Imag is any value and when using Angle is -pi to +pi." endparam param minval caption = "Minimum value" default = 0.1 min = 0.0 hint = "Distances found below this value are considered to be solid." endparam param solid caption = "Solid condition" enum = "Threshold" "Direction Change" default = 0 hint = "Direction change colours all and \ works faster, useful for when setting \ up position/rotation." endparam param axes caption = "Julibrot axes" default = 0 enum = "Zr,Zi,Cr,Ci" "Zr,Zi,Ci,Cr" "Zr,Cr,Zi,Ci" "Zr,Cr,Ci,Zi" "Zr,Ci,Zi,Cr" "Zr,Ci,Cr,Zi" \ "Zi,Zr,Cr,Ci" "Zi,Zr,Ci,Cr" "Zi,Cr,Zr,Ci" "Zi,Cr,Ci,Zr" "Zi,Ci,Zr,Cr" "Zi,Ci,Cr,Zr" \ "Cr,Zr,Zi,Ci" "Cr,Zr,Ci,Zi" "Cr,Zi,Zr,Ci" "Cr,Zi,Ci,Zr" "Cr,Ci,Zr,Zi" "Cr,Ci,Zi,Zr" \ "Ci,Zr,Zi,Cr" "Ci,Zr,Cr,Zi" "Ci,Zi,Zr,Cr" "Ci,Zi,Cr,Zr" "Ci,Cr,Zr,Zi" "Ci,Cr,Zi,Zr" hint = "Allows you to switch around the order of the 4 axes. Use Cr,Ci,Zr,Zi \ for Mandelbrot-style fractals." endparam param angle1 caption = "X Rot (degrees)" default = 45.0 hint = "Rotation of Y and Z around the X axis. \ (elevation). To get roll - rotation of X \ and Y around the Z axis - use the Rotation \ angle in the location settings." endparam param angle2 caption = "Y Rot (degrees)" default = 0.0 hint = "Rotation of X and Z around the Y axis. \ (direction). To get roll - rotation of X \ and Y around the Z axis - use the Rotation \ angle in the location settings." endparam param angle3 caption = "4D Rot (degrees)" default = 0.0 hint = "Angle of the line in the plane \ of the 3rd and 4th start values, \ used as the Z-axis. \ 0=3rd part (Z), 90=4th part (W)" endparam param offset caption = "4th dimension offset" default = 0.0 hint = "Offsets the 3 dimensions viewed down the current \ 4th dimension. For a 4D rotation of zero this value \ is an offset on the W axis, for a 4D rotation of 90 \ degrees it is an offset on the Z axis." endparam param colour caption = "Colouring" enum = "Lighting" "Inside" "Co-ordinate" "Depth" default = 0 hint = "Use the MMF lighting UCL when using the \ lighting option. Any inside colouring can be \ used to colour the object when using \ Inside or Co-ordinate - NB. colourings or options \ that use #pixel will not remain consistent \ under 3D rotation." endparam param inside caption = "Inside/Co-ordinate" default = 0 enum = "(x,y)" "All squared" "All" "(x,z)" "(x,w)" "(y,x)" "(y,z)" \ "(y,w)" "(z,x)" "(z,y)" "(z,w)" "(w,x)" "(w,y)" "(w,z)" "(x,rest)" hint = "The complex value to be passed as Z \ on each iteration when using Inside colouring, \ or as the value when using Co-ordinate colouring. \ All squared uses (x^2+y^2,z^2+w^2) and All uses the roots \ of the same two values. Only (x,y) really makes sense with \ Inside colouring." endparam param ambient caption = "Ambient light" default = 0.15 min = -1.0 max = 1.0 hint = "The background light level, only relevant for the \ lighting colourings." endparam param diffuse caption = "Diffuse constant" default = 0.55 min = -1.0 max = 1.0 hint = "This value adjusts the proportion of light \ considered to be reflected by a rough surface. \ Use negative values if you wish soft diffuse lighting \ ie. light from the wrong-side of the object to \ have some effect. Only relevant for the \ lighting colourings." endparam param specular caption = "Specular constant" default = 0.3 min = 0 max = 1.0 hint = "This value adjusts the proportion of light \ considered to be reflected by a glassy-smooth \ surface. Only relevant for the \ lighting colourings." endparam param specsize caption = "Specular exponent" default = 5.0 min = 1.0 hint = "This value controls how mirror-like the specular \ reflection is, the larger the value, the more \ mirror-like the reflection. Only relevant for the \ lighting colourings." endparam param clamp caption = "Light value clamp" default = true hint = "When enabled the lighting value is clamped so as to \ fit the colour gradient. This parameter only affects \ the Remote or Point light options. You can produce \ the same result using the Colour Density but this \ option ensures no error." endparam param light caption = "Lighting method" enum = "Camera" "Remote" "Camera+Remote" "Remote+Shadows" "C+R+Shadows" \ "Point" "Camera+Point" "Point+Shadows" "C+P+Shadows" default = 0 hint = "You can light the object using a remote source from the camera \ direction, another remote source from elsewhere or another point \ source or camera and remote or camera and point, or remote with \ shadows, point with shadows or these last two with camera too." endparam param usedensity caption = "Use density" default = false hint = "When disabled the lighting normals are calculated using full \ raytracing for the 4 adjacent rays to the solid found, when \ enabled an alternative method of getting the lighting normals \ using the iteration density is used - this method is generally \ noticeably faster. Only really works when using 'Iteration' as \ the solid method. Best used for speed at low detail levels when \ setting up and not for final renders (it produces better results \ than the ray-tracing method at low detail levels)." endparam param ldelta caption = "Offset for density" default = 1e-14 hint = "This is the offset distance to be used for testing \ the iteration density, it may need adjustment depending on the \ 'Detail' and Max. iter. settings and the overall magnification of \ the fractal object." endparam param lpwr caption = "Divergent power for density" default = 2.0 hint = "This should be set according to the power of the main formula, for \ example 2 for z^2+c or a Newton, 3 for z^3+c etc." endparam param movelight caption = "Track with camera" default = false hint = "When enabled the lighting angles Light1 and Light2 are taken as \ offsets from the camera angles so that when the camera is rotated \ then the light source rotates with it." endparam param light1 caption = "Light 1 (degrees)" default = 60.0 hint = "Independant light elevation. Only relevant for the \ lighting colourings using independant lighting." endparam param light2 caption = "Light 2 (degrees)" default = 30.0 hint = "Independant light direction. Only relevant for the \ lighting colourings using independant lighting." endparam param light3 caption = "Light distance" default = 6.0 hint = "The distance of the light source from the \ camera target. Only relevant for the point \ lighting colouring using independant lighting." endparam param light4 caption = "Relative light" default = 1.0 min = 0.0 hint = "Sets the relative strength of the independant light \ compared to light from the camera. Values < 1 \ make the camera light more significant and values > \ 1 make the independant light more significant. Only applies \ when both light sources are used." endparam param shadow caption = "Depth of shadow" default = 0.5 min = 0.0 max = 1.0 hint = "Sets the darkness of the shadows, using zero is pointless \ as it produces none at all, a value of 1 produces the darkest \ shadows." endparam param rot caption = "Rotation (Rads)" default = (0,0) hint = "For rotation using the switch preview, the real (horizontal) sets \ the direction and the imaginary (vertical) sets the pitch." endparam func fn1 caption = "Inside/Co-ord Fn" default = ident() hint = "Applied to the complex value to be passed to the colouring \ when using the Inside, Co-ordinate or Depth options. In Inside mode \ this function is applied to the complex (z) value used at the \ end of each iteration." endfunc func fn2 caption = "First Fn" default = ident() hint = "Applied to 'Z' at the start of each iteration. \ Note that some settings require a larger bailout \ value and others will require the Convergent bailout method." endfunc func fn3 caption = "Function fn3" default = sin() hint = "Fn3 for the fractal types that use it, eg. fn3(z), fn3(z)+z^n. \ Note that some settings require a larger bailout \ value and others will require the Convergent bailout method." endfunc switch: type = "MMFr-Solid3DComplex" fractal = fractal k = k converge = converge bailout = bailout txy = txy tz = tz r = r r1 = r1 view = view f = f trackin = trackin cutlr = cutlr leftcut = leftcut rightcut = rightcut cuttb = cuttb topcut = topcut btmcut = btmcut cutfb = cutfb frontcut = frontcut backcut = backcut cutscale = cutscale cutcentre = cutcentre cutcentre1 = cutcentre1 movecut = movecut rotcut = rotcut cutrot1 = cutrot1 cutrot2 = cutrot2 cutsphere = cutsphere rcut = rcut spherecentre = spherecentre spherecentre1 = spherecentre1 movesphere = movesphere rotsphere = rotsphere clipall = clipall detail = detail smart = smart nobinary = nobinary bindepth = bindepth change = change method = method trapval = trapval traprot = traprot traptype = traptype useangle = useangle usethreshold = usethreshold threshold = threshold minval = minval solid = solid axes = axes angle1 = angle1 angle2 = angle2 angle3 = angle3 offset = offset colour = colour inside = inside ambient = ambient diffuse = diffuse specular = specular specsize = specsize clamp = clamp light = light usedensity = usedensity ldelta = ldelta lpwr = lpwr movelight = movelight light1 = light1 light2 = light2 light3 = light3 light4 = light4 shadow = shadow rot = #pixel fn1 = fn1 fn2 = fn2 fn3 = fn3 } MMFs-Solid3DPoly { ; ; Solid 3D polynomials ; (c) Dave Makin (Makin' Magic) ; http://www.crosswinds.net/~makinmagic/ ; http://website.lineone.net/~dave_makin/ ; http://skyscraper.fortunecity.com/terabyte/966/ ; ; Updated 24th September 2001 - added the ability ; to rotate the fractals using the switch-preview. ; ; Created 5th June 2001 ; init: float a=#pi/180.0 float twopi = 2.0*#pi float cs = @traprot*a float sn = sin(cs) float cs = cos(cs) complex tval = real(@trapval)*cs-imag(@trapval)*sn \ +flip(real(@trapval)*sn+imag(@trapval)*cs) complex z=cc=oo=(0,0) complex F = @L0 complex F0 = @L0 complex F1 = @L1 int n = 0 if @fractal>19 && @fractal<24 complex kp1 = @k + 1 elseif @fractal>23 && @fractal<28 complex km1 = @k - 1 complex k2m2 = 2*km1 elseif @fractal>27 && @fractal<32 complex albe = @al + @be complex albe1 = albe + 1 complex albe2 = albe + 2 complex al2be2 = albe*(@al - @be) complex j1 = @al + 1 - albe2/2 elseif @fractal==16 || @fractal==17 complex cp1 = @k elseif @fractal==18 || @fractal==19 complex cm1 = @k complex c2m2 = @k elseif @fractal==32 || @fractal==33 complex cbe = @k complex cbe1 = @k complex cbe2 = @k complex c2be2 = @k complex j2 = @k elseif @fractal==34 || @fractal==35 complex alc = @k complex alc1 = @k complex alc2 = @k complex al2c2 = @k complex j3 = @k endif float a1=a*@angle1 + imag(@rot) float a2=a*@angle2 - real(@rot) float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float m1r0c0=c2 float m1r0c1=0 float m1r0c2=-s2 float m1r1c0=s1*s2 float m1r1c1=c1 float m1r1c2=s1*c2 float m1r2c0=c1*s2 float m1r2c1=-s1 float m1r2c2=c1*c2 float dtl=@detail if @smart dtl=0.1*(@detail+8.0) endif if @colour==0 float x0=0 float y0=0 float z0=0 float w0=0 float x1=0 float y1=0 float z1=0 float x2=0 float y2=0 float z2=0 float x3=0 float y3=0 float z3=0 float x4=0 float y4=0 float z4=0 float x5=0 float y5=0 float z5=0 if @light>0 if @movelight a1=a1+a*@light1 a2=a2+a*@light2 else a1=a*@light1 a2=a*@light2 endif c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) float r0c0=c2 float r0c1=0 float r0c2=-s2 float r1c0=s1*s2 float r1c1=c1 float r1c2=s1*c2 float r2c0=c1*s2 float r2c1=-s1 float r2c2=c1*c2 endif if @light==3 || @light==4 || @light>6 float shxs=0 float shys=0 float shzs=0 float shws=0 float shxb=0 float shyb=0 float shzb=0 float shwb=0 float shxsb=0 float shysb=0 float shzsb=0 float shwsb=0 float shv=0 bool shadow=false float shad=(1-@shadow) endif endif bool clipped = @cutlr || @cuttb || @cutfb if clipped && (@cutrot1!=0.0 || @cutrot2!=0.0) float cs1 = 0.0 cs = @cutrot1*a cs1 = @cutrot2*a sn = sin(cs) cs = cos(cs) float sn1 = sin(cs1) cs1 = cos(cs1) float cr0c0=cs1 float cr0c1=0.0 float cr0c2=-sn1 float cr1c0=sn*sn1 float cr1c1=cs float cr1c2=sn*cs1 float cr2c0=cs*sn1 float cr2c1=-sn float cr2c2=cs*cs1 endif a=a*@angle3 s1=sin(a) c1=cos(a) if @colour==0 float d=1/(160*#magn) float dzx=2*m1r2c0*d float dzy=2*m1r2c1*d float dzz=2*m1r2c2*d*c1 float dzw=2*m1r2c2*d*s1 if @f<1e-5 float dxx=m1r0c0*d float dxy=m1r0c1*d float dxz=m1r0c2*d*c1 float dxw=m1r0c2*d*s1 float dyx=m1r1c0*d float dyy=m1r1c1*d float dyz=m1r1c2*d*c1 float dyw=m1r1c2*d*s1 else float dd=d/@f float dxx=m1r0c0*dd float dxy=m1r0c1*dd float dxz=m1r0c2*dd*c1 float dxw=m1r0c2*dd*s1 float dyx=m1r1c0*dd float dyy=m1r1c1*dd float dyz=m1r1c2*dd*c1 float dyw=m1r1c2*dd*s1 dd = 0.0 endif endif complex o=#pixel-#center float x=real(o) float y=imag(o) bool found=false float v=@view float alpha = 1e200 float beta = 0.0 float aval = 0.0 float lcut = @leftcut*@cutscale+real(@cutcentre) float rcut = @rightcut*@cutscale+real(@cutcentre) float tcut = @topcut*@cutscale+imag(@cutcentre) float bcut = @btmcut*@cutscale+imag(@cutcentre) float fcut = @frontcut*@cutscale+@cutcentre1 float bkcut = @backcut*@cutscale+@cutcentre1 if @movecut lcut = lcut + real(@txy) rcut = rcut + real(@txy) tcut = tcut + imag(@txy) bcut = bcut + imag(@txy) fcut = fcut + @tz bkcut = bkcut + @tz endif float xcc = 0.0 float ycc = 0.0 float zcc = 0.0 float xss = 0.0 float yss = 0.0 float zss = 0.0 float wss = 0.0 float ccc = 0.0 if @f<1e-5 float xc=real(#center)+@trackin*(x*m1r0c0+y*m1r1c0)+real(@txy)-@r*m1r2c0 float yc=imag(#center)+@trackin*(x*m1r0c1+y*m1r1c1)+imag(@txy)-@r*m1r2c1 float zc=@trackin*(x*m1r0c2+y*m1r1c2)+@tz-@r*m1r2c2 float xs=m1r2c0 float ys=m1r2c1 float zs=m1r2c2 float xo float yo if clipped if (@cutrot1==0.0 && @cutrot2==0.0 && !@rotcut) xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs else xo = real(@txy) yo = imag(@txy) if @rotcut xcc=real(#center)+@trackin*x+xo ycc=imag(#center)+@trackin*y+yo zcc=@tz-@r xss = 0.0 yss = 0.0 zss = 1.0 else xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs endif if @cutrot1!=0.0 || @cutrot2!=0.0 aval = xo+(xcc-xo)*cr0c0 + (ycc-yo)*cr1c0 + (zcc-@tz)*cr2c0 ccc = yo+(xcc-xo)*cr0c1 + (ycc-yo)*cr1c1 + (zcc-@tz)*cr2c1 zcc = @tz+(xcc-xo)*cr0c2 + (ycc-yo)*cr1c2 + (zcc-@tz)*cr2c2 xcc = aval ycc = ccc aval = xss*cr0c0 + yss*cr1c0 + zss*cr2c0 ccc = xss*cr0c1 + yss*cr1c1 + zss*cr2c1 zss = xss*cr0c2 + yss*cr1c2 + zss*cr2c2 xss = aval yss = ccc endif endif endif if clipped || @cutsphere bool clr = @cutlr bool ctb = @cuttb bool cfb = @cutfb if abs(xss)<=1e-19 if @cutlr && (xccrcut) found = true else clr = false endif endif if abs(yss)<=1e-19 if @cuttb && (ycc>tcut || yccbkcut) found = true else cfb = false endif endif clipped = clr || ctb || cfb if !found && (clipped || @cutsphere) if clr && abs(xss)>1e-20 aval=(lcut-xcc)/xss if ctb xo = ycc+aval*yss endif if cfb yo = zcc+aval*zss endif if (!ctb || (xo<=tcut && xo>=bcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) alpha = aval beta = aval endif aval=(rcut-xcc)/xss if ctb xo = ycc+aval*yss endif if cfb yo = zcc+aval*zss endif if (!ctb || (xo<=tcut && xo>=bcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif endif if ctb && abs(yss)>1e-20 aval=(tcut-ycc)/yss if clr xo = xcc+aval*xss endif if cfb yo = zcc+aval*zss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif aval=(bcut-ycc)/yss if clr xo = xcc+aval*xss endif if cfb yo = zcc+aval*zss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif endif if cfb && abs(zss)>1e-20 aval=(fcut-zcc)/zss if clr xo = xcc+aval*xss endif if ctb yo = ycc+aval*yss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!ctb || (yo<=tcut && yo>=bcut)) if avalbeta beta = aval endif endif aval=(bkcut-zcc)/zss if clr xo = xcc+aval*xss endif if ctb yo = ycc+aval*yss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!ctb || (yo<=tcut && yo>=bcut)) if avalbeta beta = aval endif endif endif if @clipall && clipped && alpha>1e199 found = true elseif @cutsphere ccc = @spherecentre1 xo = real(@spherecentre) yo = imag(@spherecentre) if @movesphere xo = xo + real(@txy) yo = yo + imag(@txy) ccc = ccc + @tz endif float aa = 0.0 float bb = 0.0 if @rotsphere xo = xo-real(@txy) yo = yo-imag(@txy) ccc = ccc - @tz aa = real(@txy)+xo*m1r0c0+yo*m1r1c0+ccc*m1r2c0 bb = imag(@txy)+xo*m1r0c1+yo*m1r1c1+ccc*m1r2c1 ccc = @tz+xo*m1r0c2+yo*m1r1c2+ccc*m1r2c2 xo = aa yo = bb endif ccc = zc - ccc xo = xc - xo yo = yc - yo aa = 2.0*(xs*xs + ys*ys + zs*zs) bb = 2.0*(xs*xo+ys*yo+zs*ccc) ccc = bb*bb - 2.0*aa*(xo*xo + yo*yo + ccc*ccc - @rcut) if ccc<0.0 if @clipall found = true endif else aa = 1.0/aa xo = aa*(-bb + sqrt(ccc)) yo = aa*(-bb - sqrt(ccc)) if @clipall || !clipped if alpha>1e199 alpha = 0.0 beta = v endif if (xo>=beta && yo>=beta) || (xo<=alpha && yo<=alpha) found = true elseif xoalpha alpha = xo endif if yoalpha alpha = yo endif if xobeta beta = yo endif else if yobeta beta = xo endif endif endif endif if !found if alpha>=v || beta<=0.0 || alpha>beta found = true else if alpha>0.0 xc = xc + alpha*xs yc = yc + alpha*ys zc = zc + alpha*zs else alpha = 0.0 endif if beta>v beta=v endif v = beta - alpha endif endif endif endif if !found v = v*dtl float ws = 1.0/dtl xs = xs*ws ys = ys*ws zs = zs*ws ws=zs*s1 zs=zs*c1 float wc=zc*s1 zc=zc*c1 if @offset>0 zc=zc-@offset*s1 wc=wc+@offset*c1 endif xo=xc yo=yc float zzo=zc*c1+wc*s1 endif else float xo=real(#center)+real(@txy)-(@r+@f)*m1r2c0 float yo=imag(#center)+imag(@txy)-(@r+@f)*m1r2c1 float zo=@tz-(@r+@f)*m1r2c2 float wc = 0.0 float wo = 0.0 if @trackin!=1.0 wc = 1.0 - @trackin xo = xo + wc*m1r2c0 yo = yo + wc*m1r2c1 zo = zo + wc*m1r2c2 endif float xs=x*m1r0c0+y*m1r1c0+@f*m1r2c0 float ys=x*m1r0c1+y*m1r1c1+@f*m1r2c1 float zs=x*m1r0c2+y*m1r1c2+@f*m1r2c2 float zc = (@r+@f-@r1+@trackin-1)/@f float xc=xo+xs*zc float yc=yo+ys*zc float zc=zo+zs*zc float s2=1.0/sqrt(xs*xs+ys*ys+zs*zs) xs=xs*s2 ys=ys*s2 zs=zs*s2 if clipped if (@cutrot1==0.0 && @cutrot2==0.0 && !@rotcut) xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs else wc = real(@txy) wo = imag(@txy) if @rotcut xss = x yss = y zss = @f zcc = (@r+@f-@r1+@trackin-1)/@f xcc=real(#center)+wc+xss*zcc ycc=imag(#center)+wo+yss*zcc zcc=@tz-(@r+@f)+zss*zcc if @trackin!=1.0 zcc = zcc + 1.0 - @trackin endif xss=xss*s2 yss=yss*s2 zss=zss*s2 else xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs endif if @cutrot1!=0.0 || @cutrot2!=0.0 aval = wc+(xcc-wc)*cr0c0 + (ycc-wo)*cr1c0 + (zcc-@tz)*cr2c0 ccc = wo+(xcc-wc)*cr0c1 + (ycc-wo)*cr1c1 + (zcc-@tz)*cr2c1 zcc = @tz+(xcc-wc)*cr0c2 + (ycc-wo)*cr1c2 + (zcc-@tz)*cr2c2 xcc = aval ycc = ccc aval = xss*cr0c0 + yss*cr1c0 + zss*cr2c0 ccc = xss*cr0c1 + yss*cr1c1 + zss*cr2c1 zss = xss*cr0c2 + yss*cr1c2 + zss*cr2c2 xss = aval yss = ccc endif endif endif if clipped || @cutsphere bool clr = @cutlr bool ctb = @cuttb bool cfb = @cutfb if abs(xss)<=1e-19 if @cutlr && (xccrcut) found = true else clr = false endif endif if abs(yss)<=1e-19 if @cuttb && (ycc>tcut || yccbkcut) found = true else cfb = false endif endif clipped = clr || ctb || cfb if !found && (clipped || @cutsphere) if clr && abs(xss)>1e-20 aval=(lcut-xcc)/xss if ctb wc = ycc+aval*yss endif if cfb wo = zcc+aval*zss endif if (!ctb || (wc<=tcut && wc>=bcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) alpha = aval beta = aval endif aval=(rcut-xcc)/xss if ctb wc = ycc+aval*yss endif if cfb wo = zcc+aval*zss endif if (!ctb || (wc<=tcut && wc>=bcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif endif if ctb && abs(yss)>1e-20 aval=(tcut-ycc)/yss if clr wc = xcc+aval*xss endif if cfb wo = zcc+aval*zss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif aval=(bcut-ycc)/yss if clr wc = xcc+aval*xss endif if cfb wo = zcc+aval*zss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif endif if cfb && abs(zss)>1e-20 aval=(fcut-zcc)/zss if clr wc = xcc+aval*xss endif if ctb wo = ycc+aval*yss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!ctb || (wo<=tcut && wo>=bcut)) if avalbeta beta = aval endif endif aval=(bkcut-zcc)/zss if clr wc = xcc+aval*xss endif if ctb wo = ycc+aval*yss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!ctb || (wo<=tcut && wo>=bcut)) if avalbeta beta = aval endif endif endif if @clipall && clipped && alpha>1e199 found = true elseif @cutsphere ccc = @spherecentre1 wc = real(@spherecentre) wo = imag(@spherecentre) if @movesphere wc = wc + real(@txy) wo = wo + imag(@txy) ccc = ccc + @tz endif float aa = 0.0 float bb = 0.0 if @rotsphere wc = wc-real(@txy) wo = wo-imag(@txy) ccc = ccc - @tz aa = real(@txy)+wc*m1r0c0+wo*m1r1c0+ccc*m1r2c0 bb = imag(@txy)+wc*m1r0c1+wo*m1r1c1+ccc*m1r2c1 ccc = @tz+wc*m1r0c2+wo*m1r1c2+ccc*m1r2c2 wc = aa wo = bb endif ccc = zc - ccc wc = xc - wc wo = yc - wo float aa = 2.0*(xs*xs + ys*ys + zs*zs) float bb = 2.0*(xs*wc+ys*wo+zs*ccc) ccc = bb*bb - 2.0*aa*(wc*wc + wo*wo + ccc*ccc - @rcut) if ccc<0.0 if @clipall found = true endif else aa = 1.0/aa wc = aa*(-bb + sqrt(ccc)) wo = aa*(-bb - sqrt(ccc)) if @clipall || !clipped if alpha>1e199 alpha = 0.0 beta = v endif if (wc>=beta && wo>=beta) || (wc<=alpha && wo<=alpha) found = true elseif wcalpha alpha = wc endif if woalpha alpha = wo endif if wcbeta beta = wo endif else if wobeta beta = wc endif endif endif endif if !found if alpha>=v || beta<=0.0 || alpha>beta found = true else if alpha>0.0 xc = xc + alpha*xs yc = yc + alpha*ys zc = zc + alpha*zs else alpha = 0.0 endif if beta>v beta=v endif v = beta - alpha endif endif endif endif if !found v = v*dtl wc = 1.0/dtl xs = xs*wc ys = ys*wc zs = zs*wc wc=zc*s1 zc=zc*c1 if @offset>0 zc=zc-@offset*s1 wc=wc+@offset*c1 endif wo=zo*s1 zo=zo*c1 if @offset>0 zo=zo-@offset*s1 wo=wo+@offset*c1 endif float zzo=zo*c1+wo*s1 float ws=zs*s1 zs=zs*c1 endif endif if !found if @colour==0 && @light>4 float px=real(#center)+real(@txy)-@light3*r2c0 float py=imag(#center)+imag(@txy)-@light3*r2c1 float pz=@tz-@light3*r2c2 if @light<7 if @offset>0 s2=pz*s1+@offset*c1 pz=pz*c1-@offset*s1 pz=pz*c1+s2*s1 endif else float shz=pz*c1 float shw=pz*s1 if @offset>0 shz=shz-@offset*s1 shw=shw+@offset*c1 pz=shz*c1+shw*s1 endif endif endif float xb=0.0000152587890625*xs float yb=0.0000152587890625*ys float zb=0.0000152587890625*zs float wb=0.0000152587890625*ws xss = xs yss = ys zss = zs wss = ws float xsb=0.5*xs float ysb=0.5*ys float zsb=0.5*zs float wsb=0.5*ws float xsub=xsb float ysub=ysb float zsub=zsb float wsub=wsb float xt=xc float yt=yc float zt=zc float wt=wc float sq=0 float xi=0 float yi=0 float zi=0 float zz=0 float w=wc int j=0 int k=0 float lsq=0 float min = 0.0 float min1=0.0 complex tv=(0,0) float ldir=@bailout*@bailout float ldir1=ldir float ldir2=ldir int di=65536 int di1=di float i=0.0 int s=0 int p=0 float xp=xc float yp=yc float zp=zc float wp=wc bool b=true if @colour>0 p=-1 endif repeat i=0.0 found=false xc=xp yc=yp zc=zp wc=wp repeat s=0 repeat if s==0 ;iterate at current step b=true ;ready for binary search x=xc y=yc zz=zc w=wc elseif s==1 ;iterate at current step + a bit k=j lsq=sq if @smart x=xc+xs*0.0000152587890625 y=yc+ys*0.0000152587890625 zz=zc+zs*0.0000152587890625 w=wc+ws*0.0000152587890625 else x=xc+xb y=yc+yb zz=zc+zb w=wc+wb endif elseif s==2 && b ;initiate binary search if @solid==1 found=true endif if @smart xsub=0.5*xs ysub=0.5*ys zsub=0.5*zs wsub=0.5*ws else xsub=xsb ysub=ysb zsub=zsb wsub=wsb endif xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub x=xt y=yt zz=zt w=wt elseif s<@bindepth ;complete binary search if b xsub=0.5*xsub ysub=0.5*ysub zsub=0.5*zsub wsub=0.5*wsub if ldir2<0 xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub else xt=xt+xsub yt=yt+ysub zt=zt+zsub wt=wt+wsub endif x=xt y=yt zz=zt w=wt else x=xt+0.000030517578125*xsub y=yt+0.000030517578125*ysub zz=zt+0.000030517578125*zsub w=wt+0.000030517578125*wsub endif endif j=0 if @axes==0 ;"X,Y,Z,W" o=x+flip(y) cc=zz+flip(w) elseif @axes==1 ;"X,Y,W,Z" o=x+flip(y) cc=w+flip(zz) elseif @axes==2 ;"X,Z,Y,W" o=x+flip(zz) cc=y+flip(w) elseif @axes==3 ;"X,Z,W,Y" o=x+flip(zz) cc=w+flip(y) elseif @axes==4 ;"X,W,Y,Z" o=x+flip(w) cc=y+flip(zz) elseif @axes==5 ;"X,W,Z,Y" o=x+flip(w) cc=zz+flip(y) elseif @axes==6 ;"Y,X,Z,W" o=y+flip(x) cc=zz+flip(w) elseif @axes==7 ;"Y,X,W,Z" o=y+flip(x) cc=w+flip(zz) elseif @axes==8 ;"Y,Z,X,W" o=y+flip(zz) cc=x+flip(w) elseif @axes==9 ;"Y,Z,W,X" o=y+flip(zz) cc=w+flip(x) elseif @axes==10 ;"Y,W,X,Z" o=y+flip(w) cc=x+flip(zz) elseif @axes==11 ;"Y,W,Z,X" o=y+flip(w) cc=zz+flip(x) elseif @axes==12 ;"Z,X,Y,W" o=zz+flip(x) cc=y+flip(w) elseif @axes==13 ;"Z,X,W,Y" o=zz+flip(x) cc=w+flip(y) elseif @axes==14 ;"Z,Y,X,W" o=zz+flip(y) cc=x+flip(w) elseif @axes==15 ;"Z,Y,W,X" o=zz+flip(y) cc=w+flip(x) elseif @axes==16 ;"Z,W,X,Y" o=zz+flip(w) cc=x+flip(y) elseif @axes==17 ;"Z,W,Y,X" o=zz+flip(w) cc=y+flip(x) elseif @axes==18 ;"W,X,Y,Z" o=w+flip(x) cc=y+flip(zz) elseif @axes==19 ;"W,X,Z,Y" o=w+flip(x) cc=zz+flip(y) elseif @axes==20 ;"W,Y,X,Z" o=w+flip(y) cc=x+flip(zz) elseif @axes==21 ;"W,Y,Z,X" o=w+flip(y) cc=zz+flip(x) elseif @axes==22 ;"W,Z,X,Y" o=w+flip(zz) cc=x+flip(y) elseif @axes==23 ;"W,Z,Y,X" o=w+flip(zz) cc=y+flip(x) endif F = @L0 F0 = @L0 F1 = @L1*z + @L2 n = 0 if @fractal==16 || @fractal==17 cp1 = cc + 1 elseif @fractal==18 || @fractal==19 cm1 = cc - 1 c2m2 = 2*cm1 elseif @fractal==32 || @fractal==33 cbe = cc + @be cbe1 = cbe + 1 cbe2 = cbe + 2 c2be2 = cbe*(cc - @be) j2 = cc + 1 - cbe2/2 elseif @fractal==34 || @fractal==35 alc = @al + cc alc1 = alc + 1 alc2 = alc + 2 al2c2 = alc*(@al - cc) j3 = @al + 1 - alc2/2 endif if @fractal == 6 || @fractal == 7 F0 = (1.0,0) F1 = o elseif @fractal == 10 || @fractal == 11 F0 = (1.0,0) F1 = 1 - o elseif @fractal == 14 || @fractal == 15 F0 = (1.0,0) F1 = 2*o elseif @fractal == 17 F0 = (1.0,0) F1 = cp1 - o elseif @fractal == 19 F0 = (1.0,0) F1 = 2*cc*o n = 1 elseif @fractal == 22 || @fractal == 23 F0 = (1.0,0) F1 = kp1 - o elseif @fractal == 26 || @fractal == 27 F0 = (1.0,0) F1 = 2*@k*o n = 1 elseif @fractal == 30 || @fractal == 31 F0 = (1.0,0) F1 = j1 + albe2*o/2 elseif @fractal == 33 F0 = (1.0,0) F1 = j2 + cbe2*o/2 elseif @fractal == 35 F0 = (1.0,0) F1 = j3 + alc2*o/2 endif repeat oo=o o=fn2(o) if @fractal == 0 ;Lucas Pn(z)+c F0 = @L0 F1 = @L1*o + @L2 n = @degree - 1 while n > 0 F = F1 F1 = (@L4*o + @L5)*F1 + @L3*F0 F0 = F n = n - 1 endwhile o = F1 + cc elseif @fractal == 1 ;Lucas c*Pn(z) F0 = @L0 F1 = @L1*o + @L2 n = @degree - 1 while n > 0 F = F1 F1 = (@L4*o + @L5)*F1 + @L3*F0 F0 = F n = n - 1 endwhile o = cc*F1 elseif @fractal == 2 ;Lucas Piter(z)+c if n > 0 F = F1 F1 = (@L4*o + @L5)*F1 + @L3*F0 F0 = F endif o = F1 + cc n = n + 1 elseif @fractal == 3 ;Lucas c*Piter(z) if n > 0 F = F1 F1 = (@L4*o + @L5)*F1 + @L3*F0 F0 = F endif o = cc*F1 n = n + 1 elseif @fractal == 4 ;Legendre Pn(z)+c F0 = (1.0,0) F1 = o n = 1 while n < @degree F = F1 F1 = ((2*n + 1)*o*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 5 ;Legendre c*Pn(z) F0 = (1.0,0) F1 = o n = 1 while n < @degree F = F1 F1 = ((2*n + 1)*o*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 6 ;Legendre Piter(z)+c n = n + 1 F = F1 F1 = ((2*n + 1)*o*F1 - n*F0)/(n + 1) F0 = F o = F1 + cc elseif @fractal == 7 ;Legendre c*Piter(z) n = n + 1 F = F1 F1 = ((2*n + 1)*o*F1 - n*F0)/(n + 1) F0 = F o = cc*F1 elseif @fractal == 8 ;Laguerre Pn(z)+c F0 = (1.0,0) F1 = 1 - o n = 1 while n < @degree F = F1 F1 = ((2*n + 1 - o)*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 9 ;Laguerre c*Pn(z) F0 = (1.0,0) F1 = 1 - o n = 1 while n < @degree F = F1 F1 = ((2*n + 1 - o)*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 10 ;Laguerre Piter(z)+c n = n + 1 F = F1 F1 = ((2*n + 1 - o)*F1 - n*F0)/(n + 1) F0 = F o = F1 + cc elseif @fractal == 11 ;Laguerre c*Piter(z) n = n + 1 F = F1 F1 = ((2*n + 1 - o)*F1 - n*F0)/(n + 1) F0 = F o = cc*F1 elseif @fractal == 12 ;Hermite Pn(z)+c F0 = (1.0,0) F1 = 2*o n = 1 while n < @degree F = F1 F1 = 2*o*F1 - 2*n*F0 F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 13 ;Hermite c*Pn(z) F0 = (1.0,0) F1 = 2*o n = 1 while n < @degree F = F1 F1 = 2*o*F1 - 2*n*F0 F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 14 ;Hermite Piter(z)+c n = n + 1 F = F1 F1 = 2*o*F1 - 2*n*F0 F0 = F o = F1 + cc elseif @fractal == 15 ;Hermite c*Piter(z) n = n + 1 F = F1 F1 = 2*o*F1 - 2*n*F0 F0 = F o = cc*F1 elseif @fractal == 16 ;Laguerre Associated Pn(z) (k=c) F0 = (1.0,0) F1 = cp1 - o n = 1 while n < @degree F = F1 F1 = ((2*n + cp1 - o)*F1 - (n + cc)*F0)/(n + 1) F0 = F n = n + 1 endwhile o = F1 elseif @fractal == 17 ;Laguerre Associated Piter(z) (k=c) n = n + 1 F = F1 F1 = ((2*n + cp1 - o)*F1 - (n + cc)*F0)/(n + 1) F0 = F o = F1 elseif @fractal == 18 ;Ultraspherical Pn(z) (k=c) F0 = (1.0,0) F1 = 2*cc*o n = 2 while n <= @degree F = F1 F1 = (2*(n + cm1)*o*F1 - (n + c2m2)*F0)/n F0 = F n = n + 1 endwhile o = F1 elseif @fractal == 19 ;Ultraspherical Piter(z) (k=c) n = n + 1 F = F1 F1 = (2*(n + cm1)*o*F1 - (n + c2m2)*F0)/n F0 = F o = F1 elseif @fractal == 20 ;Laguerre Associated Pkn(z)+c F0 = (1.0,0) F1 = kp1 - o n = 1 while n < @degree F = F1 F1 = ((2*n + kp1 - o)*F1 - (n + @k)*F0)/(n + 1) F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 21 ;Laguerre Associated c*Pkn(z) F0 = (1.0,0) F1 = kp1 - o n = 1 while n < @degree F = F1 F1 = ((2*n + kp1 - o)*F1 - (n + @k)*F0)/(n + 1) F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 22 ;Laguerre Associated Pkiter(z)+c n = n + 1 F = F1 F1 = ((2*n + kp1 - o)*F1 - (n + @k)*F0)/(n + 1) F0 = F o = F1 + cc elseif @fractal == 23 ;Laguerre Associated c*Pkiter(z) n = n + 1 F = F1 F1 = ((2*n + kp1 - o)*F1 - (n + @k)*F0)/(n + 1) F0 = F o = cc*F1 elseif @fractal == 24 ;Ultraspherical Pkn(z)+c F0 = (1.0,0) F1 = 2*@k*o n = 2 while n <= @degree F = F1 F1 = (2*(n + km1)*o*F1 - (n + k2m2)*F0)/n F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 25 ;Ultraspherical c*Pkn(z) F0 = (1.0,0) F1 = 2*@k*o n = 2 while n <= @degree F = F1 F1 = (2*(n + km1)*o*F1 - (n + k2m2)*F0)/n F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 26 ;Ultraspherical Pkiter(z)+c n = n + 1 F = F1 F1 = (2*(n + km1)*o*F1 - (n + k2m2)*F0)/n F0 = F o = F1 + cc elseif @fractal == 27 ;Ultraspherical c*Pkiter(z) n = n + 1 F = F1 F1 = (2*(n + km1)*o*F1 - (n + k2m2)*F0)/n F0 = F o = cc*F1 elseif @fractal == 28 ;Jacobi Pabn(z)+c F0 = (1.0,0) F1 = j1 + albe2*o/2 n = 1 while n < @degree F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*o)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 29 ;Jacobi c*Pabn(z) F0 = (1.0,0) F1 = j1 + albe2*o/2 n = 1 while n < @degree F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*o)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 30 ;Jacobi Pabiter(z)+c n = n + 1 F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*o)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F o = F1 + cc elseif @fractal == 31 ;Jacobi c*Pabiter(z) n = n + 1 F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*o)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F o = cc*F1 elseif @fractal == 32 ;Jacobi Pbn(z) F0 = (1.0,0) F1 = j2 + cbe2*o/2 n = 1 while n < @degree F = F1 F1 = (((2*n + cbe1)*c2be2 + (2*n + cbe)*(2*n + cbe1)*(2*n + cbe2)*o)*F1 \ - 2*(n + cc)*(n + @be)*(2*n + cbe2)*F0)/(2*(n + 1)*(n + cbe1)*(2*n + cbe)) F0 = F n = n + 1 endwhile o = F1 elseif @fractal == 33 ;Jacobi Pbiter(z) n = n + 1 F = F1 F1 = (((2*n + cbe1)*c2be2 + (2*n + cbe)*(2*n + cbe1)*(2*n + cbe2)*o)*F1 \ - 2*(n + cc)*(n + @be)*(2*n + cbe2)*F0)/(2*(n + 1)*(n + cbe1)*(2*n + cbe)) F0 = F o = F1 elseif @fractal == 34 ;Jacobi Pan(z) F0 = (1.0,0) F1 = j3 + alc2*o/2 n = 1 while n < @degree F = F1 F1 = (((2*n + alc1)*al2c2 + (2*n + alc)*(2*n + alc1)*(2*n + alc2)*o)*F1 \ - 2*(n + @al)*(n + cc)*(2*n + alc2)*F0)/(2*(n + 1)*(n + alc1)*(2*n + alc)) F0 = F n = n + 1 endwhile o = F1 elseif @fractal == 35 ;Jacobi Paiter(z) n = n + 1 F = F1 F1 = (((2*n + alc1)*al2c2 + (2*n + alc)*(2*n + alc1)*(2*n + alc2)*o)*F1 \ - 2*(n + @al)*(n + cc)*(2*n + alc2)*F0)/(2*(n + 1)*(n + alc1)*(2*n + alc)) F0 = F o = F1 endif if @converge==1 sq=1/|o-oo| else sq=|o| endif if @method==2 tv = o - tval if @traptype==0 min = |tv| elseif @traptype==1 min = real(tv) elseif @traptype==2 min = imag(tv) elseif @traptype==3 min = atan2(tv) endif if @traptype>3 min = real(tv) if @usethreshold min = abs(min-@threshold) else min = abs(min) endif min1 = imag(tv) if @usethreshold min1 = abs(min1-@threshold) else min1 = abs(min1) endif if (@traptype==4 && min<@minval && min1<@minval) \ ||(@traptype==5 && (min<@minval || min1<@minval)) if min1#pi min = min - twopi endif if min<0 min = min + twopi endif endif elseif @traptype>0 && @traptype!=3 min = abs(min) elseif @traptype==3 if @useangle==0 min = abs(min) elseif min<0 min = min + twopi endif endif endif j=j+1 until j>=#maxiter || sq>@bailout || (@method==2 && min<@minval) if @method==1 || (@method==3 && j>=#maxiter) tv = o - tval if @traptype==0 sq = |tv| elseif @traptype==1 sq = real(tv) elseif @traptype==2 sq = imag(tv) elseif @traptype==3 sq = atan2(tv) endif if @traptype>3 sq = real(tv) if @usethreshold sq = abs(sq-@threshold) else sq = abs(sq) endif min1 = imag(tv) if @usethreshold min1 = abs(min1-@threshold) else min1 = abs(min1) endif if (@traptype==4 && sq<@minval && min1<@minval) \ ||(@traptype==5 && (sq<@minval || min1<@minval)) if min1#pi sq = sq - twopi endif if sq<0 sq = sq + twopi endif endif elseif @traptype>0 && @traptype<3 sq = abs(sq) elseif @traptype==3 if @useangle==0 sq = abs(sq) elseif sq<0 sq = sq + twopi endif endif elseif @method==2 sq = min endif if s==0 ;iteration at current step s=1 ;iterate at current step + a bit next time if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true xt=xc yt=yc zt=zc wt=wc s=2 ;initiate binary search next time endif if @nobinary s=-1 endif elseif s==1 ;iteration at current step + a bit if @method==0 di1=j-k ldir1=di1 ;direction, towards/away if di1==0 ;if same iteration ldir1=lsq-sq ;use bailout value for direction endif elseif @method!=3 ldir1=lsq-sq elseif (ldir1=di1=j-k)==0 ldir1 = lsq-sq endif xt=xc yt=yc zt=zc wt=wc s=-1 ;Nothing found, move to next main step position if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true s=2 ;initiate binary search next time elseif (!@change && (ldir>0 && ldir1<0) || (@method==0 && dildir1) s=2 ;initiate binary search next time endif elseif s<@bindepth ;the binary search if b if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true ldir2=-1 s=s+1 else k=j lsq=sq b=false endif else if @method==0 ldir2=j-k if ldir2==0 ldir2=lsq-sq endif elseif @method!=3 ldir2=lsq-sq elseif (ldir2=j-k)==0 ldir2 = lsq-sq endif if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true ldir2=-1 xt=xt+0.000030517578125*xsub yt=yt+0.000030517578125*ysub zt=zt+0.000030517578125*zsub wt=wt+0.000030517578125*wsub endif b=true s=s+1 endif endif if s==@bindepth s=-1 endif until s<0 if !found if @smart if j<=1 xs = xss ys = yss zs = zss ws = wss i=i+1.0 elseif j==2 xs = 0.5*xss ys = 0.5*yss zs = 0.5*zss ws = 0.5*wss i=i+0.5 elseif j==3 xs = 0.25*xss ys = 0.25*yss zs = 0.25*zss ws = 0.25*wss i=i+0.25 elseif j==3 xs = 0.125*xss ys = 0.125*yss zs = 0.125*zss ws = 0.125*wss i=i+0.125 elseif j==4 xs = 0.0625*xss ys = 0.0625*yss zs = 0.0625*zss ws = 0.0625*wss i=i+0.0625 elseif j==5 xs = 0.03125*xss ys = 0.03125*yss zs = 0.03125*zss ws = 0.03125*wss i=i+0.03125 elseif j==6 xs = 0.015625*xss ys = 0.015625*yss zs = 0.015625*zss ws = 0.015625*wss i=i+0.015625 elseif j==7 xs = 0.0078125*xss ys = 0.0078125*yss zs = 0.0078125*zss ws = 0.0078125*wss i=i+0.0078125 elseif j==8 xs = 0.00390625*xss ys = 0.00390625*yss zs = 0.00390625*zss ws = 0.00390625*wss i=i+0.00390625 elseif j==6 xs = 0.001953125*xss ys = 0.001953125*yss zs = 0.001953125*zss ws = 0.001953125*wss i=i+0.001953125 elseif j==7 xs = 0.0009765625*xss ys = 0.0009765625*yss zs = 0.0009765625*zss ws = 0.0009765625*wss i=i+0.0009765625 else xs = 0.00048828125*xss ys = 0.00048828125*yss zs = 0.00048828125*zss ws = 0.00048828125*wss i=i+0.00048828125 endif else i=i+1.0 endif xc=xc+xs yc=yc+ys zc=zc+zs wc=wc+ws ldir=ldir1 endif until i>=v || found==true if @colour==0 if p==0 if found==true x0=xt y0=yt z0=zt w0=wt if @light<3 || (@light>4 && @light<7) if @f<1e-5 xp=xt+dxx-dzx yp=yt+dxy-dzy zp=zt+dxz-dzz wp=wt+dxw-dzw else xp=xt-xo yp=yt-yo zp=zt-zo wp=wt-wo dd=sqrt(xp*xp+yp*yp+zp*zp+wp*wp) xp=xt-dzx+dxx*dd yp=yt-dzy+dxy*dd zp=zt-dzz+dxz*dd wp=wt-dzw+dxw*dd endif ldir=1 di=0 p=2 else if @smart shxs=xss shys=yss shzs=zss shws=wss else shxs=xs shys=ys shzs=zs shws=ws endif shxb=xb shyb=yb shzb=zb shwb=wb shxsb=xsb shysb=ysb shzsb=zsb shwsb=wsb shv=v if @light<5 zs=1.0/dtl xs=-r2c0*zs ys=-r2c1*zs zs=-r2c2*zs ws=zs*s1 zs=zs*c1 else xs=px-xt ys=py-yt zs=shz-zt ws=shw-wt if (s2=dtl*sqrt(xs*xs+ys*ys+zs*zs+ws*ws))6 shadow=found xs=shxs ys=shys zs=shzs ws=shws if @smart xss=xs yss=ys zss=zs wss=ws endif xb=shxb yb=shyb zb=shzb wb=shwb xsb=shxsb ysb=shysb zsb=shzsb wsb=shwsb v=shv if @f<1e-5 xp=x0+dxx-dzx yp=y0+dxy-dzy zp=z0+dxz-dzz wp=w0+dxw-dzw else xp=x0-xo yp=y0-yo zp=z0-zo wp=w0-wo dd=sqrt(xp*xp+yp*yp+zp*zp+wp*wp) xp=x0-dzx+dxx*dd yp=y0-dzy+dxy*dd zp=z0-dzz+dxz*dd wp=w0-dzw+dxw*dd endif ldir=1 di=0 p=2 endif elseif p==2 if found==true x1=xt y1=yt z1=zt*c1+wt*s1 else x1=xc y1=yc z1=zc*c1+wc*s1 endif if @f<1e-5 xp=xp-2*dxx yp=yp-2*dxy zp=zp-2*dxz wp=wp-2*dxw else xp=x0-2*dxx*dd yp=y0-2*dxy*dd zp=z0-2*dxz*dd wp=w0-2*dxw*dd endif ldir=1 di=0 p=3 elseif p==3 if found==true x2=xt y2=yt z2=zt*c1+wt*s1 else x2=xc y2=yc z2=zc*c1+wc*s1 endif if @f<1e-5 xp=xp+dxx+dyx yp=yp+dxy+dyy zp=zp+dxz+dyz wp=wp+dxw+dyw else xp=x0+(dxx+dyx)*dd yp=y0+(dxy+dyy)*dd zp=z0+(dxz+dyz)*dd wp=w0+(dxw+dyw)*dd endif ldir=1 di=0 p=4 elseif p==4 if found==true x3=xt y3=yt z3=zt*c1+wt*s1 else x3=xc y3=yc z3=zc*c1+wc*s1 endif if @f<1e-5 xp=xp-2*dyx yp=yp-2*dyy zp=zp-2*dyz wp=wp-2*dyw else xp=x0-2*dyx*dd yp=y0-2*dyy*dd zp=z0-2*dyz*dd wp=w0-2*dyw*dd endif ldir=1 di=0 p=5 elseif p==5 if found==true x4=xt y4=yt z4=zt*c1+wt*s1 else x4=xc y4=yc z4=zc*c1+wc*s1 found=true endif p=-1 endif endif until p<0 if found==true if @colour==3 z=fn1(sqrt((xt-xo)^2+(yt-yo)^2+(zt-zzo)^2)) ; check this zzzzzz elseif @colour==2 x=xt y=yt zz=zt w=wt elseif @colour==1 if @axes==0 x=xt y=yt zz=zt w=wt elseif @axes==1 ;"X,Y,W,Z" x=xt y=yt zz=wt w=zt elseif @axes==2 ;"X,Z,Y,W" x=xt y=zt zz=yt w=wt elseif @axes==3 ;"X,Z,W,Y" x=xt y=zt zz=wt w=yt elseif @axes==4 ;"X,W,Y,Z" x=xt y=wt zz=yt w=zt elseif @axes==5 ;"X,W,Z,Y" x=xt y=wt zz=zt w=yt elseif @axes==6 ;"Y,X,Z,W" x=yt y=xt zz=zt w=wt elseif @axes==7 ;"Y,X,W,Z" x=yt y=xt zz=wt w=zt elseif @axes==8 ;"Y,Z,X,W" x=yt y=zt zz=xt w=wt elseif @axes==9 ;"Y,Z,W,X" x=yt y=zt zz=wt w=xt elseif @axes==10 ;"Y,W,X,Z" x=yt y=wt zz=xt w=zt elseif @axes==11 ;"Y,W,Z,X" x=yt y=wt zz=zt w=xt elseif @axes==12 ;"Z,X,Y,W" x=zt y=xt zz=yt w=wt elseif @axes==13 ;"Z,X,W,Y" x=zt y=xt zz=wt w=yt elseif @axes==14 ;"Z,Y,X,W" x=zt y=yt zz=xt w=wt elseif @axes==15 ;"Z,Y,W,X" x=zt y=yt zz=wt w=xt elseif @axes==16 ;"Z,W,X,Y" x=zt y=wt zz=xt w=yt elseif @axes==17 ;"Z,W,Y,X" x=zt y=wt zz=yt w=xt elseif @axes==18 ;"W,X,Y,Z" x=wt y=xt zz=yt w=zt elseif @axes==19 ;"W,X,Z,Y" x=wt y=xt zz=zt w=yt elseif @axes==20 ;"W,Y,X,Z" x=wt y=yt zz=xt w=zt elseif @axes==21 ;"W,Y,Z,X" x=wt y=yt zz=zt w=xt elseif @axes==22 ;"W,Z,X,Y" x=wt y=zt zz=xt w=yt elseif @axes==23 ;"W,Z,Y,X" x=wt y=zt zz=yt w=xt endif o=x+flip(y) cc=zz+flip(w) F = @L0 F0 = @L0 F1 = @L1*z + @L2 n = 0 if @fractal==16 || @fractal==17 cp1 = cc + 1 elseif @fractal==18 || @fractal==19 cm1 = cc - 1 c2m2 = 2*cm1 elseif @fractal==32 || @fractal==33 cbe = cc + @be cbe1 = cbe + 1 cbe2 = cbe + 2 c2be2 = cbe*(cc - @be) j2 = cc + 1 - cbe2/2 elseif @fractal==34 || @fractal==35 alc = @al + cc alc1 = alc + 1 alc2 = alc + 2 al2c2 = alc*(@al - cc) j3 = @al + 1 - alc2/2 endif if @fractal == 6 || @fractal == 7 F0 = (1.0,0) F1 = o elseif @fractal == 10 || @fractal == 11 F0 = (1.0,0) F1 = 1 - o elseif @fractal == 14 || @fractal == 15 F0 = (1.0,0) F1 = 2*o elseif @fractal == 17 F0 = (1.0,0) F1 = cp1 - o elseif @fractal == 19 F0 = (1.0,0) F1 = 2*cc*o n = 1 elseif @fractal == 22 || @fractal == 23 F0 = (1.0,0) F1 = kp1 - o elseif @fractal == 26 || @fractal == 27 F0 = (1.0,0) F1 = 2*@k*o n = 1 elseif @fractal == 30 || @fractal == 31 F0 = (1.0,0) F1 = j1 + albe2*o/2 elseif @fractal == 33 F0 = (1.0,0) F1 = j2 + cbe2*o/2 elseif @fractal == 35 F0 = (1.0,0) F1 = j3 + alc2*o/2 endif endif if @colour>0 && @colour<3 if @inside==0 z=fn1(x+flip(y)) elseif @inside==1 z=fn1(x*x+y*y+flip(zz*zz+w*w)) elseif @inside==2 z=fn1(sqr(x*x+y*y)+flip(sqr(zz*zz+w*w))) elseif @inside==3 z=fn1(x+flip(zz)) elseif @inside==4 z=fn1(x+flip(w)) elseif @inside==5 z=fn1(y+flip(x)) elseif @inside==6 z=fn1(y+flip(zz)) elseif @inside==7 z=fn1(y+flip(w)) elseif @inside==8 z=fn1(zz+flip(x)) elseif @inside==9 z=fn1(zz+flip(y)) elseif @inside==10 z=fn1(zz+flip(w)) elseif @inside==11 z=fn1(w+flip(x)) elseif @inside==12 z=fn1(w+flip(y)) elseif @inside==13 z=fn1(w+flip(zz)) elseif @inside==14 z=fn1(x+flip(sqrt(y*y+zz*zz+w*w))) endif elseif @colour==0 xt=x0 yt=y0 zt=z0*c1+w0*s1 z0=zt x5=x0-x4 y5=y0-y4 z5=z0-z4 x4=x3-x0 y4=y3-y0 z4=z3-z0 x3=x0-x2 y3=y0-y2 z3=z0-z2 x2=x1-x0 y2=y1-y0 z2=z1-z0 x0=y2*z4-y4*z2 y0=x4*z2-x2*z4 z0=x2*y4-x4*y2 s2=1.0/sqrt(x0*x0+y0*y0+z0*z0) x0=x0*s2 y0=y0*s2 z0=z0*s2 x1=y2*z5-y5*z2 y1=x5*z2-x2*z5 z1=x2*y5-x5*y2 s2=1.0/sqrt(x1*x1+y1*y1+z1*z1) x1=x1*s2 y1=y1*s2 z1=z1*s2 x2=y3*z4-y4*z3 y2=x4*z3-x3*z4 z2=x3*y4-x4*y3 s2=1.0/sqrt(x2*x2+y2*y2+z2*z2) x2=x2*s2 y2=y2*s2 z2=z2*s2 x4=y3*z5-y5*z3 y4=x5*z3-x3*z5 z4=x3*y5-x5*y3 s2=1.0/sqrt(x4*x4+y4*y4+z4*z4) x4=x4*s2 y4=y4*s2 z4=z4*s2 x0=x0+x1+x2+x4 y0=y0+y1+y2+y4 z0=z0+z1+z2+z4 w0=1.0/sqrt(x0*x0+y0*y0+z0*z0) x0=x0*w0 ;N y0=y0*w0 z0=z0*w0 if @light==0 || @light==2 || @light==4 \ || @light==6 || @light==8 if @f<1e-5 x2=x0*m1r2c0+y0*m1r2c1+z0*m1r2c2 ;N.L else x5=xt-xo y5=yt-yo z5=zt-zzo s2=1.0/sqrt(x5*x5+y5*y5+z5*z5) x5=x5*s2 y5=y5*s2 z5=z5*s2 x2=x0*x5+y0*y5+z0*z5 ;N.L endif if x2>1.0 x2=1.0 endif if x2>0 if @f<1e-5 x3=(2*x0*x2-m1r2c0)*m1r2c0 \ +(2*y0*x2-m1r2c1)*m1r2c1 \ +(2*z0*x2-m1r2c2)*m1r2c2 ;(2*N*(N.L)-L).V else x3=(2*x0*x2-x5)*x5 \ +(2*y0*x2-y5)*y5 \ +(2*z0*x2-z5)*z5 ;(2*N*(N.L)-L).V endif if x3<0 x3=0 elseif x3>1 x3=1 endif if @diffuse<0 x2=-0.5*@diffuse*(1+x2) else x2=@diffuse*x2 endif else x3=0 if @diffuse<0 x2=-0.5*@diffuse*(1+x2) else x2=0 endif endif endif if @light==0 w0=@ambient+x2+@specular*x3^@specsize ;Ka+Kd*(N.L)+Ks*(R.V)^n if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+abs(@diffuse)+@specular) else z=w0 endif else if @light<5 ;Remote x1=r2c0 ;L y1=r2c1 z1=r2c2 else ;Point x1=xt-px y1=yt-py z1=zt-pz s2=1.0/sqrt(x1*x1+y1*y1+z1*z1) x1=x1*s2 ;L y1=y1*s2 z1=z1*s2 endif w0=x0*x1+y0*y1+z0*z1 ;N.L if w0>1.0 w0=1.0 endif if w0>0 if @f>=1e-5 && (@light==1 || @light==3 || @light==5 \ || @light==7) x5=xt-xo y5=yt-yo z5=zt-zzo s2=1.0/sqrt(x5*x5+y5*y5+z5*z5) x5=x5*s2 y5=y5*s2 z5=z5*s2 endif if @f>=1e-5 x0=(2*x0*w0-x1)*x5 \ +(2*y0*w0-y1)*y5 \ +(2*z0*w0-z1)*z5 ;(2*N*(N.L)-L).V else x0=(2*x0*w0-x1)*m1r2c0 \ +(2*y0*w0-y1)*m1r2c1 \ +(2*z0*w0-z1)*m1r2c2 ;(2*N*(N.L)-L).V endif if x0<0 x0=0 elseif x0>1 x0=1 endif if @diffuse<0 w0=-0.5*@diffuse*(1+w0) else w0=@diffuse*w0 endif else x0=0 if @diffuse<0 w0=-0.5*@diffuse*(1+w0) else w0=0 endif endif if @light==3 || @light==4 || @light>6 if shadow==true x0=x0*shad w0=w0*shad endif endif if @light==2 || @light==4 || @light==6 || @light==8 w0=@ambient+x2+@specular*x3^@specsize \ +@light4*(w0+@specular*x0^@specsize) if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+(1+@light4)*(abs(@diffuse)+@specular)) else z=w0 endif else w0=@ambient+w0+@specular*x0^@specsize ;Ka+Kd*(N.L)+Ks*(R.V)^n if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+abs(@diffuse)+@specular) else z=w0 endif endif endif endif endif else ; found (clipped) found = false endif loop: if @colour==1 && found==true ; oo=o o=@fn2(o) if @fractal == 0 ;Lucas Pn(z)+c F0 = @L0 F1 = @L1*o + @L2 n = @degree - 1 while n > 0 F = F1 F1 = (@L4*o + @L5)*F1 + @L3*F0 F0 = F n = n - 1 endwhile o = F1 + cc elseif @fractal == 1 ;Lucas c*Pn(z) F0 = @L0 F1 = @L1*o + @L2 n = @degree - 1 while n > 0 F = F1 F1 = (@L4*o + @L5)*F1 + @L3*F0 F0 = F n = n - 1 endwhile o = cc*F1 elseif @fractal == 2 ;Lucas Piter(z)+c if n > 0 F = F1 F1 = (@L4*o + @L5)*F1 + @L3*F0 F0 = F endif o = F1 + cc n = n + 1 elseif @fractal == 3 ;Lucas c*Piter(z) if n > 0 F = F1 F1 = (@L4*o + @L5)*F1 + @L3*F0 F0 = F endif o = cc*F1 n = n + 1 elseif @fractal == 4 ;Legendre Pn(z)+c F0 = (1.0,0) F1 = o n = 1 while n < @degree F = F1 F1 = ((2*n + 1)*o*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 5 ;Legendre c*Pn(z) F0 = (1.0,0) F1 = o n = 1 while n < @degree F = F1 F1 = ((2*n + 1)*o*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 6 ;Legendre Piter(z)+c n = n + 1 F = F1 F1 = ((2*n + 1)*o*F1 - n*F0)/(n + 1) F0 = F o = F1 + cc elseif @fractal == 7 ;Legendre c*Piter(z) n = n + 1 F = F1 F1 = ((2*n + 1)*o*F1 - n*F0)/(n + 1) F0 = F o = cc*F1 elseif @fractal == 8 ;Laguerre Pn(z)+c F0 = (1.0,0) F1 = 1 - o n = 1 while n < @degree F = F1 F1 = ((2*n + 1 - o)*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 9 ;Laguerre c*Pn(z) F0 = (1.0,0) F1 = 1 - o n = 1 while n < @degree F = F1 F1 = ((2*n + 1 - o)*F1 - n*F0)/(n + 1) F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 10 ;Laguerre Piter(z)+c n = n + 1 F = F1 F1 = ((2*n + 1 - o)*F1 - n*F0)/(n + 1) F0 = F o = F1 + cc elseif @fractal == 11 ;Laguerre c*Piter(z) n = n + 1 F = F1 F1 = ((2*n + 1 - o)*F1 - n*F0)/(n + 1) F0 = F o = cc*F1 elseif @fractal == 12 ;Hermite Pn(z)+c F0 = (1.0,0) F1 = 2*o n = 1 while n < @degree F = F1 F1 = 2*o*F1 - 2*n*F0 F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 13 ;Hermite c*Pn(z) F0 = (1.0,0) F1 = 2*o n = 1 while n < @degree F = F1 F1 = 2*o*F1 - 2*n*F0 F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 14 ;Hermite Piter(z)+c n = n + 1 F = F1 F1 = 2*o*F1 - 2*n*F0 F0 = F o = F1 + cc elseif @fractal == 15 ;Hermite c*Piter(z) n = n + 1 F = F1 F1 = 2*o*F1 - 2*n*F0 F0 = F o = cc*F1 elseif @fractal == 16 ;Laguerre Associated Pn(z) (k=c) F0 = (1.0,0) F1 = cp1 - o n = 1 while n < @degree F = F1 F1 = ((2*n + cp1 - o)*F1 - (n + cc)*F0)/(n + 1) F0 = F n = n + 1 endwhile o = F1 elseif @fractal == 17 ;Laguerre Associated Piter(z) (k=c) n = n + 1 F = F1 F1 = ((2*n + cp1 - o)*F1 - (n + cc)*F0)/(n + 1) F0 = F o = F1 elseif @fractal == 18 ;Ultraspherical Pn(z) (k=c) F0 = (1.0,0) F1 = 2*cc*o n = 2 while n <= @degree F = F1 F1 = (2*(n + cm1)*o*F1 - (n + c2m2)*F0)/n F0 = F n = n + 1 endwhile o = F1 elseif @fractal == 19 ;Ultraspherical Piter(z) (k=c) n = n + 1 F = F1 F1 = (2*(n + cm1)*o*F1 - (n + c2m2)*F0)/n F0 = F o = F1 elseif @fractal == 20 ;Laguerre Associated Pkn(z)+c F0 = (1.0,0) F1 = kp1 - o n = 1 while n < @degree F = F1 F1 = ((2*n + kp1 - o)*F1 - (n + @k)*F0)/(n + 1) F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 21 ;Laguerre Associated c*Pkn(z) F0 = (1.0,0) F1 = kp1 - o n = 1 while n < @degree F = F1 F1 = ((2*n + kp1 - o)*F1 - (n + @k)*F0)/(n + 1) F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 22 ;Laguerre Associated Pkiter(z)+c n = n + 1 F = F1 F1 = ((2*n + kp1 - o)*F1 - (n + @k)*F0)/(n + 1) F0 = F o = F1 + cc elseif @fractal == 23 ;Laguerre Associated c*Pkiter(z) n = n + 1 F = F1 F1 = ((2*n + kp1 - o)*F1 - (n + @k)*F0)/(n + 1) F0 = F o = cc*F1 elseif @fractal == 24 ;Ultraspherical Pkn(z)+c F0 = (1.0,0) F1 = 2*@k*o n = 2 while n <= @degree F = F1 F1 = (2*(n + km1)*o*F1 - (n + k2m2)*F0)/n F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 25 ;Ultraspherical c*Pkn(z) F0 = (1.0,0) F1 = 2*@k*o n = 2 while n <= @degree F = F1 F1 = (2*(n + km1)*o*F1 - (n + k2m2)*F0)/n F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 26 ;Ultraspherical Pkiter(z)+c n = n + 1 F = F1 F1 = (2*(n + km1)*o*F1 - (n + k2m2)*F0)/n F0 = F o = F1 + cc elseif @fractal == 27 ;Ultraspherical c*Pkiter(z) n = n + 1 F = F1 F1 = (2*(n + km1)*o*F1 - (n + k2m2)*F0)/n F0 = F o = cc*F1 elseif @fractal == 28 ;Jacobi Pabn(z)+c F0 = (1.0,0) F1 = j1 + albe2*o/2 n = 1 while n < @degree F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*o)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F n = n + 1 endwhile o = F1 + cc elseif @fractal == 29 ;Jacobi c*Pabn(z) F0 = (1.0,0) F1 = j1 + albe2*o/2 n = 1 while n < @degree F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*o)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F n = n + 1 endwhile o = cc*F1 elseif @fractal == 30 ;Jacobi Pabiter(z)+c n = n + 1 F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*o)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F o = F1 + cc elseif @fractal == 31 ;Jacobi c*Pabiter(z) n = n + 1 F = F1 F1 = (((2*n + albe1)*al2be2 + (2*n + albe)*(2*n + albe1)*(2*n + albe2)*o)*F1 \ - 2*(n + @al)*(n + @be)*(2*n + albe2)*F0)/(2*(n + 1)*(n + albe1)*(2*n + albe)) F0 = F o = cc*F1 elseif @fractal == 32 ;Jacobi Pbn(z) F0 = (1.0,0) F1 = j2 + cbe2*o/2 n = 1 while n < @degree F = F1 F1 = (((2*n + cbe1)*c2be2 + (2*n + cbe)*(2*n + cbe1)*(2*n + cbe2)*o)*F1 \ - 2*(n + cc)*(n + @be)*(2*n + cbe2)*F0)/(2*(n + 1)*(n + cbe1)*(2*n + cbe)) F0 = F n = n + 1 endwhile o = F1 elseif @fractal == 33 ;Jacobi Pbiter(z) n = n + 1 F = F1 F1 = (((2*n + cbe1)*c2be2 + (2*n + cbe)*(2*n + cbe1)*(2*n + cbe2)*o)*F1 \ - 2*(n + cc)*(n + @be)*(2*n + cbe2)*F0)/(2*(n + 1)*(n + cbe1)*(2*n + cbe)) F0 = F o = F1 elseif @fractal == 34 ;Jacobi Pan(z) F0 = (1.0,0) F1 = j3 + alc2*o/2 n = 1 while n < @degree F = F1 F1 = (((2*n + alc1)*al2c2 + (2*n + alc)*(2*n + alc1)*(2*n + alc2)*o)*F1 \ - 2*(n + @al)*(n + cc)*(2*n + alc2)*F0)/(2*(n + 1)*(n + alc1)*(2*n + alc)) F0 = F n = n + 1 endwhile o = F1 elseif @fractal == 35 ;Jacobi Paiter(z) n = n + 1 F = F1 F1 = (((2*n + alc1)*al2c2 + (2*n + alc)*(2*n + alc1)*(2*n + alc2)*o)*F1 \ - 2*(n + @al)*(n + cc)*(2*n + alc2)*F0)/(2*(n + 1)*(n + alc1)*(2*n + alc)) F0 = F o = F1 endif x=real(o) y=imag(o) ; if @converge==1 ; sq=1/|o-oo| ; else ; sq=|o| ; endif if @inside==0 z=fn1(x+flip(y)) elseif @inside==1 z=fn1(x*x+y*y+flip(zz*zz+w*w)) elseif @inside==2 z=fn1(sqr(x*x+y*y)+flip(sqr(zz*zz+w*w))) elseif @inside==3 z=fn1(x+flip(zz)) elseif @inside==4 z=fn1(x+flip(w)) elseif @inside==5 z=fn1(y+flip(x)) elseif @inside==6 z=fn1(y+flip(zz)) elseif @inside==7 z=fn1(y+flip(w)) elseif @inside==8 z=fn1(zz+flip(x)) elseif @inside==9 z=fn1(zz+flip(y)) elseif @inside==10 z=fn1(zz+flip(w)) elseif @inside==11 z=fn1(w+flip(x)) elseif @inside==12 z=fn1(w+flip(y)) elseif @inside==13 z=fn1(w+flip(zz)) elseif @inside==14 z=fn1(x+flip(sqrt(y*y+zz*zz+w*w))) endif endif bailout: found==true default: title = "Solid-3D Polynomials" helpfile = "MMF.html" center = (0, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 10 param fractal caption = "Fractal type" default = 4 enum = "Lucas Pn(z)+c" "Lucas c*Pn(z)" "Lucas Piter(z)+c" "Lucas c*Piter(z)" \ "Legendre Pn(z)+c" "Legendre c*Pn(z)" "Legendre Piter(z)+c" "Legendre c*Piter(z)" \ "Laguerre Pn(z)+c" "Laguerre c*Pn(z)" "Laguerre Piter(z)+c" "Laguerre c*Piter(z)" \ "Hermite Pn(z)+c" "Hermite c*Pn(z)" "Hermite Piter(z)+c" "Hermite c*Piter(z)" \ "Lag.Ass. Pn(z)" "Lag.Ass. Piter(z)" "Ultrasph Pn(z)" "Ultrasph Piter(z)" \ "Lag.Ass. Pkn(z)+c" "Lag.Ass. c*Pkn(z)" "Lag.Ass. Pkiter(z)+c" "Lag.Ass. c*Pkiter(z)" \ "Ultrasph Pkn(z)+c" "Ultrasph c*Pkn(z)" "Ultrasph Pkiter(z)+c" "Ultrasph c*Pkiter(z)" \ "Jacobi Pabn(z)+c" "Jacobi c*Pabn(z)" "Jacobi Pabiter+c" "Jacobi c*Pabiter" \ "Jacobi Pbn(z)" "Jacobi Pbiter(z)" "Jacobi Pan(z)" "Jacobi Paiter(z)" endparam param converge caption = "Bailout type" default = 0 enum = "Divergent" "Convergent" hint = "Some options require Convergent detection." endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 hint = "Defines how soon an orbit bails out \ i.e. is considered as tending to the infinite attractor. \ When using Convergent bailout the reciprocal of cabs(z-zold)^2 \ is tested against this value." endparam param txy caption = "Target X and Y coord" default = (0,0) hint = "Note that using the dropper only works \ properly when the 3D rotations are zero." endparam param tz caption = "Target Zcoord" default = 0.0 endparam param r caption = "View-plane distance" default = 0.0 hint = "Sets the distance of the view-plane from the target. \ In parallel projection mode the view plane is also the \ front-clipping plane, in perspective projection mode it \ controls the perspective along with the magnification and \ the focal length." endparam param r1 caption = "Front-clipping distance" default = 2.0 hint = "Sets the distance of the front-clipping plane from the \ target when using perspective projection. You can set \ the front-clipping plane to be at a position either \ nearer the target or nearer the camera than the view-plane." endparam param view caption = "Viewing range" default = 4.0 min = 0.1 hint = "This is the maximum distance to \ scan from the front-clipping plane." endparam param f caption = "Focal length" default = 12.0 min = 0.0 hint = "Use to adjust the focal length of the camera, a value of zero \ will cause parallel projection to be used instead of perspective \ projection. In perspective projection mode this sets the distance \ of the camera from the view-plane." endparam param trackin caption = "Track in/out" default = 1.0 hint = "In perspective viewing mode this allows you to track the camera in \ and out, 1.0 is the default position and values >1 track away \ and values <1 track towards. In parallel viewing mode it's simply \ a magnification factor giving the effect of tracking the camera \ but in this case values between 0 and 1 track towards the camera \ i.e. magnify, and values >1 track away from the camera." endparam param cutlr caption = "Cut left/right ?" default = false endparam param leftcut caption = "Left cut" default = -1.0 endparam param rightcut caption = "Right cut" default = 1.0 endparam param cuttb caption = "Cut top/btm ?" default = false endparam param btmcut caption = "Bottom cut" default = -1.0 endparam param topcut caption = "Top cut" default = 1.0 endparam param cutfb caption = "Cut front/back ?" default = false endparam param frontcut caption = "Front cut" default = -1.0 endparam param backcut caption = "Back cut" default = 1.0 endparam param cutscale caption = "Plane cut scale" default = 1.0 hint = "Provides a way of scaling the cut planes/box for ease of animation." endparam param cutcentre caption = "Plane cut centre (x,y)" default = (0,0) hint = "Provides a quick way of recentreing the cutting planes." endparam param cutcentre1 caption = "Plane cut centre z" default = 0.0 hint = "Provides a quick way of recentreing the cutting planes." endparam param movecut caption = "Move cut planes" default = false hint = "When enabled the plane cut centre is adjusted to be offset from \ the current target coords." endparam param rotcut caption = "Rotate cut with camera" default = false endparam param cutrot1 caption = "Cut plane elevation" default = 0.0 endparam param cutrot2 caption = "Cut plane direction" default = 0.0 endparam param cutsphere caption = "Cut to sphere" default = false endparam param rcut caption = "Cut radius" default = 1.0 endparam param spherecentre caption = "Sphere (x,y)" default = (0,0) endparam param spherecentre1 caption = "Sphere z" default = 0.0 endparam param movesphere caption = "Move cut sphere" default = false hint = "When enabled the cut sphere centre is offset from the target." endparam param rotsphere caption = "Rotate cut sphere" default = false hint = "When enabled the sphere rotates around the target with the camera." endparam param clipall caption = "Clip all" default = true hint = "If enabled the fractal is clipped both spherically and to the \ cutting planes i.e. only areas not clipped by either method are \ visible. When disabled the two clipping are treated \ separately i.e. only areas clipped by both methods are removed." endparam param detail caption = "Detail level" default = 10.0 min = 2.0 hint = "Higher values produce more accuracy, use values \ under 40 for speed, more for detail. Around \ 100 produces reasonable final results at up to #maxiter 10. \ A #maxiter of 20 may require a value of 1000 or more ! \ You won't need values anywhere near so high when using 'Smart \ step' - in this case you're unlikely to require values over 100." endparam param smart caption = "Smart step" default = false hint = "When enabled the step distance is adjusted based on the iteration \ depth as rays are traced, producing good results at low \ 'Detail level' in quick time, very useful for when setting up. \ Currently only functions properly when using 'Iteration' as the \ solid method." endparam param nobinary caption = "Disable binary search" default = false hint = "Disable the binary search for fast but poor quality rendering." endparam param bindepth caption = "Binary search depth" default = 23 min = 8 max = 23 hint = "Min=8, Max=23. Reducing the value at higher detail levels may \ speed up rendering without visible loss of accuracy." endparam param change caption = "High Detail" default = false hint = "When enabled can vastly improve rendering quality at \ the expense of vastly reducing speed of \ calculation. Actually only worth using for final renders where \ speed of rendering is completely unimportant. Only used when the \ binary search is enabled." endparam param method caption = "Solid method" enum = "Iteration" "Final Z Trap" "Orbit Trap" "Max. Iter. trap" default = 0 hint = "Iteration is the standard method. The Traps consider points to \ be solid when the magnitude of the trapped value for any point \ throughout the iteration is below a minimum." endparam param trapval caption = "Trap Value" default = (0,0) hint = "The value to trap to." endparam param traprot caption = "Trap Rotation" default = 0.0 hint = "Rotates the Trap Value by this number of degrees, useful for \ producing animations." endparam param traptype caption = "Trap type" enum = "Magnitude" "Real" "Imag" "Angle" "Real and Imag" "Real or Imag" default = 0 endparam param useangle caption = "Angle method" enum = "Abs(angle)" "All angles" default = 1 hint = "Only for Trap type Angle" endparam param usethreshold caption = "Use Threshold" default = false hint = "When enabled the distance found is compared to this value. Note \ that the effective range when using Magnitude is >=0, using Real \ and Imag is any value and when using Angle is -pi to +pi." endparam param threshold caption = "Threshold" default = 0.5 hint = "When enabled the distance found is compared to this value. Note \ that the effective range when using Magnitude is >=0, using Real \ and Imag is any value and when using Angle is -pi to +pi." endparam param minval caption = "Minimum Value" default = 0.1 min = 0.0 hint = "Distances found below this value are considered to be solid." endparam param solid caption = "Solid condition" enum = "Threshold" "Direction change" default = 0 hint = "Direction change colours all and \ works faster, useful for when setting \ up position/rotation." endparam param axes caption = "Julibrot axes" default = 0 enum = "Zr,Zi,Cr,Ci" "Zr,Zi,Ci,Cr" "Zr,Cr,Zi,Ci" "Zr,Cr,Ci,Zi" "Zr,Ci,Zi,Cr" "Zr,Ci,Cr,Zi" \ "Zi,Zr,Cr,Ci" "Zi,Zr,Ci,Cr" "Zi,Cr,Zr,Ci" "Zi,Cr,Ci,Zr" "Zi,Ci,Zr,Cr" "Zi,Ci,Cr,Zr" \ "Cr,Zr,Zi,Ci" "Cr,Zr,Ci,Zi" "Cr,Zi,Zr,Ci" "Cr,Zi,Ci,Zr" "Cr,Ci,Zr,Zi" "Cr,Ci,Zi,Zr" \ "Ci,Zr,Zi,Cr" "Ci,Zr,Cr,Zi" "Ci,Zi,Zr,Cr" "Ci,Zi,Cr,Zr" "Ci,Cr,Zr,Zi" "Ci,Cr,Zi,Zr" hint = "Allows you to switch around the order of the 4 axes. \ Use Cr,Ci,Zr,Zi for Mandelbrot-style fractals." endparam param angle1 caption = "X Rot (degrees)" default = 45.0 hint = "Rotation of Y and Z around the X axis. \ (elevation). To get roll - rotation of X \ and Y around the Z axis - use the Rotation \ angle in the location settings." endparam param angle2 caption = "Y Rot (degrees)" default = 0.0 hint = "Rotation of X and Z around the Y axis. \ (direction). To get roll - rotation of X \ and Y around the Z axis - use the Rotation \ angle in the location settings." endparam param angle3 caption = "4D Rot (degrees)" default = 0.0 hint = "Angle of the line in the plane \ of the 3rd and 4th start values, \ used as the Z-axis. \ 0=3rd part (Z), 90=4th part (W)" endparam param offset caption = "4th dimension offset" default = 0.0 hint = "Offsets the 3 dimensions viewed down the current \ 4th dimension. For a 4D rotation of zero this value \ is an offset on the W axis, for a 4D rotation of 90 \ degrees it is an offset on the Z axis." endparam param colour caption = "Colouring" enum = "Lighting" "Inside" "Co-ordinate" "Depth" default = 0 hint = "Use the MMF lighting UCL when using the \ lighting option. Any inside colouring can be \ used to colour the object when using \ Inside or Co-ordinate - NB. colourings or options \ that use #pixel will not remain consistent \ under 3D rotation." endparam param inside caption = "Inside/Co-ordinate" default = 0 enum = "(x,y)" "All squared" "All" "(x,z)" "(x,w)" "(y,x)" "(y,z)" \ "(y,w)" "(z,x)" "(z,y)" "(z,w)" "(w,x)" "(w,y)" "(w,z)" "(x,rest)" hint = "The complex value to be passed as Z \ on each iteration when using Inside colouring, \ or as the value when using Co-ordinate colouring. \ All squared uses (x^2+y^2,z^2+w^2) and All uses the roots \ of the same two values. Only (x,y) really makes sense with \ Inside colouring." endparam param ambient caption = "Ambient light" default = 0.15 min = -1.0 max = 1.0 hint = "The background light level, only relevant for the \ lighting colourings." endparam param diffuse caption = "Diffuse constant" default = 0.55 min = -1.0 max = 1.0 hint = "This value adjusts the proportion of light \ considered to be reflected by a rough surface. \ Use negative values if you wish soft diffuse lighting \ ie. light from the wrong-side of the object to \ have some effect. Only relevant for the \ lighting colourings." endparam param specular caption = "Specular constant" default = 0.3 min = 0 max = 1.0 hint = "This value adjusts the proportion of light \ considered to be reflected by a glassy-smooth \ surface. Only relevant for the \ lighting colourings." endparam param specsize caption = "Specular exponent" default = 5.0 min = 1.0 hint = "This value controls how mirror-like the specular \ reflection is, the larger the value, the more \ mirror-like the reflection. Only relevant for the \ lighting colourings." endparam param clamp caption = "Light value clamp" default = true hint = "When enabled the lighting value is clamped so as to \ fit the colour gradient. This parameter only affects \ the Remote or Point light options. You can produce \ the same result using the Colour Density but this \ option ensures no error." endparam param light caption = "Lighting method" enum = "Camera" "Remote" "Camera+Remote" "Remote+Shadows" "C+R+Shadows" \ "Point" "Camera+Point" "Point+Shadows" "C+P+Shadows" default = 0 hint = "You can light the object using a remote source from the camera \ direction, another remote source from elsewhere or another point \ source or camera and remote or camera and point, or remote with \ shadows, point with shadows or these last two with camera too." endparam param movelight caption = "Track with camera" default = false hint = "When enabled the lighting angles Light1 and Light2 are taken as \ offsets from the camera angles so that when the camera is rotated \ then the light source rotates with it." endparam param light1 caption = "Light 1 (degrees)" default = 60.0 hint = "Independant light elevation. Only relevant for the \ lighting colourings using independant lighting." endparam param light2 caption = "Light 2 (degrees)" default = 30.0 hint = "Independant light direction. Only relevant for the \ lighting colourings using independant lighting." endparam param light3 caption = "Light distance" default = 6.0 hint = "The distance of the light source from the \ camera target. Only relevant for the point \ lighting colouring using independant lighting." endparam param light4 caption = "Relative light" default = 1.0 min = 0.0 hint = "Sets the relative strength of the independant light \ compared to light from the camera. Values < 1 \ make the camera light more significant and values > \ 1 make the independant light more significant. Only applies \ when both light sources are used." endparam param shadow caption = "Depth of shadow" default = 0.5 min = 0.0 max = 1.0 hint = "Sets the darkness of the shadows, using zero is pointless \ as it produces none at all, a value of 1 produces the darkest \ shadows." endparam param degree caption = "Degree of Pn" default = 4 min = 2 hint = "Sets the degree of the polynomial \ to be used for the 'Pn' and 'Pkn' types." endparam param k caption = "k constant" default = (0.25,0) hint = "Extra constant for the Pk types." endparam param al caption = "alpha (Jacobi)" default = (-.5,0) hint = "Sets the value of alpha in the Jacobi types" endparam param be caption = "beta (Jacobi)" default = (-.5,0) hint = "Sets the value of beta in the Jacobi types" endparam param L0 caption = "First constant" default = (1.0,0) hint = "Sets the base first constant for a Lucas polynomial, \ recurrence relation first term F0(z)." endparam param L1 caption = "Base Linear coeff" default = (1.0,0) hint = "Sets the base linear coefficient for a Lucas polynomial, \ recurrence relation second term F1(z)." endparam param L2 caption = "Base Linear const" default = (0,0) hint = "Sets the base linear constant for a Lucas polynomial, \ recurrence relation second term F1(z)." endparam param L3 caption = "c in c*Fn-2(z)" default = (-1.0,0) hint = "Sets the constant multiplier of Fn-2(z) \ for a Lucas polynomial, \ recurrence relation nth term Fn(z)." endparam param L4 caption = "a in (a*z+c)*Fn-1(z)" default = (2.0,0) hint = "Sets the coefficient a in (a*z+c)*Fn-1(z) \ for a Lucas polynomial, \ recurrence relation nth term Fn(z)." endparam param L5 caption = "c in (a*z+c)*Fn-1(z)" default = (0,0) hint = "Sets the constant c in (a*z+c)*Fn-1(z) \ for a Lucas polynomial, \ recurrence relation nth term Fn(z)." endparam param rot caption = "Rotation (Rads)" default = (0,0) hint = "For rotation using the switch preview, the real (horizontal) sets \ the direction and the imaginary (vertical) sets the pitch." endparam func fn1 caption = "Inside/Co-ord Fn" default = ident() hint = "Applied to the complex value to be passed to the colouring \ when using the Inside, Co-ordinate or Depth options. In Inside mode \ this function is applied to the complex (z) value used at the \ end of each iteration." endfunc func fn2 caption = "First Fn" default = ident() hint = "Applied to 'Z' at the start of each iteration. \ Note that some settings require a larger bailout \ value and others will require the Convergent bailout method." endfunc switch: type = "MMFs-Solid3DPoly" fractal = fractal converge = converge bailout = bailout txy = txy tz = tz r = r r1 = r1 view = view f = f trackin = trackin cutlr = cutlr leftcut = leftcut rightcut = rightcut cuttb = cuttb topcut = topcut btmcut = btmcut cutfb = cutfb frontcut = frontcut backcut = backcut cutscale = cutscale cutcentre = cutcentre cutcentre1 = cutcentre1 movecut = movecut rotcut = rotcut cutrot1 = cutrot1 cutrot2 = cutrot2 cutsphere = cutsphere rcut = rcut spherecentre = spherecentre spherecentre1 = spherecentre1 movesphere = movesphere rotsphere = rotsphere clipall = clipall detail = detail smart = smart nobinary = nobinary bindepth = bindepth change = change method = method trapval = trapval traprot = traprot traptype = traptype useangle = useangle usethreshold = usethreshold threshold = threshold minval = minval solid = solid axes = axes angle1 = angle1 angle2 = angle2 angle3 = angle3 offset = offset colour = colour inside = inside ambient = ambient diffuse = diffuse specular = specular specsize = specsize clamp = clamp light = light movelight = movelight light1 = light1 light2 = light2 light3 = light3 light4 = light4 shadow = shadow degree = degree k = k al = a1 be = be L0 = L0 L1 = L1 L2 = L2 L3 = L3 L4 = L4 L5 = L5 rot = #pixel fn1 = fn1 fn2 = fn2 } MMFt-Solid3DQuaternions { ; ; Solid 3D Quaternions ; (c) Dave Makin (Makin' Magic) ; http://www.crosswinds.net/~makinmagic/ ; http://website.lineone.net/~dave_makin/ ; http://skyscraper.fortunecity.com/terabyte/966/ ; ; Updated 24th September 2001 - added the ability ; to rotate the fractals using the switch-preview ; and fixed a bug in the Lambda Julias - NB. older ; UPRs using the Lambda Julia will now render ; differently. ; ; Created 5th June 2001 ; ; i*i=j*j=k*k=-1 ; i*j=k j*k=i k*i=j ; j*i=-k k*j=-i i*k=-j ; q1 = x1 + y1.i + z1.j + w1.k ; q2 = x2 + y2.i + z2.j + w2.k ; q1.q2 = (x1 + y1.i + z1.j + w1.k).(x2 + y2.i + z2.j + w2.k) ; q1.q2 = x1.x2 + x1.y2.i + x1.z2.j + x1.w2.k ; + y1.i.x2 + y1.i.y2.i + y1.i.z2.j + y1.i.w2.k ; + z1.j.x2 + z1.j.y2.i + z1.j.z2.j + z1.j.w2.k ; + w1.k.x2 + w1.k.y2.i + w1.k.z2.j + w1.k.w2.k ; q1.q2 = x1.x2 + x1.y2.i + x1.z2.j + x1.w2.k ; + y1.x2.i - y1.y2 + y1.z2.k - y1.w2.j ; + z1.x2.j - z1.y2.k - z1.z2 + z1.w2.i ; + w1.x2.k + w1.y2.j - w1.z2.i - w1.w2 ; q1.q2 = x1.x2 - y1.y2 - z1.z2 - w1.w2 ; +(x1.y2 + y1.x2 + z1.w2 - w1.z2).i ; +(x1.z2 - y1.w2 + z1.x2 + w1.y2).j ; +(x1.w2 + y1.z2 - z1.y2 + w1.x2).k $ifdef VER50 global: import "mmf.ulb" MMF_AltfBm fbm1 = 0 MMF_AltfBm fbm2 = 0 MMF_AltfBm fbm3 = 0 if @colour==4 fbm1 = new @fbm1(0) fbm2 = new @fbm2(0) fbm3 = new @fbm3(0) fbm1.GlobalInit(0) fbm2.GlobalInit(0) fbm3.GlobalInit(0) endif $endif init: complex pwr = @pwr-1.0 float rp = real(@pwr) float rp1 = rp-1.0 float a=#pi/180.0 float twopi = 2.0*#pi float cs = @traprot1*a float sn = sin(cs) float cs = cos(cs) complex tval1 = real(@trapval1)*cs-imag(@trapval1)*sn \ +flip(real(@trapval1)*sn+imag(@trapval1)*cs) cs = @traprot2*a sn = sin(cs) cs = cos(cs) complex tval2 = real(@trapval2)*cs-imag(@trapval2)*sn \ +flip(real(@trapval2)*sn+imag(@trapval2)*cs) complex z=(0,0) ; complex zz1 ; complex zz2 ; complex zz3 float mx=0 float my=0 float mz=0 float mw=0 float lx=0 float ly=0 float lz=0 float lw=0 float wi=0 float lx=0 float ly=0 float lz=0 float lw=0 float xj=0 float yj=0 float zj=0 float wj=0 float xk=0 float yk=0 float zk=0 float wk=0 float a1=a*@angle1 + imag(@rot) float a2=a*@angle2 - real(@rot) float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float m1r0c0=c2 float m1r0c1=0 float m1r0c2=-s2 float m1r1c0=s1*s2 float m1r1c1=c1 float m1r1c2=s1*c2 float m1r2c0=c1*s2 float m1r2c1=-s1 float m1r2c2=c1*c2 float dtl=@detail if @smart dtl=0.1*(@detail+8.0) endif float x0=0 float y0=0 float z0=0 float w0=0 float x1=0 float y1=0 float z1=0 float x2=0 float y2=0 float z2=0 float x3=0 float y3=0 float z3=0 float x4=0 float y4=0 float z4=0 float x5=0 float y5=0 float z5=0 float r2c0=0 float r2c1=0 float r2c2=0 if @colour==0 && @light>0 if @movelight a1=a1+a*@light1 a2=a2+a*@light2 else a1=a*@light1 a2=a*@light2 endif c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) r2c0=c1*s2 r2c1=-s1 r2c2=c1*c2 endif float shxs=0 float shys=0 float shzs=0 float shws=0 float shxb=0 float shyb=0 float shzb=0 float shwb=0 float shxsb=0 float shysb=0 float shzsb=0 float shwsb=0 float shv=0 bool shadow=false float shad=(1-@shadow) bool clipped = @cutlr || @cuttb || @cutfb float cs1 = 0.0 float sn1 = 0.0 float cr0c0=0.0 float cr0c1=0.0 float cr0c2=0.0 float cr1c0=0.0 float cr1c1=0.0 float cr1c2=0.0 float cr2c0=0.0 float cr2c1=0.0 float cr2c2=0.0 if clipped && (@cutrot1!=0.0 || @cutrot2!=0.0) cs1 = 0.0 cs = @cutrot1*a cs1 = @cutrot2*a sn = sin(cs) cs = cos(cs) sn1 = sin(cs1) cs1 = cos(cs1) cr0c0=cs1 cr0c1=0.0 cr0c2=-sn1 cr1c0=sn*sn1 cr1c1=cs cr1c2=sn*cs1 cr2c0=cs*sn1 cr2c1=-sn cr2c2=cs*cs1 endif a=a*@angle3 s1=sin(a) c1=cos(a) float d=0.0 float dzx=0.0 float dzy=0.0 float dzz=0.0 float dzw=0.0 float dxx=0.0 float dxy=0.0 float dxz=0.0 float dxw=0.0 float dyx=0.0 float dyy=0.0 float dyz=0.0 float dyw=0.0 float dd=0.0 if @colour==0 d=1/(160*#magn) dzx=2*m1r2c0*d dzy=2*m1r2c1*d dzz=2*m1r2c2*d*c1 dzw=2*m1r2c2*d*s1 if @f<1e-5 dxx=m1r0c0*d dxy=m1r0c1*d dxz=m1r0c2*d*c1 dxw=m1r0c2*d*s1 dyx=m1r1c0*d dyy=m1r1c1*d dyz=m1r1c2*d*c1 dyw=m1r1c2*d*s1 else dd=d/@f dxx=m1r0c0*dd dxy=m1r0c1*dd dxz=m1r0c2*dd*c1 dxw=m1r0c2*dd*s1 dyx=m1r1c0*dd dyy=m1r1c1*dd dyz=m1r1c2*dd*c1 dyw=m1r1c2*dd*s1 dd = 0.0 endif endif complex o=#pixel-#center float x=real(o) float y=imag(o) bool found=false float v=@view float alpha = 1e200 float beta = 0.0 float aval = 0.0 float lcut = @leftcut*@cutscale+real(@cutcentre) float rcut = @rightcut*@cutscale+real(@cutcentre) float tcut = @topcut*@cutscale+imag(@cutcentre) float bcut = @btmcut*@cutscale+imag(@cutcentre) float fcut = @frontcut*@cutscale+@cutcentre1 float bkcut = @backcut*@cutscale+@cutcentre1 if @movecut lcut = lcut + real(@txy) rcut = rcut + real(@txy) tcut = tcut + imag(@txy) bcut = bcut + imag(@txy) fcut = fcut + @tz bkcut = bkcut + @tz endif float xcc = 0.0 float ycc = 0.0 float zcc = 0.0 float xss = 0.0 float yss = 0.0 float zss = 0.0 float wss = 0.0 float cc = 0.0 float xc=0.0 float yc=0.0 float zc=0.0 float wc = 0.0 float xs=0.0 float ys=0.0 float zs=0.0 float ws=0.0 float xo=0.0 float yo=0.0 float zo=0.0 float wo = 0.0 float s2=0.0 float zzo = 0.0 if @f<1e-5 xc=real(#center)+@trackin*(x*m1r0c0+y*m1r1c0)+real(@txy)-@r*m1r2c0 yc=imag(#center)+@trackin*(x*m1r0c1+y*m1r1c1)+imag(@txy)-@r*m1r2c1 zc=@trackin*(x*m1r0c2+y*m1r1c2)+@tz-@r*m1r2c2 xs=m1r2c0 ys=m1r2c1 zs=m1r2c2 if clipped if (@cutrot1==0.0 && @cutrot2==0.0 && !@rotcut) xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs else xo = real(@txy) yo = imag(@txy) if @rotcut xcc=real(#center)+@trackin*x+xo ycc=imag(#center)+@trackin*y+yo zcc=@tz-@r xss = 0.0 yss = 0.0 zss = 1.0 else xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs endif if @cutrot1!=0.0 || @cutrot2!=0.0 aval = xo+(xcc-xo)*cr0c0 + (ycc-yo)*cr1c0 + (zcc-@tz)*cr2c0 cc = yo+(xcc-xo)*cr0c1 + (ycc-yo)*cr1c1 + (zcc-@tz)*cr2c1 zcc = @tz+(xcc-xo)*cr0c2 + (ycc-yo)*cr1c2 + (zcc-@tz)*cr2c2 xcc = aval ycc = cc aval = xss*cr0c0 + yss*cr1c0 + zss*cr2c0 cc = xss*cr0c1 + yss*cr1c1 + zss*cr2c1 zss = xss*cr0c2 + yss*cr1c2 + zss*cr2c2 xss = aval yss = cc endif endif endif if clipped || @cutsphere bool clr = @cutlr bool ctb = @cuttb bool cfb = @cutfb if abs(xss)<=1e-19 if @cutlr && (xccrcut) found = true else clr = false endif endif if abs(yss)<=1e-19 if @cuttb && (ycc>tcut || yccbkcut) found = true else cfb = false endif endif clipped = clr || ctb || cfb if !found && (clipped || @cutsphere) if clr && abs(xss)>1e-20 aval=(lcut-xcc)/xss if ctb xo = ycc+aval*yss endif if cfb yo = zcc+aval*zss endif if (!ctb || (xo<=tcut && xo>=bcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) alpha = aval beta = aval endif aval=(rcut-xcc)/xss if ctb xo = ycc+aval*yss endif if cfb yo = zcc+aval*zss endif if (!ctb || (xo<=tcut && xo>=bcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif endif if ctb && abs(yss)>1e-20 aval=(tcut-ycc)/yss if clr xo = xcc+aval*xss endif if cfb yo = zcc+aval*zss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif aval=(bcut-ycc)/yss if clr xo = xcc+aval*xss endif if cfb yo = zcc+aval*zss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif endif if cfb && abs(zss)>1e-20 aval=(fcut-zcc)/zss if clr xo = xcc+aval*xss endif if ctb yo = ycc+aval*yss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!ctb || (yo<=tcut && yo>=bcut)) if avalbeta beta = aval endif endif aval=(bkcut-zcc)/zss if clr xo = xcc+aval*xss endif if ctb yo = ycc+aval*yss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!ctb || (yo<=tcut && yo>=bcut)) if avalbeta beta = aval endif endif endif if @clipall && clipped && alpha>1e199 found = true elseif @cutsphere cc = @spherecentre1 xo = real(@spherecentre) yo = imag(@spherecentre) if @movesphere xo = xo + real(@txy) yo = yo + imag(@txy) cc = cc + @tz endif float aa = 0.0 float bb = 0.0 if @rotsphere xo = xo-real(@txy) yo = yo-imag(@txy) cc = cc - @tz aa = real(@txy)+xo*m1r0c0+yo*m1r1c0+cc*m1r2c0 bb = imag(@txy)+xo*m1r0c1+yo*m1r1c1+cc*m1r2c1 cc = @tz+xo*m1r0c2+yo*m1r1c2+cc*m1r2c2 xo = aa yo = bb endif cc = zc - cc xo = xc - xo yo = yc - yo aa = 2.0*(xs*xs + ys*ys + zs*zs) bb = 2.0*(xs*xo+ys*yo+zs*cc) cc = bb*bb - 2.0*aa*(xo*xo + yo*yo + cc*cc - @rcut) if cc<0.0 if @clipall found = true endif else aa = 1.0/aa xo = aa*(-bb + sqrt(cc)) yo = aa*(-bb - sqrt(cc)) if @clipall || !clipped if alpha>1e199 alpha = 0.0 beta = v endif if (xo>=beta && yo>=beta) || (xo<=alpha && yo<=alpha) found = true elseif xoalpha alpha = xo endif if yoalpha alpha = yo endif if xobeta beta = yo endif else if yobeta beta = xo endif endif endif endif if !found if alpha>=v || beta<=0.0 || alpha>beta found = true else if alpha>0.0 xc = xc + alpha*xs yc = yc + alpha*ys zc = zc + alpha*zs else alpha = 0.0 endif if beta>v beta=v endif v = beta - alpha endif endif endif endif if !found v = v*dtl ws = 1.0/dtl xs = xs*ws ys = ys*ws zs = zs*ws ws=zs*s1 zs=zs*c1 wc=zc*s1 zc=zc*c1 if @offset>0 zc=zc-@offset*s1 wc=wc+@offset*c1 endif xo=xc yo=yc zzo=zc*c1+wc*s1 endif else xo=real(#center)+real(@txy)-(@r+@f)*m1r2c0 yo=imag(#center)+imag(@txy)-(@r+@f)*m1r2c1 zo=@tz-(@r+@f)*m1r2c2 wc = 0.0 wo = 0.0 if @trackin!=1.0 wc = 1.0 - @trackin xo = xo + wc*m1r2c0 yo = yo + wc*m1r2c1 zo = zo + wc*m1r2c2 endif xs=x*m1r0c0+y*m1r1c0+@f*m1r2c0 ys=x*m1r0c1+y*m1r1c1+@f*m1r2c1 zs=x*m1r0c2+y*m1r1c2+@f*m1r2c2 zc = (@r+@f-@r1+@trackin-1)/@f xc=xo+xs*zc yc=yo+ys*zc zc=zo+zs*zc s2=1.0/sqrt(xs*xs+ys*ys+zs*zs) xs=xs*s2 ys=ys*s2 zs=zs*s2 if clipped if (@cutrot1==0.0 && @cutrot2==0.0 && !@rotcut) xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs else wc = real(@txy) wo = imag(@txy) if @rotcut xss = x yss = y zss = @f zcc = (@r+@f-@r1+@trackin-1)/@f xcc=real(#center)+wc+xss*zcc ycc=imag(#center)+wo+yss*zcc zcc=@tz-(@r+@f)+zss*zcc if @trackin!=1.0 zcc = zcc + 1.0 - @trackin endif xss=xss*s2 yss=yss*s2 zss=zss*s2 else xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs endif if @cutrot1!=0.0 || @cutrot2!=0.0 aval = wc+(xcc-wc)*cr0c0 + (ycc-wo)*cr1c0 + (zcc-@tz)*cr2c0 cc = wo+(xcc-wc)*cr0c1 + (ycc-wo)*cr1c1 + (zcc-@tz)*cr2c1 zcc = @tz+(xcc-wc)*cr0c2 + (ycc-wo)*cr1c2 + (zcc-@tz)*cr2c2 xcc = aval ycc = cc aval = xss*cr0c0 + yss*cr1c0 + zss*cr2c0 cc = xss*cr0c1 + yss*cr1c1 + zss*cr2c1 zss = xss*cr0c2 + yss*cr1c2 + zss*cr2c2 xss = aval yss = cc endif endif endif if clipped || @cutsphere bool clr = @cutlr bool ctb = @cuttb bool cfb = @cutfb if abs(xss)<=1e-19 if @cutlr && (xccrcut) found = true else clr = false endif endif if abs(yss)<=1e-19 if @cuttb && (ycc>tcut || yccbkcut) found = true else cfb = false endif endif clipped = clr || ctb || cfb if !found && (clipped || @cutsphere) if clr && abs(xss)>1e-20 aval=(lcut-xcc)/xss if ctb wc = ycc+aval*yss endif if cfb wo = zcc+aval*zss endif if (!ctb || (wc<=tcut && wc>=bcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) alpha = aval beta = aval endif aval=(rcut-xcc)/xss if ctb wc = ycc+aval*yss endif if cfb wo = zcc+aval*zss endif if (!ctb || (wc<=tcut && wc>=bcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif endif if ctb && abs(yss)>1e-20 aval=(tcut-ycc)/yss if clr wc = xcc+aval*xss endif if cfb wo = zcc+aval*zss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif aval=(bcut-ycc)/yss if clr wc = xcc+aval*xss endif if cfb wo = zcc+aval*zss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif endif if cfb && abs(zss)>1e-20 aval=(fcut-zcc)/zss if clr wc = xcc+aval*xss endif if ctb wo = ycc+aval*yss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!ctb || (wo<=tcut && wo>=bcut)) if avalbeta beta = aval endif endif aval=(bkcut-zcc)/zss if clr wc = xcc+aval*xss endif if ctb wo = ycc+aval*yss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!ctb || (wo<=tcut && wo>=bcut)) if avalbeta beta = aval endif endif endif if @clipall && clipped && alpha>1e199 found = true elseif @cutsphere cc = @spherecentre1 wc = real(@spherecentre) wo = imag(@spherecentre) if @movesphere wc = wc + real(@txy) wo = wo + imag(@txy) cc = cc + @tz endif float aa = 0.0 float bb = 0.0 if @rotsphere wc = wc-real(@txy) wo = wo-imag(@txy) cc = cc - @tz aa = real(@txy)+wc*m1r0c0+wo*m1r1c0+cc*m1r2c0 bb = imag(@txy)+wc*m1r0c1+wo*m1r1c1+cc*m1r2c1 cc = @tz+wc*m1r0c2+wo*m1r1c2+cc*m1r2c2 wc = aa wo = bb endif cc = zc - cc wc = xc - wc wo = yc - wo float aa = 2.0*(xs*xs + ys*ys + zs*zs) float bb = 2.0*(xs*wc+ys*wo+zs*cc) cc = bb*bb - 2.0*aa*(wc*wc + wo*wo + cc*cc - @rcut) if cc<0.0 if @clipall found = true endif else aa = 1.0/aa wc = aa*(-bb + sqrt(cc)) wo = aa*(-bb - sqrt(cc)) if @clipall || !clipped if alpha>1e199 alpha = 0.0 beta = v endif if (wc>=beta && wo>=beta) || (wc<=alpha && wo<=alpha) found = true elseif wcalpha alpha = wc endif if woalpha alpha = wo endif if wcbeta beta = wo endif else if wobeta beta = wc endif endif endif endif if !found if alpha>=v || beta<=0.0 || alpha>beta found = true else if alpha>0.0 xc = xc + alpha*xs yc = yc + alpha*ys zc = zc + alpha*zs else alpha = 0.0 endif if beta>v beta=v endif v = beta - alpha endif endif endif endif if !found v = v*dtl wc = 1.0/dtl xs = xs*wc ys = ys*wc zs = zs*wc wc=zc*s1 zc=zc*c1 if @offset>0 zc=zc-@offset*s1 wc=wc+@offset*c1 endif wo=zo*s1 zo=zo*c1 if @offset>0 zo=zo-@offset*s1 wo=wo+@offset*c1 endif zzo=zo*c1+wo*s1 ws=zs*s1 zs=zs*c1 endif endif float px=0.0 float py=0.0 float pz=0.0 float shz=0.0 float shw=0.0 float xb=0.0 float yb=0.0 float zb=0.0 float wb=0.0 float xsb=0.0 float ysb=0.0 float zsb=0.0 float wsb=0.0 float xsub=0.0 float ysub=0.0 float zsub=0.0 float wsub=0.0 float xt=xc float yt=yc float zt=zc float wt=wc float sq=0 float xi=0 float yi=0 float zi=0 float zz=0 float w=wc int j=0 int k=0 float lsq=0 float min=0.0 float min1=0.0 complex tv1=(0,0) complex tv2=(0,0) float yt=yc float zt=zc float wt=wc float sq=0 float xi=0 float yi=0 float zi=0 float zz=0 float w=wc int j=0 int k=0 float lsq=0 float min=0.0 float min1=0.0 complex tv1=(0,0) complex tv2=(0,0) float ldir=@bailout*@bailout float ldir1=ldir float ldir2=ldir int di=65536 int di1=di float i=0.0 int s=0 int p=0 float xp=xc float yp=yc float zp=zc float wp=wc bool b=true if !found if @colour==0 && @light>4 px=real(#center)+real(@txy)-@light3*r2c0 py=imag(#center)+imag(@txy)-@light3*r2c1 pz=@tz-@light3*r2c2 if @light<7 if @offset>0 s2=pz*s1+@offset*c1 pz=pz*c1-@offset*s1 pz=pz*c1+s2*s1 endif else shz=pz*c1 shw=pz*s1 if @offset>0 shz=shz-@offset*s1 shw=shw+@offset*c1 pz=shz*c1+shw*s1 endif endif endif xb=0.0000152587890625*xs yb=0.0000152587890625*ys zb=0.0000152587890625*zs wb=0.0000152587890625*ws xss = xs yss = ys zss = zs wss = ws xsb=0.5*xs ysb=0.5*ys zsb=0.5*zs wsb=0.5*ws xsub=xsb ysub=ysb zsub=zsb wsub=wsb if @colour>0 p=-1 endif repeat i=0.0 found=false xc=xp yc=yp zc=zp wc=wp repeat s=0 repeat if s==0 ;iterate at current step b=true ;ready for binary search x=xc y=yc zz=zc w=wc elseif s==1 ;iterate at current step + a bit k=j lsq=sq if @smart x=xc+xs*0.0000152587890625 y=yc+ys*0.0000152587890625 zz=zc+zs*0.0000152587890625 w=wc+ws*0.0000152587890625 else x=xc+xb y=yc+yb zz=zc+zb w=wc+wb endif elseif s==2 && b ;initiate binary search if @solid==1 found=true endif if @smart xsub=0.5*xs ysub=0.5*ys zsub=0.5*zs wsub=0.5*ws else xsub=xsb ysub=ysb zsub=zsb wsub=wsb endif xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub x=xt y=yt zz=zt w=wt elseif s<@bindepth ;complete binary search if b xsub=0.5*xsub ysub=0.5*ysub zsub=0.5*zsub wsub=0.5*wsub if ldir2<0 xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub else xt=xt+xsub yt=yt+ysub zt=zt+zsub wt=wt+wsub endif x=xt y=yt zz=zt w=wt else x=xt+0.000030517578125*xsub y=yt+0.000030517578125*ysub zz=zt+0.000030517578125*zsub w=wt+0.000030517578125*wsub endif endif j=0 if @mandy>0 mx=@xconst my=@yconst mz=@zconst mw=@wconst endif if @fractal==3 if @mandy==0 lx=x ly=y lz=zz lw=w else lx=mx ly=my lz=mz lw=mw endif elseif (@fractal==4 || @fractal==6 || @fractal==8 || @fractal==9) \ && @mandy==1 mx=mx+x my=my+y mz=mz+zz mw=mw+w endif if @trans xi = y y = y + y*abs(zz) zz = zz + zz*abs(xi) endif if @switch==1 xi = w w = zz zz = y y = x x = xi elseif @switch==2 xi = w w = y y = xi xi = x x = zz zz = xi elseif @switch==3 xi = w w = x x = y y = zz zz = xi endif repeat if @mandy==0 if @swapyx xi = y y = x x= xi endif if @swapzx xi = zz zz = x x= xi endif if @swapwx xi = w w = x x= xi endif if @swapzy xi = y y = zz z = xi endif if @swapwy xi = w w = y y = xi endif if @swapwz xi = w w = zz zz = xi endif if @flip xi = sqrt(y*y+zz*zz+w*w) if y<0 xi = -xi endif if xi==0 y = x x = 0.0 elseif x==0 y = zz = w = 0 x = xi else xi = x/xi y = y*xi zz = zz*xi w = w*xi if @bug x = abs(x)/xi else x = x/xi endif endif endif if @conj y = -y zz = -zz w = -w endif if @fractal==0 xi=x*x-y*y-zz*zz-w*w+@xconst y=2*x*y+@yconst zz=2*x*zz+@zconst w=2*x*w+@wconst sq=xi*xi+y*y+zz*zz+w*w x=xi elseif @fractal==1 xi=x-x*x+y*y+zz*zz+w*w x=1-2*x yi=y*x zi=zz*x w=w*x x=@xconst*xi-@yconst*yi-@zconst*zi-@wconst*w y=@yconst*xi+@xconst*yi+@wconst*zi-@zconst*w zz=@zconst*xi-@wconst*yi+@xconst*zi+@yconst*w w=@wconst*xi+@zconst*yi-@yconst*zi+@xconst*w sq=x*x+y*y+zz*zz+w*w elseif @fractal==2 xi=1-2*x x=x-x*x+y*y+zz*zz+w*w+@xconst y=y*xi+@yconst zz=zz*xi+@zconst w=w*xi+@wconst sq=x*x+y*y+zz*zz+w*w elseif @fractal==3 xi=x*x-y*y-zz*zz-w*w+lx+@xconst yi=2*x*y+ly+@yconst zi=2*x*zz+lz+@zconst wi=2*x*w+lw+@wconst lx=x ly=y lz=zz lw=w sq=xi*xi+yi*yi+zi*zi+wi*wi x=xi y=yi zz=zi w=wi elseif @fractal==4 lx=x ly=y lz=zz lw=w xi=x*x-y*y-zz*zz-w*w yi=2*x*y zi=2*x*zz wi=2*x*w xj=2.0*(xi*x-yi*y-zi*zz-wi*w)+@xconst yj=2.0*(xi*y+yi*x+zi*w-wi*zz)+@yconst zj=2.0*(xi*zz-yi*w+zi*x+wi*y)+@zconst wj=2.0*(xi*w+yi*zz-zi*y+wi*x)+@wconst sq=1.0/(3.0*(xi*xi+yi*yi+zi*zi+wi*wi)) x= (xi*xj+yi*yj+zi*zj+wi*wj)*sq y= (xi*yj-yi*xj-zi*wj+wi*zj)*sq zz=(xi*zj+yi*wj-zi*xj-wi*yj)*sq w= (xi*wj-yi*zj+zi*yj-wi*xj)*sq sq=1.0/((x-lx)*(x-lx)+(y-ly)*(y-ly) \ +(zz-lz)*(zz-lz)+(w-lw)*(w-lw)) elseif @fractal==5 if (xi = sqrt(y*y + zz*zz + w*w))<1e-200 x = x^real(@pwr) + @xconst y = @yconst zz = @zconst w = @wconst else z = log(x+flip(xi)) zi=imag(z)/xi xi=real(z) yi = zi*y wi = zi*w zi = zi*zz x=real(@pwr)*xi-imag(@pwr)*yi-real(@pwr1)*zi-imag(@pwr1)*wi y=imag(@pwr)*xi+real(@pwr)*yi+imag(@pwr1)*zi-real(@pwr1)*wi zz=real(@pwr1)*xi-imag(@pwr1)*yi+real(@pwr)*zi+imag(@pwr)*wi w=imag(@pwr1)*xi+real(@pwr1)*yi-imag(@pwr)*zi+real(@pwr)*wi if (xi = sqrt(y*y + zz*zz + w*w))<1e-200 x = exp(x) + @xconst y = @yconst zz = @zconst w = @wconst else z = exp(x+flip(xi)) zi = imag(z)/xi x = real(z) + @xconst y = zi*y + @yconst zz = zi*zz + @zconst w = zi*w + @wconst endif endif sq=x*x+y*y+zz*zz+w*w elseif @fractal==6 lx=x ly=y lz=zz lw=w if (xj = sqrt(y*y + zz*zz + w*w))<1e-200 xi = x^real(pwr) yi = 0.0 zi = 0.0 wi = 0.0 else z = log(x+flip(xj)) zj = imag(z)/xj xj = real(z) yj = zj*y wj = zj*w zj = zj*zz xi=real(pwr)*xj-imag(pwr)*yj-real(@pwr1)*zj-imag(@pwr1)*wj yi=imag(pwr)*xj+real(pwr)*yj+imag(@pwr1)*zj-real(@pwr1)*wj zi=real(@pwr1)*xj-imag(@pwr1)*yj+real(pwr)*zj+imag(pwr)*wj wi=imag(@pwr1)*xj+real(@pwr1)*yj-imag(pwr)*zj+real(pwr)*wj if (xj = sqrt(yi*yi + zi*zi + wi*wi))<1e-200 xi = exp(xi) yi = 0.0 zi = 0.0 wi = 0.0 else z = exp(xi+flip(xj)) zj = imag(z)/xj xi = real(z) yi = zj*yi zi = zj*zi wi = zj*wi endif endif xk=x*xi-y*yi-zz*zi-w*wi yk=y*xi+x*yi+w*zi-zz*wi zk=zz*xi-w*yi+x*zi+y*wi wk=w*xi+zz*yi-y*zi+x*wi if @mulfirst xj=real(@pwr)*xi-imag(@pwr)*yi-real(@pwr1)*zi-imag(@pwr1)*wi yj=imag(@pwr)*xi+real(@pwr)*yi+imag(@pwr1)*zi-real(@pwr1)*wi zj=real(@pwr1)*xi-imag(@pwr1)*yi+real(@pwr)*zi+imag(@pwr)*wi wj=imag(@pwr1)*xi+real(@pwr1)*yi-imag(@pwr)*zi+real(@pwr)*wi xi=real(pwr)*xk-imag(pwr)*yk-real(@pwr1)*zk-imag(@pwr1)*wk \ +@xconst yi=imag(pwr)*xk+real(pwr)*yk+imag(@pwr1)*zk-real(@pwr1)*wk \ +@yconst zi=real(@pwr1)*xk-imag(@pwr1)*yk+real(pwr)*zk+imag(pwr)*wk \ +@zconst wi=imag(@pwr1)*xk+real(@pwr1)*yk-imag(pwr)*zk+real(pwr)*wk \ +@wconst else xj=xi*real(@pwr)-yi*imag(@pwr)-zi*real(@pwr1)-wi*imag(@pwr1) yj=yi*real(@pwr)+xi*imag(@pwr)+wi*real(@pwr1)-zi*imag(@pwr1) zj=zi*real(@pwr)-wi*imag(@pwr)+xi*real(@pwr1)+yi*imag(@pwr1) wj=wi*real(@pwr)+zi*imag(@pwr)-yi*real(@pwr1)+xi*imag(@pwr1) xi=xk*real(pwr)-yk*imag(pwr)-zk*real(@pwr1)-wk*imag(@pwr1) \ +@xconst yi=yk*real(pwr)+xk*imag(pwr)+wk*real(@pwr1)-zk*imag(@pwr1) \ +@yconst zi=zk*real(pwr)-wk*imag(pwr)+xk*real(@pwr1)+yk*imag(@pwr1) \ +@zconst wi=wk*real(pwr)+zk*imag(pwr)-yk*real(@pwr1)+xk*imag(@pwr1) \ +@wconst endif sq=1.0/(xj*xj+yj*yj+zj*zj+wj*wj) x=(xi*xj+yi*yj+zi*zj+wi*wj)*sq y=(yi*xj-xi*yj-wi*zj+zi*wj)*sq zz=(zi*xj+wi*yj-xi*zj-yi*wj)*sq w=(wi*xj-zi*yj+yi*zj-xi*wj)*sq sq=1.0/((x-lx)*(x-lx)+(y-ly)*(y-ly) \ +(zz-lz)*(zz-lz)+(w-lw)*(w-lw)) elseif @fractal==7 if (xi=sqrt(y*y+zz*zz+w*w))<1e-200 x = x^rp + @xconst y = @yconst zz= @zconst w = @wconst else z = (x+flip(xi))^rp xi = imag(z)/xi x = real(z)+@xconst y = xi*y+@yconst zz = xi*zz+@zconst w = xi*w+@wconst endif sq = x*x+y*y+zz*zz+w*w elseif @fractal==8 lx = x ly = y lz = zz lw = w if (xi=sqrt(y*y+zz*zz+w*w))<1e-200 xj = x^rp1 yj = 0.0 zj = 0.0 wj = 0.0 else z = (x+flip(xi))^rp1 xi = imag(z)/xi xj = real(z) yj = xi*y zj = xi*zz wj = xi*w endif xi = rp1*(xj*x - yj*y - zj*zz - wj*w)+@xconst yi = rp1*(xj*y + yj*x + zj*w - wj*zz)+@yconst zi = rp1*(xj*zz - yj*w + zj*x + wj*y)+@zconst wi = rp1*(xj*w + yj*zz - zj*y + wj*x)+@wconst w = 1.0/(rp*(xj*xj+yj*yj+zj*zj+wj*wj)) x = (xj*xi + yj*yi + zj*zi + wj*wi)*w y = (xj*yi - yj*xi - zj*wi + wj*zi)*w zz= (xj*zi + yj*wi - zj*xi - wj*yi)*w w = (xj*wi - yj*zi + zj*yi - wj*xi)*w sq=1.0/((x-lx)*(x-lx)+(y-ly)*(y-ly) \ +(zz-lz)*(zz-lz)+(w-lw)*(w-lw)) elseif @fractal==9 if x>=0 xi = x - 1.0 else xi = x + 1.0 endif yi = y zi = zz wi = w x = xi*@xconst - yi*@yconst - zi*@zconst - wi*@wconst y = xi*@yconst + yi*@xconst + zi*@wconst - wi*@zconst zz= xi*@zconst - yi*@wconst + zi*@xconst + wi*@yconst w = xi*@wconst + yi*@zconst - zi*@yconst + wi*@xconst sq = x*x+y*y+zz*zz+w*w elseif @fractal==10 lx = x ly = y lz = zz x = x*x - y*y - zz*zz - w*w + @xconst y = 2.0*(y*lx + zz*w) + @yconst zz = 2.0*(zz*lx + ly*w) + @zconst w = 2.0*(w*lx + ly*lz) + @wconst sq=x*x+y*y+zz*zz+w*w elseif @fractal==11 lx = x ly = y lz = zz x = x*x - y*y - zz*zz - w*w + @xconst y = 2.0*(y*lx + zz*w) + @yconst zz = 2.0*(zz*lx + ly*w) + @zconst w = 2.0*(w*lx - ly*lz) + @wconst sq=x*x+y*y+zz*zz+w*w elseif @fractal==12 lx = x ly = y lz = zz x = x*x - y*y - zz*zz + w*w + @xconst y = 2.0*(y*lx + zz*w) + @yconst zz = 2.0*(zz*lx + ly*w) + @zconst w = 2.0*(w*lx + ly*lz) + @wconst sq=x*x+y*y+zz*zz+w*w endif else if @swapyx xi = my my = mx mx= xi endif if @swapzx xi = mz mz = mx mx= xi endif if @swapwx xi = mw mw = mx mx= xi endif if @swapzy xi = my my = mz mz = xi endif if @swapwy xi = mw mw = my my = xi endif if @swapwz xi = mw mw = mz mz = xi endif if @flip xi = sqrt(my*my+mz*mz+mw*mw) if my<0 xi = -xi endif if xi==0 my = mx mx = 0.0 elseif mx==0 my = mz = mw = 0 mx = xi else xi = mx/xi my = my*xi mz = mz*xi mw = mw*xi if @bug mx = abs(mx)/xi else mx = mx/xi endif endif endif if @conj my = -my mz = -mz mw = -mw endif if @fractal==0 xi=mx*mx-my*my-mz*mz-mw*mw+x my=2*mx*my+y mz=2*mx*mz+zz mw=2*mx*mw+w sq=xi*xi+my*my+mz*mz+mw*mw mx=xi ; zz1 = mx + flip(my) ; zz2 = mz + flip(mw) ;; zz3 = sin(zz1)*cosh(zz2) + x + flip(y) ;; zz2 = cos(zz1)*sinh(zz2) + zz + flip(w) ; zz3 = zz1*zz1 - zz2*zz2 + x + flip(y) ; zz2 = 2.0*zz1*zz2 + zz + flip(w) ; mx = real(zz3) ; my = imag(zz3) ; mz = real(zz2) ; mw = imag(zz2) ; sq = |zz3| + |zz2| elseif @fractal==1 xi=mx-mx*mx+my*my+mz*mz+mw*mw mx=1-2*mx yi=my*mx zi=mz*mx mw=mw*mx mx=x*xi-y*yi-zz*zi-w*mw my=y*xi+x*yi+w*zi-zz*mw mz=zz*xi-w*yi+x*zi+y*mw mw=w*xi+zz*yi-y*zi+x*mw sq=mx*mx+my*my+mz*mz+mw*mw elseif @fractal==2 xi=1-2*mx mx=mx-mx*mx+my*my+mz*mz+mw*mw+x my=my*xi+y mz=mz*xi+zz mw=mw*xi+w sq=mx*mx+my*my+mz*mz+mw*mw elseif @fractal==3 xi=mx*mx-my*my-mz*mz-mw*mw+lx+x yi=2*mx*my+ly+y zi=2*mx*mz+lz+zz wi=2*mx*mw+lw+w lx=mx ly=my lz=mz lw=mw sq=xi*xi+yi*yi+zi*zi+wi*wi mx=xi my=yi mz=zi mw=wi elseif @fractal==4 lx=mx ly=my lz=mz lw=mw xi=mx*mx-my*my-mz*mz-mw*mw yi=2*mx*my zi=2*mx*mz wi=2*mx*mw xj=2.0*(xi*mx-yi*my-zi*mz-wi*mw)+x yj=2.0*(xi*my+yi*mx+zi*mw-wi*mz)+y zj=2.0*(xi*mz-yi*mw+zi*mx+wi*my)+zz wj=2.0*(xi*mw+yi*mz-zi*my+wi*mx)+w sq=1.0/(3.0*(xi*xi+yi*yi+zi*zi+wi*wi)) mx= (xi*xj+yi*yj+zi*zj+wi*wj)*sq my= (xi*yj-yi*xj-zi*wj+wi*zj)*sq mz=(xi*zj+yi*wj-zi*xj-wi*yj)*sq mw= (xi*wj-yi*zj+zi*yj-wi*xj)*sq sq=1.0/((mx-lx)*(mx-lx)+(my-ly)*(my-ly) \ +(mz-lz)*(mz-lz)+(mw-lw)*(mw-lw)) elseif @fractal==5 if (xi = sqrt(my*my + mz*mz + mw*mw))<1e-200 mx = mx^real(@pwr) + x my = y mz = zz mw = w else z = log(mx+flip(xi)) zi = imag(z)/xi xi = real(z) yi = zi*my wi = zi*mw zi = zi*mz mx=real(@pwr)*xi-imag(@pwr)*yi-real(@pwr1)*zi-imag(@pwr1)*wi my=imag(@pwr)*xi+real(@pwr)*yi+imag(@pwr1)*zi-real(@pwr1)*wi mz=real(@pwr1)*xi-imag(@pwr1)*yi+real(@pwr)*zi+imag(@pwr)*wi mw=imag(@pwr1)*xi+real(@pwr1)*yi-imag(@pwr)*zi+real(@pwr)*wi if (xi = sqrt(my*my + mz*mz + mw*mw))<1e-200 mx = exp(mx) + x my = y mz = zz mw = w else z = exp(mx+flip(xi)) zi = imag(z)/xi mx = real(z) + x my = zi*my + y mz = zi*mz + zz mw = zi*mw + w endif endif sq=mx*mx+my*my+mz*mz+mw*mw elseif @fractal==6 lx=mx ly=my lz=mz=0 lw=mw=0 if (xj = sqrt(my*my + mz*mz + mw*mw))<1e-200 xi = mx^real(pwr) yi = 0.0 zi = 0.0 wi = 0.0 else z = log(mx+flip(xj)) zj = imag(z)/xj xj = real(z) yj = zj*my wj = zj*mw zj = zj*mz xi=real(pwr)*xj-imag(pwr)*yj-real(@pwr1)*zj-imag(@pwr1)*wj yi=imag(pwr)*xj+real(pwr)*yj+imag(@pwr1)*zj-real(@pwr1)*wj zi=real(@pwr1)*xj-imag(@pwr1)*yj+real(pwr)*zj+imag(pwr)*wj wi=imag(@pwr1)*xj+real(@pwr1)*yj-imag(pwr)*zj+real(pwr)*wj if (xj = sqrt(yi*yi + zi*zi + wi*wi))<1e-200 xi = exp(xi) yi = 0.0 zi = 0.0 wi = 0.0 else z = exp(xi+flip(xj)) zj = imag(z)/xj xi = real(z) yi = zj*yi zi = zj*zi wi = zj*wi endif endif xk=mx*xi-my*yi-mz*zi-mw*wi yk=my*xi+mx*yi+mw*zi-mz*wi zk=mz*xi-mw*yi+mx*zi+my*wi wk=mw*xi+mz*yi-my*zi+mx*wi if @mulfirst xj=real(@pwr)*xi-imag(@pwr)*yi-real(@pwr1)*zi-imag(@pwr1)*wi yj=imag(@pwr)*xi+real(@pwr)*yi+imag(@pwr1)*zi-real(@pwr1)*wi zj=real(@pwr1)*xi-imag(@pwr1)*yi+real(@pwr)*zi+imag(@pwr)*wi wj=imag(@pwr1)*xi+real(@pwr1)*yi-imag(@pwr)*zi+real(@pwr)*wi xi=real(pwr)*xk-imag(pwr)*yk-real(@pwr1)*zk-imag(@pwr1)*wk+x yi=imag(pwr)*xk+real(pwr)*yk+imag(@pwr1)*zk-real(@pwr1)*wk+y zi=real(@pwr1)*xk-imag(@pwr1)*yk+real(pwr)*zk+imag(pwr)*wk+zz wi=imag(@pwr1)*xk+real(@pwr1)*yk-imag(pwr)*zk+real(pwr)*wk+w else xj=xi*real(@pwr)-yi*imag(@pwr)-zi*real(@pwr1)-wi*imag(@pwr1) yj=yi*real(@pwr)+xi*imag(@pwr)+wi*real(@pwr1)-zi*imag(@pwr1) zj=zi*real(@pwr)-wi*imag(@pwr)+xi*real(@pwr1)+yi*imag(@pwr1) wj=wi*real(@pwr)+zi*imag(@pwr)-yi*real(@pwr1)+xi*imag(@pwr1) xi=xk*real(pwr)-yk*imag(pwr)-zk*real(@pwr1)-wk*imag(@pwr1)+x yi=yk*real(pwr)+xk*imag(pwr)+wk*real(@pwr1)-zk*imag(@pwr1)+y zi=zk*real(pwr)-wk*imag(pwr)+xk*real(@pwr1)+yk*imag(@pwr1)+zz wi=wk*real(pwr)+zk*imag(pwr)-yk*real(@pwr1)+xk*imag(@pwr1)+w endif sq=1.0/(xj*xj+yj*yj+zj*zj+wj*wj) mx=(xi*xj+yi*yj+zi*zj+wi*wj)*sq my=(yi*xj-xi*yj-wi*zj+zi*wj)*sq mz=(zi*xj+wi*yj-xi*zj-yi*wj)*sq mw=(wi*xj-zi*yj+yi*zj-xi*wj)*sq sq=1.0/((mx-lx)*(mx-lx)+(my-ly)*(my-ly) \ +(mz-lz)*(mz-lz)+(mw-lw)*(mw-lw)) elseif @fractal==7 if (xi=sqrt(my*my+mz*mz+mw*mw))<1e-200 mx = mx^rp + x my = y mz = zz mw = w else z = (mx+flip(xi))^rp xi = imag(z)/xi mx = real(z)+x my = xi*my+y mz = xi*mz+zz mw = xi*mw+w endif sq = mx*mx+my*my+mz*mz+mw*mw elseif @fractal==8 lx = mx ly = my lz = mz lw = mw if (xi=sqrt(my*my+mz*mz+mw*mw))<1e-200 xj = mx^rp1 yj = 0.0 zj = 0.0 wj = 0.0 else z = (mx+flip(xi))^rp1 xi = imag(z)/xi xj = real(z) yj = xi*my zj = xi*mz wj = xi*mw endif xi = rp1*(xj*mx - yj*my - zj*mz - wj*mw)+x yi = rp1*(xj*my + yj*mx + zj*mw - wj*mz)+y zi = rp1*(xj*mz - yj*mw + zj*mx + wj*my)+zz wi = rp1*(xj*mw + yj*mz - zj*my + wj*mx)+w mw = 1.0/(rp*(xj*xj+yj*yj+zj*zj+wj*wj)) mx = (xj*xi + yj*yi + zj*zi + wj*wi)*mw my = (xj*yi - yj*xi - zj*wi + wj*zi)*mw mz= (xj*zi + yj*wi - zj*xi - wj*yi)*mw mw = (xj*wi - yj*zi + zj*yi - wj*xi)*mw sq=1.0/((mx-lx)*(mx-lx)+(my-ly)*(my-ly) \ +(mz-lz)*(mz-lz)+(mw-lw)*(mw-lw)) elseif @fractal==9 if mx>=0 xi = mx - 1.0 else xi = mx + 1.0 endif yi = my zi = mz wi = mw mx = xi*x - yi*y - zi*zz - wi*w my = xi*y + yi*x + zi*w - wi*zz mz = xi*zz - yi*w + zi*x + wi*y mw = xi*w + yi*zz - zi*y + wi*x sq = mx*mx+my*my+mz*mz+mw*mw elseif @fractal==10 lx = mx ly = my lz = mz mx = mx*mx - my*my - mz*mz - mw*mw + x my = 2.0*(my*lx + mz*mw) + y mz = 2.0*(mz*lx + ly*mw) + zz mw = 2.0*(mw*lx + ly*lz) + w sq=mx*mx+my*my+mz*mz+mw*mw elseif @fractal==11 lx = mx ly = my lz = mz mx = mx*mx - my*my - mz*mz - mw*mw + x my = 2.0*(my*lx + mz*mw) + y mz = 2.0*(mz*lx + ly*mw) + zz mw = 2.0*(mw*lx - ly*lz) + w sq=mx*mx+my*my+mz*mz+mw*mw elseif @fractal==12 lx = mx ly = my lz = mz mx = mx*mx - my*my - mz*mz + mw*mw + x my = 2.0*(my*lx + mz*mw) + y mz = 2.0*(mz*lx + ly*mw) + zz mw = 2.0*(mw*lx + ly*lz) + w sq=mx*mx+my*my+mz*mz+mw*mw endif endif if @method==2 if @mandy==0 tv1 = x+flip(y)-tval1 tv2 = zz+flip(w)-tval2 else tv1 = mx+flip(my)-tval1 tv2 = mz+flip(mw)-tval2 endif if @traptype==0 min = |tv1|+|tv2| elseif @traptype==1 min = real(tv1) elseif @traptype==2 min = imag(tv1) elseif @traptype==3 min = real(tv2) elseif @traptype==4 min = imag(tv2) elseif @traptype==5 min = atan2(tv1) elseif @traptype==6 min = atan2(tv2) endif if @traptype>6 min = |tv1| if @usethreshold min = abs(min-@threshold) endif min1 = |tv2| if @usethreshold min1 = abs(min1-@threshold) endif if (@traptype==7 && min<@minval && min1<@minval) \ ||(@traptype==8 && (min<@minval || min1<@minval)) if min1#pi min = min - twopi endif if min<0 min = min + twopi endif endif elseif @traptype>0 && @traptype<5 min = abs(min) elseif @traptype>4 if @useangle==0 min = abs(min) elseif min<0 min = min + twopi endif endif endif j=j+1 until j>=#maxiter || sq>@bailout || (@method==2 && min<@minval) if @method==1 || (@method==3 && j>=#maxiter) if @mandy==0 tv1 = x+flip(y)-tval1 tv2 = zz+flip(w)-tval2 else tv1 = mx+flip(my)-tval1 tv2 = mz+flip(mw)-tval2 endif if @traptype==0 sq = |tv1|+|tv2| elseif @traptype==1 sq = real(tv1) elseif @traptype==2 sq = imag(tv1) elseif @traptype==3 sq = real(tv2) elseif @traptype==4 sq = imag(tv2) elseif @traptype==5 sq = atan2(tv1) elseif @traptype==6 sq = atan2(tv2) endif if @traptype>6 sq = |tv1| if @usethreshold sq = abs(sq-@threshold) endif min1 = |tv2| if @usethreshold min1 = abs(min1-@threshold) endif if (@traptype==7 && sq<@minval && min1<@minval) \ ||(@traptype==8 && (sq<@minval || min1<@minval)) if min1#pi sq = sq - twopi endif if sq<0 sq = sq + twopi endif endif elseif @traptype>0 && @traptype<5 sq = abs(sq) elseif @traptype>4 if @useangle==0 sq = abs(sq) elseif sq<0 sq = sq + twopi endif endif elseif @method==2 sq = min endif if s==0 ;iteration at current step s=1 ;iterate at current step + a bit next time if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true xt=xc yt=yc zt=zc wt=wc s=2 ;initiate binary search next time endif if @nobinary s=-1 endif elseif s==1 ;iteration at current step + a bit if @method==0 di1=j-k ldir1=di1 ;direction, towards/away if di1==0 ;if same iteration ldir1=lsq-sq ;use bailout value for direction endif elseif @method!=3 ldir1=lsq-sq elseif (ldir1=di1=j-k)==0 ldir1 = lsq-sq endif xt=xc yt=yc zt=zc wt=wc s=-1 ;Nothing found, move to next main step position if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true s=2 ;initiate binary search next time elseif (!@change && (ldir>0 && ldir1<0) || (@method==0 && dildir1) s=2 ;initiate binary search next time endif elseif s<@bindepth ;the binary search if b if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true ldir2=-1 s=s+1 else k=j lsq=sq b=false endif else if @method==0 ldir2=j-k if ldir2==0 ldir2=lsq-sq endif elseif @method!=3 ldir2=lsq-sq elseif (ldir2=j-k)==0 ldir2 = lsq-sq endif if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true ldir2=-1 xt=xt+0.000030517578125*xsub yt=yt+0.000030517578125*ysub zt=zt+0.000030517578125*zsub wt=wt+0.000030517578125*wsub endif b=true s=s+1 endif endif if s==@bindepth s=-1 endif until s<0 if !found if @smart if j<=1 xs = xss ys = yss zs = zss ws = wss i=i+1.0 elseif j==2 xs = 0.5*xss ys = 0.5*yss zs = 0.5*zss ws = 0.5*wss i=i+0.5 elseif j==3 xs = 0.25*xss ys = 0.25*yss zs = 0.25*zss ws = 0.25*wss i=i+0.25 elseif j==3 xs = 0.125*xss ys = 0.125*yss zs = 0.125*zss ws = 0.125*wss i=i+0.125 elseif j==4 xs = 0.0625*xss ys = 0.0625*yss zs = 0.0625*zss ws = 0.0625*wss i=i+0.0625 elseif j==5 xs = 0.03125*xss ys = 0.03125*yss zs = 0.03125*zss ws = 0.03125*wss i=i+0.03125 elseif j==6 xs = 0.015625*xss ys = 0.015625*yss zs = 0.015625*zss ws = 0.015625*wss i=i+0.015625 elseif j==7 xs = 0.0078125*xss ys = 0.0078125*yss zs = 0.0078125*zss ws = 0.0078125*wss i=i+0.0078125 elseif j==8 xs = 0.00390625*xss ys = 0.00390625*yss zs = 0.00390625*zss ws = 0.00390625*wss i=i+0.00390625 elseif j==6 xs = 0.001953125*xss ys = 0.001953125*yss zs = 0.001953125*zss ws = 0.001953125*wss i=i+0.001953125 elseif j==7 xs = 0.0009765625*xss ys = 0.0009765625*yss zs = 0.0009765625*zss ws = 0.0009765625*wss i=i+0.0009765625 else xs = 0.00048828125*xss ys = 0.00048828125*yss zs = 0.00048828125*zss ws = 0.00048828125*wss i=i+0.00048828125 endif else i=i+1.0 endif xc=xc+xs yc=yc+ys zc=zc+zs wc=wc+ws ldir=ldir1 endif until i>=v || found==true if @colour==0 if p==0 if found==true x0=xt y0=yt z0=zt w0=wt if @light<3 || (@light>4 && @light<7) if @f<1e-5 xp=xt+dxx-dzx yp=yt+dxy-dzy zp=zt+dxz-dzz wp=wt+dxw-dzw else xp=xt-xo yp=yt-yo zp=zt-zo wp=wt-wo dd=sqrt(xp*xp+yp*yp+zp*zp+wp*wp) xp=xt-dzx+dxx*dd yp=yt-dzy+dxy*dd zp=zt-dzz+dxz*dd wp=wt-dzw+dxw*dd endif ldir=1 di=0 p=2 else if @smart shxs=xss shys=yss shzs=zss shws=wss else shxs=xs shys=ys shzs=zs shws=ws endif shxb=xb shyb=yb shzb=zb shwb=wb shxsb=xsb shysb=ysb shzsb=zsb shwsb=wsb shv=v if @light<5 zs=1.0/dtl xs=-r2c0*zs ys=-r2c1*zs zs=-r2c2*zs ws=zs*s1 zs=zs*c1 else xs=px-xt ys=py-yt zs=shz-zt ws=shw-wt if (s2=dtl*sqrt(xs*xs+ys*ys+zs*zs+ws*ws))6 shadow=found xs=shxs ys=shys zs=shzs ws=shws if @smart xss=xs yss=ys zss=zs wss=ws endif xb=shxb yb=shyb zb=shzb wb=shwb xsb=shxsb ysb=shysb zsb=shzsb wsb=shwsb v=shv if @f<1e-5 xp=x0+dxx-dzx yp=y0+dxy-dzy zp=z0+dxz-dzz wp=w0+dxw-dzw else xp=x0-xo yp=y0-yo zp=z0-zo wp=w0-wo dd=sqrt(xp*xp+yp*yp+zp*zp+wp*wp) xp=x0-dzx+dxx*dd yp=y0-dzy+dxy*dd zp=z0-dzz+dxz*dd wp=w0-dzw+dxw*dd endif ldir=1 di=0 p=2 endif elseif p==2 if found==true x1=xt y1=yt z1=zt*c1+wt*s1 else x1=xc y1=yc z1=zc*c1+wc*s1 endif if @f<1e-5 xp=xp-2*dxx yp=yp-2*dxy zp=zp-2*dxz wp=wp-2*dxw else xp=x0-2*dxx*dd yp=y0-2*dxy*dd zp=z0-2*dxz*dd wp=w0-2*dxw*dd endif ldir=1 di=0 p=3 elseif p==3 if found==true x2=xt y2=yt z2=zt*c1+wt*s1 else x2=xc y2=yc z2=zc*c1+wc*s1 endif if @f<1e-5 xp=xp+dxx+dyx yp=yp+dxy+dyy zp=zp+dxz+dyz wp=wp+dxw+dyw else xp=x0+(dxx+dyx)*dd yp=y0+(dxy+dyy)*dd zp=z0+(dxz+dyz)*dd wp=w0+(dxw+dyw)*dd endif ldir=1 di=0 p=4 elseif p==4 if found==true x3=xt y3=yt z3=zt*c1+wt*s1 else x3=xc y3=yc z3=zc*c1+wc*s1 endif if @f<1e-5 xp=xp-2*dyx yp=yp-2*dyy zp=zp-2*dyz wp=wp-2*dyw else xp=x0-2*dyx*dd yp=y0-2*dyy*dd zp=z0-2*dyz*dd wp=w0-2*dyw*dd endif ldir=1 di=0 p=5 elseif p==5 if found==true x4=xt y4=yt z4=zt*c1+wt*s1 else x4=xc y4=yc z4=zc*c1+wc*s1 found=true endif p=-1 endif endif until p<0 if found==true if @colour==0 xt=x0 yt=y0 zt=z0*c1+w0*s1 z0=zt x5=x0-x4 y5=y0-y4 z5=z0-z4 x4=x3-x0 y4=y3-y0 z4=z3-z0 x3=x0-x2 y3=y0-y2 z3=z0-z2 x2=x1-x0 y2=y1-y0 z2=z1-z0 x0=y2*z4-y4*z2 y0=x4*z2-x2*z4 z0=x2*y4-x4*y2 s2=1.0/sqrt(x0*x0+y0*y0+z0*z0) x0=x0*s2 y0=y0*s2 z0=z0*s2 x1=y2*z5-y5*z2 y1=x5*z2-x2*z5 z1=x2*y5-x5*y2 s2=1.0/sqrt(x1*x1+y1*y1+z1*z1) x1=x1*s2 y1=y1*s2 z1=z1*s2 x2=y3*z4-y4*z3 y2=x4*z3-x3*z4 z2=x3*y4-x4*y3 s2=1.0/sqrt(x2*x2+y2*y2+z2*z2) x2=x2*s2 y2=y2*s2 z2=z2*s2 x4=y3*z5-y5*z3 y4=x5*z3-x3*z5 z4=x3*y5-x5*y3 s2=1.0/sqrt(x4*x4+y4*y4+z4*z4) x4=x4*s2 y4=y4*s2 z4=z4*s2 x0=x0+x1+x2+x4 y0=y0+y1+y2+y4 z0=z0+z1+z2+z4 w0=1.0/sqrt(x0*x0+y0*y0+z0*z0) x0=x0*w0 ;N y0=y0*w0 z0=z0*w0 if @light==0 || @light==2 || @light==4 \ || @light==6 || @light==8 if @f<1e-5 x2=x0*m1r2c0+y0*m1r2c1+z0*m1r2c2 ;N.L else x5=xt-xo y5=yt-yo z5=zt-zzo s2=1.0/sqrt(x5*x5+y5*y5+z5*z5) x5=x5*s2 y5=y5*s2 z5=z5*s2 x2=x0*x5+y0*y5+z0*z5 ;N.L endif if x2>1.0 x2=1.0 endif if x2>0 if @f<1e-5 x3=(2*x0*x2-m1r2c0)*m1r2c0 \ +(2*y0*x2-m1r2c1)*m1r2c1 \ +(2*z0*x2-m1r2c2)*m1r2c2 ;(2*N*(N.L)-L).V else x3=(2*x0*x2-x5)*x5 \ +(2*y0*x2-y5)*y5 \ +(2*z0*x2-z5)*z5 ;(2*N*(N.L)-L).V endif if x3<0 x3=0 elseif x3>1 x3=1 endif if @diffuse<0 x2=-0.5*@diffuse*(1+x2) else x2=@diffuse*x2 endif else x3=0 if @diffuse<0 x2=-0.5*@diffuse*(1+x2) else x2=0 endif endif endif if @light==0 w0=@ambient+x2+@specular*x3^@specsize ;Ka+Kd*(N.L)+Ks*(R.V)^n if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+abs(@diffuse)+@specular) else z=w0 endif else if @light<5 ;Remote x1=r2c0 ;L y1=r2c1 z1=r2c2 else ;Point x1=xt-px y1=yt-py z1=zt-pz s2=1.0/sqrt(x1*x1+y1*y1+z1*z1) x1=x1*s2 ;L y1=y1*s2 z1=z1*s2 endif w0=x0*x1+y0*y1+z0*z1 ;N.L if w0>1.0 w0=1.0 endif if w0>0 if @f>=1e-5 && (@light==1 || @light==3 || @light==5 \ || @light==7) x5=xt-xo y5=yt-yo z5=zt-zzo s2=1.0/sqrt(x5*x5+y5*y5+z5*z5) x5=x5*s2 y5=y5*s2 z5=z5*s2 endif if @f>=1e-5 x0=(2*x0*w0-x1)*x5 \ +(2*y0*w0-y1)*y5 \ +(2*z0*w0-z1)*z5 ;(2*N*(N.L)-L).V else x0=(2*x0*w0-x1)*m1r2c0 \ +(2*y0*w0-y1)*m1r2c1 \ +(2*z0*w0-z1)*m1r2c2 ;(2*N*(N.L)-L).V endif if x0<0 x0=0 elseif x0>1 x0=1 endif if @diffuse<0 w0=-0.5*@diffuse*(1+w0) else w0=@diffuse*w0 endif else x0=0 if @diffuse<0 w0=-0.5*@diffuse*(1+w0) else w0=0 endif endif if @light==3 || @light==4 || @light>6 if shadow==true x0=x0*shad w0=w0*shad endif endif if @light==2 || @light==4 || @light==6 || @light==8 w0=@ambient+x2+@specular*x3^@specsize \ +@light4*(w0+@specular*x0^@specsize) if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+(1+@light4)*(abs(@diffuse)+@specular)) else z=w0 endif else w0=@ambient+w0+@specular*x0^@specsize ;Ka+Kd*(N.L)+Ks*(R.V)^n if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+abs(@diffuse)+@specular) else z=w0 endif endif endif elseif @colour==1 && @mandy>0 x=@xconst y=@yconst zz=@zconst w=@wconst if @fractal==3 lx=x ly=y lz=zz lw=w elseif @fractal==4 || @fractal==6 || @fractal==8 || @fractal==9 x=x+xt y=y+yt zz=zz+zt w=w+wt endif if @inside==0 z=fn1(@xconst+flip(@yconst)) elseif @inside==1 z=fn1(@xconst*@xconst+@yconst*@yconst \ +flip(@zconst*@zconst+@wconst*@wconst)) elseif @inside==2 z=fn1(sqr(@xconst*@xconst+@yconst*@yconst) \ +flip(sqr(@zconst*@zconst+@wconst*@wconst))) elseif @inside==3 z=fn1(@xconst+flip(@zconst)) elseif @inside==4 z=fn1(@xconst+flip(@wconst)) elseif @inside==5 z=fn1(@yconst+flip(@xconst)) elseif @inside==6 z=fn1(@yconst+flip(@zconst)) elseif @inside==7 z=fn1(@yconst+flip(@wconst)) elseif @inside==8 z=fn1(@zconst+flip(@xconst)) elseif @inside==9 z=fn1(@zconst+flip(@yconst)) elseif @inside==10 z=fn1(@zconst+flip(@wconst)) elseif @inside==11 z=fn1(@wconst+flip(@xconst)) elseif @inside==12 z=fn1(@wconst+flip(@yconst)) elseif @inside==13 z=fn1(@wconst+flip(@zconst)) elseif @inside==14 z=fn1(@xconst+flip(sqrt(@yconst*@yconst+@zconst*@zconst \ +@wconst*@wconst))) endif else if @colour==1 && @fractal==3 lx=xt ly=yt lz=zt lw=wt endif if @colour==3 z=fn1(sqrt((xt-xo)^2+(yt-yo)^2+(zt-zzo)^2)) elseif @colour<4 if @inside==0 z=fn1(xt+flip(yt)) elseif @inside==1 z=fn1(xt*xt+yt*yt+flip(zt*zt+wt*wt)) elseif @inside==2 z=fn1(sqr(xt*xt+yt*yt)+flip(sqr(zt*zt+wt*wt))) elseif @inside==3 z=fn1(xt+flip(zt)) elseif @inside==4 z=fn1(xt+flip(wt)) elseif @inside==5 z=fn1(yt+flip(xt)) elseif @inside==6 z=fn1(yt+flip(zt)) elseif @inside==7 z=fn1(yt+flip(wt)) elseif @inside==8 z=fn1(zt+flip(xt)) elseif @inside==9 z=fn1(zt+flip(yt)) elseif @inside==10 z=fn1(zt+flip(wt)) elseif @inside==11 z=fn1(wt+flip(xt)) elseif @inside==12 z=fn1(wt+flip(yt)) elseif @inside==13 z=fn1(wt+flip(zt)) elseif @inside==14 z=fn1(xt+flip(sqrt(yt*yt+zt*zt+wt*wt))) endif $ifdef VER50 else z = (fbm1.GetfBm(xt+flip(yt)) + fbm2.GetfBm(xt+flip(zt)) \ + fbm3.GetfBm(yt+flip(zt)))/3 $endif endif endif endif else ; found (clipped) found = false endif loop: if @colour==1 && found==true if @trans xi = yt yt = yt + yt*abs(zt) zt = zt + zt*abs(xi) endif if @switch==1 xi = wt wt = zt zt = yt yt = xt xt = xi elseif @switch==2 xi = wt wt = yt yt = xi xi = xt xt = zt zt = xi elseif @switch==3 xi = wt wt = xt xt = yt yt = zt zt = xi endif if @mandy==0 if @swapyx xi = yt yt = xt xt = xi endif if @swapzx xi = zt zt = xt xt= xi endif if @swapwx xi = wt wt = xt xt = xi endif if @swapzy xi = yt yt = zt zt = xi endif if @swapwy xi = wt wt = yt yt = xi endif if @swapwz xi = wt wt = zt zt = xi endif if @flip xi = sqrt(yt*yt+zt*zt+wt*wt) if yt<0 xi = -xi endif if xi==0 yt = xt xt = 0.0 elseif xt==0 yt = zt = wt = 0 xt = xi else xi = xt/xi yt = yt*xi zt = zt*xi wt = wt*xi if @bug xt = abs(xt)/xi else xt = xt/xi endif endif endif if @conj yt = -yt zt = -zt wt = -wt endif if @fractal==0 xi=xt*xt-yt*yt-zt*zt-wt*wt+@xconst yt=2*xt*yt+@yconst zt=2*xt*zt+@zconst wt=2*xt*wt+@wconst ; sq=xi*xi+yt*yt+zt*zt+wt*wt xt=xi elseif @fractal==1 xi=xt-xt*xt+yt*yt+zt*zt+wt*wt xt=1-2*xt yi=yt*xt zi=zt*xt wt=wt*xt xt=@xconst*xi-@yconst*yi-@zconst*zi-@wconst*wt yt=@yconst*xi+@xconst*yi+@wconst*zi-@zconst*wt zt=@zconst*xi-@wconst*yi+@xconst*zi+@yconst*wt wt=@wconst*xi+@zconst*yi-@yconst*zi+@xconst*wt ; sq=xt*xt+yt*yt+zt*zt+wt*wt elseif @fractal==2 xi=1-2*xt xt=xt-xt*xt+yt*yt+zt*zt+wt*wt+@xconst yt=yt*xi+@yconst zt=zt*xi+@zconst wt=wt*xi+@wconst ; sq=xt*xt+yt*yt+zt*zt+wt*wt elseif @fractal==3 xi=xt*xt-yt*yt-zt*zt-wt*wt+lx+@xconst yi=2*xt*yt+ly+@yconst zi=2*xt*zt+lz+@zconst wi=2*xt*wt+lw+@wconst lx=xt ly=yt lz=zt lw=wt ; sq=xi*xi+yi*yi+zi*zi+wi*wi xt=xi yt=yi zt=zi wt=wi elseif @fractal==4 ; lx=xt ; ly=yt ; lz=zt ; lw=wt xi=xt*xt-yt*yt-zt*zt-wt*wt yi=2*xt*yt zi=2*xt*zt wi=2*xt*wt xj=2.0*(xi*xt-yi*yt-zi*zt-wi*wt)+@xconst yj=2.0*(xi*yt+yi*xt+zi*wt-wi*zt)+@yconst zj=2.0*(xi*zt-yi*wt+zi*xt+wi*yt)+@zconst wj=2.0*(xi*wt+yi*zt-zi*yt+wi*xt)+@wconst sq=1.0/(3.0*(xi*xi+yi*yi+zi*zi+wi*wi)) xt=(xi*xj+yi*yj+zi*zj+wi*wj)*sq yt=(xi*yj-yi*xj-zi*wj+wi*zj)*sq zt=(xi*zj+yi*wj-zi*xj-wi*yj)*sq wt=(xi*wj-yi*zj+zi*yj-wi*xj)*sq ; sq=1.0/((xt-lx)*(xt-lx)+(yt-ly)*(yt-ly) \ ; +(zt-lz)*(zt-lz)+(wt-lw)*(wt-lw)) elseif @fractal==5 if (xi = sqrt(yt*yt + zt*zt + wt*wt))<1e-200 xt = xt^real(@pwr) + @xconst yt = @yconst zt = @zconst wt = @wconst else z = log(xt+flip(xi)) zi = imag(z)/xi xi = real(z) yi = zi*yt wi = zi*wt zi = zi*zt xt=real(@pwr)*xi-imag(@pwr)*yi-real(@pwr1)*zi-imag(@pwr1)*wi yt=imag(@pwr)*xi+real(@pwr)*yi+imag(@pwr1)*zi-real(@pwr1)*wi zt=real(@pwr1)*xi-imag(@pwr1)*yi+real(@pwr)*zi+imag(@pwr)*wi wt=imag(@pwr1)*xi+real(@pwr1)*yi-imag(@pwr)*zi+real(@pwr)*wi if (xi = sqrt(yt*yt + zt*zt + wt*wt))<1e-200 xt = exp(xt) + @xconst yt = @yconst zt = @zconst wt = @wconst else z = exp(xt+flip(xi)) zi = imag(z)/xi xt = real(z) + @xconst yt = zi*yt + @yconst zt = zi*zt + @zconst wt = zi*wt + @wconst endif endif ; sq=xt*xt+yt*yt+zt*zt+wt*wt elseif @fractal==6 if (xj = sqrt(yt*yt + zt*zt + wt*wt))<1e-200 xi = xt^real(pwr) yi = 0.0 zi = 0.0 wi = 0.0 else z = log(xt+flip(xj)) zj = imag(z)/xj xj = real(z) yj = zj*yt wj = zj*wt zj = zj*zt xi=real(pwr)*xj-imag(pwr)*yj-real(@pwr1)*zj-imag(@pwr1)*wj yi=imag(pwr)*xj+real(pwr)*yj+imag(@pwr1)*zj-real(@pwr1)*wj zi=real(@pwr1)*xj-imag(@pwr1)*yj+real(pwr)*zj+imag(pwr)*wj wi=imag(@pwr1)*xj+real(@pwr1)*yj-imag(pwr)*zj+real(pwr)*wj if (xj = sqrt(yi*yi + zi*zi + wi*wi))<1e-200 xi = exp(xi) yi = 0.0 zi = 0.0 wi = 0.0 else z = exp(xi+flip(xj)) zj = imag(z)/xj xi = real(z) yi = zj*yi zi = zj*zi wi = zj*wi endif endif xk=xt*xi-yt*yi-zt*zi-wt*wi yk=yt*xi+xt*yi+wt*zi-zt*wi zk=zt*xi-wt*yi+xt*zi+yt*wi wk=wt*xi+zt*yi-yt*zi+xt*wi if @mulfirst xj=real(@pwr)*xi-imag(@pwr)*yi-real(@pwr1)*zi-imag(@pwr1)*wi yj=imag(@pwr)*xi+real(@pwr)*yi+imag(@pwr1)*zi-real(@pwr1)*wi zj=real(@pwr1)*xi-imag(@pwr1)*yi+real(@pwr)*zi+imag(@pwr)*wi wj=imag(@pwr1)*xi+real(@pwr1)*yi-imag(@pwr)*zi+real(@pwr)*wi xi=real(pwr)*xk-imag(pwr)*yk-real(@pwr1)*zk-imag(@pwr1)*wk \ +@xconst yi=imag(pwr)*xk+real(pwr)*yk+imag(@pwr1)*zk-real(@pwr1)*wk \ +@yconst zi=real(@pwr1)*xk-imag(@pwr1)*yk+real(pwr)*zk+imag(pwr)*wk \ +@zconst wi=imag(@pwr1)*xk+real(@pwr1)*yk-imag(pwr)*zk+real(pwr)*wk \ +@wconst else xj=xi*real(@pwr)-yi*imag(@pwr)-zi*real(@pwr1)-wi*imag(@pwr1) yj=yi*real(@pwr)+xi*imag(@pwr)+wi*real(@pwr1)-zi*imag(@pwr1) zj=zi*real(@pwr)-wi*imag(@pwr)+xi*real(@pwr1)+yi*imag(@pwr1) wj=wi*real(@pwr)+zi*imag(@pwr)-yi*real(@pwr1)+xi*imag(@pwr1) xi=xk*real(pwr)-yk*imag(pwr)-zk*real(@pwr1)-wk*imag(@pwr1) \ +@xconst yi=yk*real(pwr)+xk*imag(pwr)+wk*real(@pwr1)-zk*imag(@pwr1) \ +@yconst zi=zk*real(pwr)-wk*imag(pwr)+xk*real(@pwr1)+yk*imag(@pwr1) \ +@zconst wi=wk*real(pwr)+zk*imag(pwr)-yk*real(@pwr1)+xk*imag(@pwr1) \ +@wconst endif sq=1.0/(xj*xj+yj*yj+zj*zj+wj*wj) xt=(xi*xj+yi*yj+zi*zj+wi*wj)*sq yt=(yi*xj-xi*yj-wi*zj+zi*wj)*sq zt=(zi*xj+wi*yj-xi*zj-yi*wj)*sq wt=(wi*xj-zi*yj+yi*zj-xi*wj)*sq elseif @fractal==7 if (xi=sqrt(yt*yt+zt*zt+wt*wt))<1e-200 xt = xt^rp + @xconst yt = @yconst zt= @zconst wt = @wconst else z = (xt+flip(xi))^rp xi = imag(z)/xi xt = real(z)+@xconst yt = xi*yt+@yconst zt = xi*zt+@zconst wt = xi*wt+@wconst endif ; sq = xt*xt+yt*yt+zt*zt+wt*wt elseif @fractal==8 lx = xt ly = yt lz = zt lw = wt if (xi=sqrt(yt*yt+zt*zt+wt*wt))<1e-200 xj = xt^rp1 yj = 0.0 zj = 0.0 wj = 0.0 else z = (xt+flip(xi))^rp1 xi = imag(z)/xi xj = real(z) yj = xi*yt zj = xi*zt wj = xi*wt endif xi = rp1*(xj*xt - yj*yt - zj*zt - wj*wt)+@xconst yi = rp1*(xj*yt + yj*xt + zj*wt - wj*zt)+@yconst zi = rp1*(xj*zt - yj*wt + zj*xt + wj*yt)+@zconst wi = rp1*(xj*wt + yj*zt - zj*yt + wj*xt)+@wconst wt = 1.0/(rp*(xj*xj+yj*yj+zj*zj+wj*wj)) xt = (xj*xi + yj*yi + zj*zi + wj*wi)*wt yt = (xj*yi - yj*xi - zj*wi + wj*zi)*wt zt = (xj*zi + yj*wi - zj*xi - wj*yi)*wt wt = (xj*wi - yj*zi + zj*yi - wj*xi)*wt elseif @fractal==9 if xt>=0 xi = xt - 1.0 else xi = xt + 1.0 endif yi = yt zi = zt wi = wt xt = xi*@xconst - yi*@yconst - zi*@zconst - wi*@wconst yt = xi*@yconst + yi*@xconst + zi*@wconst - wi*@zconst zt = xi*@zconst - yi*@wconst + zi*@xconst + wi*@yconst wt = xi*@wconst + yi*@zconst - zi*@yconst + wi*@xconst ; sq = xt*xt+yt*yt+zt*zt+wt*wt elseif @fractal==10 xi = xt yi = yt zi = zt xt = xt*xt - yt*yt - zt*zt - wt*wt + @xconst yt = 2.0*(yt*xi + zt*wt) + @yconst zt = 2.0*(zt*xi + yi*wt) + @zconst wt = 2.0*(wt*xi + yi*zi) + @wconst ; sq=x*x+y*y+zz*zz+w*w elseif @fractal==11 xi = xt yi = yt zi = zt xt = xt*xt - yt*yt - zt*zt - wt*wt + @xconst yt = 2.0*(yt*xi + zt*wt) + @yconst zt = 2.0*(zt*xi + yi*wt) + @zconst wt = 2.0*(wt*xi - yi*zi) + @wconst ; sq=x*x+y*y+zz*zz+w*w elseif @fractal==12 xi = xt yi = yt zi = zt xt = xt*xt - yt*yt - zt*zt + wt*wt + @xconst yt = 2.0*(yt*xi + zt*wt) + @yconst zt = 2.0*(zt*xi + yi*wt) + @zconst wt = 2.0*(wt*xi + yi*zi) + @wconst ; sq=x*x+y*y+zz*zz+w*w endif if @inside==0 z=fn1(xt+flip(yt)) elseif @inside==1 z=fn1(xt*xt+yt*yt+flip(zt*zt+wt*wt)) elseif @inside==2 z=fn1(sqr(xt*xt+yt*yt)+flip(sqr(zt*zt+wt*wt))) elseif @inside==3 z=fn1(xt+flip(zt)) elseif @inside==4 z=fn1(xt+flip(wt)) elseif @inside==5 z=fn1(yt+flip(xt)) elseif @inside==6 z=fn1(yt+flip(zt)) elseif @inside==7 z=fn1(yt+flip(wt)) elseif @inside==8 z=fn1(zt+flip(xt)) elseif @inside==9 z=fn1(zt+flip(yt)) elseif @inside==10 z=fn1(zt+flip(wt)) elseif @inside==11 z=fn1(wt+flip(xt)) elseif @inside==12 z=fn1(wt+flip(yt)) elseif @inside==13 z=fn1(wt+flip(zt)) elseif @inside==14 z=fn1(xt+flip(sqrt(yt*yt+zt*zt+wt*wt))) endif else if @swapyx xi = y y = x x = xi endif if @swapzx xi = zz zz = x x = xi endif if @swapwx xi = w w = x x = xi endif if @swapzy xi = y y = zz z = xi endif if @swapwy xi = w w = y y = xi endif if @swapwz xi = w w = zz zz = xi endif if @flip xi = sqrt(y*y+zz*zz+w*w) if y<0 xi = -xi endif if xi==0 y = x x = 0.0 elseif x==0 y = zz = w = 0 x = xi else xi = x/xi y = y*xi zz = zz*xi w = w*xi if @bug x = abs(x)/xi else x = x/xi endif endif endif if @conj y = -y zz = -zz w = -w endif if @fractal==0 xi=x*x-y*y-zz*zz-w*w+xt y=2*x*y+yt zz=2*x*zz+zt w=2*x*w+wt ; sq=xi*xi+y*y+zz*zz+w*w x=xi elseif @fractal==1 xi=x-x*x+y*y+zz*zz+w*w x=1-2*x yi=y*x zi=zz*x w=w*x x=xt*xi-yt*yi-zt*zi-wt*w y=yt*xi+xt*yi+wt*zi-zt*w zz=zt*xi-wt*yi+xt*zi+yt*w w=wt*xi+zt*yi-yt*zi+xt*w ; sq=x*x+y*y+zz*zz+w*w elseif @fractal==2 xi=1-2*x x=x-x*x+y*y+zz*zz+w*w+xt y=y*xi+yt zz=zz*xi+zt w=w*xi+wt ; sq=x*x+y*y+zz*zz+w*w elseif @fractal==3 xi=x*x-y*y-zz*zz-w*w+lx+xt yi=2*x*y+ly+yt zi=2*x*zz+lz+zt wi=2*x*w+lw+wt lx=x ly=y lz=zz lw=w ; sq=xi*xi+yi*yi+zi*zi+wi*wi x=xi y=yi zz=zi w=wi elseif @fractal==4 ; lx=x ; ly=y ; lz=zz ; lw=w xi=x*x-y*y-zz*zz-w*w yi=2*x*y zi=2*x*zz wi=2*x*w xj=2.0*(xi*x-yi*y-zi*zz-wi*w)+xt yj=2.0*(xi*y+yi*x+zi*w-wi*zz)+yt zj=2.0*(xi*zz-yi*w+zi*x+wi*y)+zt wj=2.0*(xi*w+yi*zz-zi*y+wi*x)+wt sq=1.0/(3.0*(xi*xi+yi*yi+zi*zi+wi*wi)) x= (xi*xj+yi*yj+zi*zj+wi*wj)*sq y= (xi*yj-yi*xj-zi*wj+wi*zj)*sq zz=(xi*zj+yi*wj-zi*xj-wi*yj)*sq w= (xi*wj-yi*zj+zi*yj-wi*xj)*sq ; sq=1.0/((x-lx)*(x-lx)+(y-ly)*(y-ly) \ ; +(zz-lz)*(zz-lz)+(w-lw)*(w-lw)) elseif @fractal==5 if (xi = sqrt(y*y + zz*zz + w*w))<1e-200 x = x^real(@pwr) + xt y = yt zz = zt w = wt else z = log(x+flip(xi)) zi = imag(z)/xi xi = real(z) yi = zi*y wi = zi*w zi = zi*zz x=real(@pwr)*xi-imag(@pwr)*yi-real(@pwr1)*zi-imag(@pwr1)*wi y=imag(@pwr)*xi+real(@pwr)*yi+imag(@pwr1)*zi-real(@pwr1)*wi zz=real(@pwr1)*xi-imag(@pwr1)*yi+real(@pwr)*zi+imag(@pwr)*wi w=imag(@pwr1)*xi+real(@pwr1)*yi-imag(@pwr)*zi+real(@pwr)*wi if (xi = sqrt(y*y + zz*zz + w*w))<1e-200 x = exp(x) + xt y = yt zz = zt w = wt else z = exp(x+flip(xi)) zi = imag(z)/xi x = real(z) + xt y = zi*y + yt zz = zi*zz + zt w = zi*w + wt endif endif ; sq=x*x+y*y+zz*zz+w*w elseif @fractal==6 if (xj = sqrt(y*y + zz*zz + w*w))<1e-200 xi = x^real(pwr) yi = 0.0 zi = 0.0 wi = 0.0 else z = log(x+flip(xj)) zj = imag(z)/xj xj = real(z) yj = zj*y wj = zj*w zj = zj*zz xi=real(pwr)*xj-imag(pwr)*yj-real(@pwr1)*zj-imag(@pwr1)*wj yi=imag(pwr)*xj+real(pwr)*yj+imag(@pwr1)*zj-real(@pwr1)*wj zi=real(@pwr1)*xj-imag(@pwr1)*yj+real(pwr)*zj+imag(pwr)*wj wi=imag(@pwr1)*xj+real(@pwr1)*yj-imag(pwr)*zj+real(pwr)*wj if (xj = sqrt(yi*yi + zi*zi + wi*wi))<1e-200 xi = exp(xi) yi = 0.0 zi = 0.0 wi = 0.0 else z = exp(xi+flip(xj)) zj = imag(z)/xj xi = real(z) yi = zj*yi zi = zj*zi wi = zj*wi endif endif xk=x*xi-y*yi-zz*zi-w*wi yk=y*xi+x*yi+w*zi-zz*wi zk=zz*xi-w*yi+x*zi+y*wi wk=w*xi+zz*yi-y*zi+x*wi if @mulfirst xj=real(@pwr)*xi-imag(@pwr)*yi-real(@pwr1)*zi-imag(@pwr1)*wi yj=imag(@pwr)*xi+real(@pwr)*yi+imag(@pwr1)*zi-real(@pwr1)*wi zj=real(@pwr1)*xi-imag(@pwr1)*yi+real(@pwr)*zi+imag(@pwr)*wi wj=imag(@pwr1)*xi+real(@pwr1)*yi-imag(@pwr)*zi+real(@pwr)*wi xi=real(pwr)*xk-imag(pwr)*yk-real(@pwr1)*zk-imag(@pwr1)*wk+xt yi=imag(pwr)*xk+real(pwr)*yk+imag(@pwr1)*zk-real(@pwr1)*wk+yt zi=real(@pwr1)*xk-imag(@pwr1)*yk+real(pwr)*zk+imag(pwr)*wk+zt wi=imag(@pwr1)*xk+real(@pwr1)*yk-imag(pwr)*zk+real(pwr)*wk+wt else xj=xi*real(@pwr)-yi*imag(@pwr)-zi*real(@pwr1)-wi*imag(@pwr1) yj=yi*real(@pwr)+xi*imag(@pwr)+wi*real(@pwr1)-zi*imag(@pwr1) zj=zi*real(@pwr)-wi*imag(@pwr)+xi*real(@pwr1)+yi*imag(@pwr1) wj=wi*real(@pwr)+zi*imag(@pwr)-yi*real(@pwr1)+xi*imag(@pwr1) xi=xk*real(pwr)-yk*imag(pwr)-zk*real(@pwr1)-wk*imag(@pwr1)+xt yi=yk*real(pwr)+xk*imag(pwr)+wk*real(@pwr1)-zk*imag(@pwr1)+yt zi=zk*real(pwr)-wk*imag(pwr)+xk*real(@pwr1)+yk*imag(@pwr1)+zt wi=wk*real(pwr)+zk*imag(pwr)-yk*real(@pwr1)+xk*imag(@pwr1)+wt endif sq=1.0/(xj*xj+yj*yj+zj*zj+wj*wj) x=(xi*xj+yi*yj+zi*zj+wi*wj)*sq y=(yi*xj-xi*yj-wi*zj+zi*wj)*sq zz=(zi*xj+wi*yj-xi*zj-yi*wj)*sq w=(wi*xj-zi*yj+yi*zj-xi*wj)*sq elseif @fractal==7 if (xi=sqrt(y*y+zz*zz+w*w))<1e-200 x = x^rp + xt y = yt zz= zt w = wt else z = (x+flip(xi))^rp xi = imag(z)/xi x = real(z)+xt y = xi*y+yt zz = xi*zz+zt w = xi*w+wt endif ; sq = x*x+y*y+zz*zz+w*w elseif @fractal==8 lx = x ly = y lz = zz lw = w if (xi=sqrt(y*y+zz*zz+w*w))<1e-200 xj = x^rp1 yj = 0.0 zj = 0.0 wj = 0.0 else z = (x+flip(xi))^rp1 xi = imag(z)/xi xj = real(z) yj = xi*y zj = xi*zz wj = xi*w endif xi = rp1*(xj*x - yj*y - zj*zz - wj*w)+xt yi = rp1*(xj*y + yj*x + zj*w - wj*zz)+yt zi = rp1*(xj*zz - yj*w + zj*x + wj*y)+zt wi = rp1*(xj*w + yj*zz - zj*y + wj*x)+wt w = 1.0/(rp*(xj*xj+yj*yj+zj*zj+wj*wj)) x = (xj*xi + yj*yi + zj*zi + wj*wi)*w y = (xj*yi - yj*xi - zj*wi + wj*zi)*w zz= (xj*zi + yj*wi - zj*xi - wj*yi)*w w = (xj*wi - yj*zi + zj*yi - wj*xi)*w elseif @fractal==9 if x>=0 xi = x - 1.0 else xi = x + 1.0 endif yi = y zi = zz wi = w x = xi*xt - yi*yt - zi*zt - wi*wt y = xi*yt + yi*xt + zi*wt - wi*zt zz= xi*zt - yi*wt + zi*xt + wi*yt w = xi*wt + yi*zt - zi*yt + wi*xt ; sq = x*x+y*y+zz*zz+w*w elseif @fractal==10 xi = x yi = y zi = zz x = x*x - y*y - zz*zz - w*w + xt y = 2.0*(y*xi + zz*w) + yt zz = 2.0*(zz*xi + yi*w) + zt w = 2.0*(w*xi + yi*zi) + wt ; sq=x*x+y*y+zz*zz+w*w elseif @fractal==11 xi = x yi = y zi = zz x = x*x - y*y - zz*zz - w*w + xt y = 2.0*(y*xi + zz*w) + yt zz = 2.0*(zz*xi + yi*w) + zt w = 2.0*(w*xi - yi*zi) + wt ; sq=x*x+y*y+zz*zz+w*w elseif @fractal==12 xi = x yi = y zi = zz x = x*x - y*y - zz*zz + w*w + xt y = 2.0*(y*xi + zz*w) + yt zz = 2.0*(zz*xi + yi*w) + zt w = 2.0*(w*xi + yi*zi) + wt ; sq=x*x+y*y+zz*zz+w*w endif if @inside==0 z=fn1(x+flip(y)) elseif @inside==1 z=fn1(x*x+y*y+flip(zz*zz+w*w)) elseif @inside==2 z=fn1(sqr(x*x+y*y)+flip(sqr(zz*zz+w*w))) elseif @inside==3 z=fn1(x+flip(zz)) elseif @inside==4 z=fn1(x+flip(w)) elseif @inside==5 z=fn1(y+flip(x)) elseif @inside==6 z=fn1(y+flip(zz)) elseif @inside==7 z=fn1(y+flip(w)) elseif @inside==8 z=fn1(zz+flip(x)) elseif @inside==9 z=fn1(zz+flip(y)) elseif @inside==10 z=fn1(zz+flip(w)) elseif @inside==11 z=fn1(w+flip(x)) elseif @inside==12 z=fn1(w+flip(y)) elseif @inside==13 z=fn1(w+flip(zz)) elseif @inside==14 z=fn1(x+flip(sqrt(y*y+zz*zz+w*w))) endif endif endif bailout: found==true default: title = "Solid-3D Quaternions" helpfile = "MMF.html" center = (0, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 10 param fractal caption = "Fractal type" default = 0 enum = "q^2+c" "Lambda" "Breeder" "q^2+qold+c" "Newton(^3)" \ "q^n+c (n quaternionic)" "Newton(^n) (n quaternionic)" \ "q^n+c (n real)" "Newton(^n) (n real)" "Barnsley 1" \ "Alternative q^2+c" "Alternative 2 q^2+c" "Alternative 3 q^2+c" hint = "If using a purely real value for the power, n, then you should \ use the '(n real)' options as these are noticeably quicker than \ versions using a full quaternionic power. For the Newton and \ Barnsley fractal types when choosing \ 'Mandelbrot' rather than 'Julia' the quaternion start value is \ offset from the pixel rather than offset from zero." endparam $ifdef VER50 heading caption = "Extra tweaks" expanded = false endheading param swapyx default = false endparam param swapzx default = false endparam param swapwx default = false endparam param swapzy default = false endparam param swapwy default = false endparam param swapwz default = false endparam param flip default = false endparam param bug default = true visible = @flip endparam param conj default = false endparam param trans default = false endparam param switch caption = "Axis Rotation" enum = "x,y,z,w" "w,x,y,z" "z,w,x,y" "y,z,w,x" default = 0 endparam heading enabled = false endheading $endif param pwr caption = "Power n (x,y)" default = (3,0) hint = "(x,y) parts of the power 'n' for the types that use it." endparam param pwr1 caption = "Power n (z,w)" default = (0,0) hint = "(z,w) parts of the power 'n' for the types that use it." endparam param mulfirst caption = "Reverse multiply." default = false hint = "Because multiplication of quaternions is not always commutative \ the order of multiplication in the full quaternionic Newton \ formula alters the results - in fact there are 4 possible ways of \ doing the calculations, this parameter lets you choose between \ two of them." endparam param mandy caption = "Mandelbrot switch" default = 0 enum = "Julia" "Mandelbrot" hint = "Allows you to select a Julia or Mandelbrot style fractal. \ In Mandelbrot mode the constants adjust the start value." endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 hint = "Defines how soon an orbit bails out \ i.e. is considered as tending to the infinite attractor." endparam param txy caption = "Target X and Y coord" default = (0,0) hint = "Note that using the dropper only works \ properly when the 3D rotations are zero." endparam param tz caption = "Target Zcoord" default = 0.0 endparam param r caption = "View-plane distance" default = 0.0 hint = "Sets the distance of the view-plane from the target. \ In parallel projection mode the view plane is also the \ front-clipping plane, in perspective projection mode it \ controls the perspective along with the magnification and \ the focal length." endparam param r1 caption = "Front-clipping distance" default = 2.0 hint = "Sets the distance of the front-clipping plane from the \ target when using perspective projection. You can set \ the front-clipping plane to be at a position either \ nearer the target or nearer the camera than the view-plane." endparam param view caption = "Viewing range" default = 4.0 min = 1e-10 hint = "This is the maximum distance to \ scan from the front-clipping plane." endparam param f caption = "Focal length" default = 12.0 min = 0.0 hint = "Use to adjust the focal length of the camera, a value of zero \ will cause parallel projection to be used instead of perspective \ projection. In perspective projection mode this sets the distance \ of the camera from the view-plane." endparam param trackin caption = "Track in/out" default = 1.0 hint = "In perspective viewing mode this allows you to track the camera in \ and out, 1.0 is the default position and values >1 track away \ and values <1 track towards. In parallel viewing mode it's simply \ a magnification factor giving the effect of tracking the camera \ but in this case values between 0 and 1 track towards the camera \ i.e. magnify, and values >1 track away from the camera." endparam param cutlr caption = "Cut left/right ?" default = false endparam param leftcut caption = "Left cut" default = -1.0 endparam param rightcut caption = "Right cut" default = 1.0 endparam param cuttb caption = "Cut top/btm ?" default = false endparam param btmcut caption = "Bottom cut" default = -1.0 endparam param topcut caption = "Top cut" default = 1.0 endparam param cutfb caption = "Cut front/back ?" default = false endparam param frontcut caption = "Front cut" default = -1.0 endparam param backcut caption = "Back cut" default = 1.0 endparam param cutscale caption = "Plane cut scale" default = 1.0 hint = "Provides a way of scaling the cut planes/box for ease of animation." endparam param cutcentre caption = "Plane cut centre (x,y)" default = (0,0) hint = "Provides a quick way of recentreing the cutting planes." endparam param cutcentre1 caption = "Plane cut centre z" default = 0.0 hint = "Provides a quick way of recentreing the cutting planes." endparam param movecut caption = "Move cut planes" default = false hint = "When enabled the plane cut centre is adjusted to be offset from \ the current target coords." endparam param rotcut caption = "Rotate cut with camera" default = false endparam param cutrot1 caption = "Cut plane elevation" default = 0.0 endparam param cutrot2 caption = "Cut plane direction" default = 0.0 endparam param cutsphere caption = "Cut to sphere" default = false endparam param rcut caption = "Cut radius" default = 1.0 endparam param spherecentre caption = "Sphere (x,y)" default = (0,0) endparam param spherecentre1 caption = "Sphere z" default = 0.0 endparam param movesphere caption = "Move cut sphere" default = false hint = "When enabled the cut sphere centre is offset from the target." endparam param rotsphere caption = "Rotate cut sphere" default = false hint = "When enabled the sphere rotates around the target with the camera." endparam param clipall caption = "Clip all" default = true hint = "If enabled the fractal is clipped both spherically and to the \ cutting planes i.e. only areas not clipped by either method are \ visible. When disabled the two clipping are treated \ separately i.e. only areas clipped by both methods are removed." endparam param detail caption = "Detail level" default = 10.0 min = 2.0 hint = "Higher values produce more accuracy, use values \ under 40 for speed, more for detail. Around \ 100 produces reasonable final results at up to #maxiter 10. \ A #maxiter of 20 may require a value of 1000 or more ! \ You won't need values anywhere near so high when using 'Smart \ step' - in this case you're unlikely to require values over 100." endparam param smart caption = "Smart step" default = false hint = "When enabled the step distance is adjusted based on the iteration \ depth as rays are traced, producing good results at low \ 'Detail level' in quick time, very useful for when setting up. \ Currently only functions properly when using 'Iteration' as the \ solid method." endparam param nobinary caption = "Disable binary search" default = false hint = "Disable the binary search for fast but poor quality rendering." endparam param bindepth caption = "Binary search depth" default = 23 min = 8 max = 23 hint = "Min=8, Max=23. Reducing the value at higher detail levels may \ speed up rendering without visible loss of accuracy." endparam param change caption = "High Detail" default = false hint = "When enabled can vastly improve rendering quality at \ the expense of vastly reducing speed of \ calculation. Actually only worth using for final renders where \ speed of rendering is completely unimportant. Only used when the \ binary search is enabled." endparam param method caption = "Solid Method" enum = "Iteration" "Final z trap" "Orbit trap" "Max. Iter. trap" default = 0 hint = "Iteration is the standard method. The Traps consider points to \ be solid when the magnitude of the trapped value for any point \ throughout the iteration is below a minimum." endparam param trapval1 caption = "Trap Value (x,y)" default = (0,0) hint = "The (x,y) value to trap to." endparam param traprot1 caption = "Trap Rotation (x,y)" default = 0.0 hint = "Rotates the (x,y) Trap Value by this number of degrees, useful \ for producing animations." endparam param trapval2 caption = "Trap Value (z,w)" default = (0,0) hint = "The (z,w) value to trap to." endparam param traprot2 caption = "Trap Rotation (z,w)" default = 0.0 hint = "Rotates the (z,w) Trap Value by this number of degrees, useful \ for producing animations." endparam param traptype caption = "Trap type" enum = "Magnitude" "x" "y" "z" "w" "Angle x/y" "Angle w/z" "Real and Imag" \ "Real or Imag" default = 0 endparam param useangle caption = "Angle method" enum = "Abs(angle)" "All angles" default = 1 hint = "Only for the Angle Trap types" endparam param usethreshold caption = "Use Threshold" default = false hint = "When enabled the distance found is compared to this value. Note \ that the effective range when using Magnitude is >=0, using x, y, \ z and w is any value and when using Angle is -pi to +pi." endparam param threshold caption = "Threshold" default = 0.5 hint = "When enabled the distance found is compared to this value. Note \ that the effective range when using Magnitude is >=0, using x, y, \ z and w is any value and when using Angle is -pi to +pi." endparam param minval caption = "Minimum Value" default = 0.1 min = 0.0 hint = "Distances found below this value are considered to be solid." endparam param solid caption = "Solid condition" enum = "Threshold" "Direction change" default = 0 hint = "Direction change colours all and \ works faster, useful for when setting \ up position/rotation." endparam param angle1 caption = "X Rot (degrees)" default = 22.5 hint = "Rotation of Y and Z around the X axis. \ (elevation). To get roll - rotation of X \ and Y around the Z axis - use the Rotation \ angle in the location settings." endparam param angle2 caption = "Y Rot (degrees)" default = 0.0 hint = "Rotation of X and Z around the Y axis. \ (direction). To get roll - rotation of X \ and Y around the Z axis - use the Rotation \ angle in the location settings." endparam param angle3 caption = "4D Rot (degrees)" default = 0.0 hint = "Angle of the line in the plane \ of the 3rd and 4th start values, \ used as the Z-axis. \ 0=3rd part (Z), 90=4th part (W)" endparam param offset caption = "4th dimension offset" default = 0.0 hint = "Offsets the 3 dimensions viewed down the current \ 4th dimension. For a 4D rotation of zero this value \ is an offset on the W axis, for a 4D rotation of 90 \ degrees it is an offset on the Z axis." endparam param xconst caption = "X constant" default = 0.0 hint = "Value used as the X constant for the Julia set, or the \ start X value for a Mandelbrot" endparam param yconst caption = "Y constant" default = 0.0 hint = "Value used as the Y constant for the Julia set, or the \ start Y value for a Mandelbrot." endparam param zconst caption = "Z constant" default = 1.0 hint = "Value used as the Z constant for the Julia set, or the \ start Z value for a Mandelbrot." endparam param wconst caption = "W constant" default = 0.0 hint = "Value used as the W constant for the Julia set, or the \ start W value for a Mandelbrot." endparam param colour caption = "Colouring" $ifdef VER50 enum = "Lighting" "Inside" "Co-ordinate" "Depth" "3D fBm" $else enum = "Lighting" "Inside" "Co-ordinate" "Depth" $endif default = 0 hint = "Use the MMF lighting UCL when using the \ lighting option. Any inside colouring can be \ used to colour the object when using \ Inside or Co-ordinate - NB. colourings or options \ that use #pixel will not remain consistent \ under 3D rotation." endparam $ifdef VER50 heading caption = "3D fBm (xy)" visible = @colour==4 endheading MMF_AltfBm param fbm1 default = MMF_AltfBm visible = @colour==4 endparam heading caption = "3D fBm (xz)" visible = @colour==4 endheading MMF_AltfBm param fbm2 default = MMF_AltfBm visible = @colour==4 endparam heading caption = "3D fBm (yz)" visible = @colour==4 endheading MMF_AltfBm param fbm3 default = MMF_AltfBm visible = @colour==4 endparam heading enabled = false visible = @colour==4 endheading $endif param inside caption = "Inside/Co-ordinate" default = 0 enum = "(x,y)" "All squared" "All" "(x,z)" "(x,w)" "(y,x)" "(y,z)" \ "(y,w)" "(z,x)" "(z,y)" "(z,w)" "(w,x)" "(w,y)" "(w,z)" "(x,rest)" hint = "Sets the complex value to be passed as the complex Z \ on each iteration when using Inside colouring, \ or as the complex value when using Co-ordinate colouring. \ All squared uses (x^2+y^2,z^2+w^2) and All uses the roots \ of the same two values." endparam param ambient caption = "Ambient light" default = 0.15 min = -1.0 max = 1.0 hint = "The background light level, only relevant for the \ lighting colourings." endparam param diffuse caption = "Diffuse constant" default = 0.55 min = -1.0 max = 1.0 hint = "This value adjusts the proportion of light \ considered to be reflected by a rough surface. \ Use negative values if you wish soft diffuse lighting \ ie. light from the wrong-side of the object to \ have some effect. Only relevant for the \ lighting colourings." endparam param specular caption = "Specular constant" default = 0.3 min = 0 max = 1.0 hint = "This value adjusts the proportion of light \ considered to be reflected by a glassy-smooth \ surface. Only relevant for the \ lighting colourings." endparam param specsize caption = "Specular exponent" default = 5.0 min = 1.0 hint = "This value controls how mirror-like the specular \ reflection is, the larger the value, the more \ mirror-like the reflection. Only relevant for the \ lighting colourings." endparam param clamp caption = "Light value clamp" default = true hint = "When enabled the lighting value is clamped so as to \ fit the colour gradient. This parameter only affects \ the Remote or Point light options. You can produce \ the same result using the Colour Density but this \ option ensures no error." endparam param light caption = "Lighting method" enum = "Camera" "Remote" "Camera+Remote" "Remote+Shadows" "C+R+Shadows" \ "Point" "Camera+Point" "Point+Shadows" "C+P+Shadows" default = 0 hint = "You can light the object using a remote source from the camera \ direction, another remote source from elsewhere or another point \ source or camera and remote or camera and point, or remote with \ shadows, point with shadows or these last two with camera too." endparam param movelight caption = "Track with camera" default = false hint = "When enabled the lighting angles Light1 and Light2 are taken as \ offsets from the camera angles so that when the camera is rotated \ then the light source rotates with it." endparam param light1 caption = "Light 1 (degrees)" default = 60.0 hint = "Independant light elevation. Only relevant for the \ lighting colourings using independant lighting." endparam param light2 caption = "Light 2 (degrees)" default = 30.0 hint = "Independant light direction. Only relevant for the \ lighting colourings using independant lighting." endparam param light3 caption = "Light distance" default = 6.0 hint = "The distance of the light source from the \ camera target. Only relevant for the point \ lighting colouring using independant lighting." endparam param light4 caption = "Relative light" default = 1.0 min = 0.0 hint = "Sets the relative strength of the independant light \ compared to light from the camera. Values < 1 \ make the camera light more significant and values > \ 1 make the independant light more significant. Only applies \ when both light sources are used." endparam param shadow caption = "Depth of shadow" default = 0.5 min = 0.0 max = 1.0 hint = "Sets the darkness of the shadows, using zero is pointless \ as it produces none at all, a value of 1 produces the darkest \ shadows. Only the independant light produces shadows." endparam param rot caption = "Rotation (Rads)" default = (0,0) hint = "For rotation using the switch preview, the real (horizontal) sets \ the direction and the imaginary (vertical) sets the pitch." endparam func fn1 caption = "Inside/Co-ord Fn" default = ident() hint = "Applied to the complex value to be passed to the colouring \ when using the Inside, Co-ordinate or Depth options. In Inside mode \ this function is applied to the complex (z) value used at the \ end of each iteration." endfunc switch: type = "MMFt-Solid3DQuaternions" fractal = fractal pwr = pwr pwr1 = pwr1 mulfirst = mulfirst mandy = mandy bailout = bailout txy = txy tz = tz r = r r1 = r1 view = view f = f trackin = trackin cutlr = cutlr leftcut = leftcut rightcut = rightcut cuttb = cuttb topcut = topcut btmcut = btmcut cutfb = cutfb frontcut = frontcut backcut = backcut cutscale = cutscale cutcentre = cutcentre cutcentre1 = cutcentre1 movecut = movecut rotcut = rotcut cutrot1 = cutrot1 cutrot2 = cutrot2 cutsphere = cutsphere rcut = rcut spherecentre = spherecentre spherecentre1 = spherecentre1 movesphere = movesphere rotsphere = rotsphere clipall = clipall detail = detail smart = smart nobinary = nobinary bindepth = bindepth change = change method = method trapval1 = trapval1 traprot1 = traprot1 trapval2 = trapval2 traprot2 = traprot2 traptype = traptype useangle = useangle usethreshold = usethreshold threshold = threshold minval = minval solid = solid angle1 = angle1 angle2 = angle2 angle3 = angle3 offset = offset xconst = xconst yconst = yconst zconst = zconst wconst = wconst colour = colour inside = inside ambient = ambient diffuse = diffuse specular = specular specsize = specsize clamp = clamp light = light movelight = movelight light1 = light1 light2 = light2 light3 = light3 light4 = light4 shadow = shadow rot = #pixel fn1 = fn1 } MMFu-Solid3DHypercomplex { ; ; Solid 3D Hypercomplex Fractals ; (c) Dave Makin (Makin' Magic) ; http://www.crosswinds.net/~makinmagic/ ; http://website.lineone.net/~dave_makin/ ; http://skyscraper.fortunecity.com/terabyte/966/ ; ; Updated 24th September 2001 - added the ability ; to rotate the fractals using the switch-preview. ; ; Created 5th June 2001 ; init: float a=#pi/180.0 float twopi = 2.0*#pi float cs = @traprot1*a float sn = sin(cs) float cs = cos(cs) complex tval1 = real(@trapval1)*cs-imag(@trapval1)*sn \ +flip(real(@trapval1)*sn+imag(@trapval1)*cs) cs = @traprot2*a sn = sin(cs) cs = cos(cs) complex tval2 = real(@trapval2)*cs-imag(@trapval2)*sn \ +flip(real(@trapval2)*sn+imag(@trapval2)*cs) complex pwr = @k-1.0 complex hpa = real(@k)-imag(@l)+flip(imag(@k)+real(@l)) complex hpb = real(@k)+imag(@l)+flip(imag(@k)-real(@l)) complex hpa1 = hpa - 1.0 complex hpb1 = hpb - 1.0 complex z=(0,0) if @fractal>3 float bail=@bailout*4 complex ha=(0,0) complex hb=(0,0) if @mandy==0 complex hca=@xconst-@wconst+flip(@yconst+@zconst) complex hcb=@xconst+@wconst+flip(@yconst-@zconst) else complex hca=(0,0) complex hcb=(0,0) endif if @fractal>7 complex lha=z complex lhb=z if @fractal==8 complex oha=z complex ohb=z endif endif else float bail=@bailout if @mandy>0 float mx=0 float my=0 float mz=0 float mw=0 endif if @fractal==3 float lx=0 float ly=0 float lz=0 float lw=0 float wi=0 endif endif float a1=a*@angle1 + imag(@rot) float a2=a*@angle2 - real(@rot) float c1=cos(a1) float s1=sin(a1) float c2=cos(a2) float s2=sin(a2) float m1r0c0=c2 float m1r0c1=0 float m1r0c2=-s2 float m1r1c0=s1*s2 float m1r1c1=c1 float m1r1c2=s1*c2 float m1r2c0=c1*s2 float m1r2c1=-s1 float m1r2c2=c1*c2 float dtl=@detail if @smart dtl=0.1*(@detail+8.0) endif if @colour==0 float x0=0 float y0=0 float z0=0 float w0=0 float x1=0 float y1=0 float z1=0 float x2=0 float y2=0 float z2=0 float x3=0 float y3=0 float z3=0 float x4=0 float y4=0 float z4=0 float x5=0 float y5=0 float z5=0 if @light>0 if @movelight a1=a1+a*@light1 a2=a2+a*@light2 else a1=a*@light1 a2=a*@light2 endif c1=cos(a1) s1=sin(a1) c2=cos(a2) s2=sin(a2) float r0c0=c2 float r0c1=0 float r0c2=-s2 float r1c0=s1*s2 float r1c1=c1 float r1c2=s1*c2 float r2c0=c1*s2 float r2c1=-s1 float r2c2=c1*c2 endif if @light==3 || @light==4 || @light>6 float shxs=0 float shys=0 float shzs=0 float shws=0 float shxb=0 float shyb=0 float shzb=0 float shwb=0 float shxsb=0 float shysb=0 float shzsb=0 float shwsb=0 float shv=0 bool shadow=false float shad=(1-@shadow) endif endif bool clipped = @cutlr || @cuttb || @cutfb if clipped && (@cutrot1!=0.0 || @cutrot2!=0.0) float cs1 = 0.0 cs = @cutrot1*a cs1 = @cutrot2*a sn = sin(cs) cs = cos(cs) float sn1 = sin(cs1) cs1 = cos(cs1) float cr0c0=cs1 float cr0c1=0.0 float cr0c2=-sn1 float cr1c0=sn*sn1 float cr1c1=cs float cr1c2=sn*cs1 float cr2c0=cs*sn1 float cr2c1=-sn float cr2c2=cs*cs1 endif a=a*@angle3 s1=sin(a) c1=cos(a) if @colour==0 float d=1/(160*#magn) float dzx=2*m1r2c0*d float dzy=2*m1r2c1*d float dzz=2*m1r2c2*d*c1 float dzw=2*m1r2c2*d*s1 if @f<1e-5 float dxx=m1r0c0*d float dxy=m1r0c1*d float dxz=m1r0c2*d*c1 float dxw=m1r0c2*d*s1 float dyx=m1r1c0*d float dyy=m1r1c1*d float dyz=m1r1c2*d*c1 float dyw=m1r1c2*d*s1 else float dd=d/@f float dxx=m1r0c0*dd float dxy=m1r0c1*dd float dxz=m1r0c2*dd*c1 float dxw=m1r0c2*dd*s1 float dyx=m1r1c0*dd float dyy=m1r1c1*dd float dyz=m1r1c2*dd*c1 float dyw=m1r1c2*dd*s1 dd = 0.0 endif endif complex o=#pixel-#center float x=real(o) float y=imag(o) bool found=false float v=@view float alpha = 1e200 float beta = 0.0 float aval = 0.0 float lcut = @leftcut*@cutscale+real(@cutcentre) float rcut = @rightcut*@cutscale+real(@cutcentre) float tcut = @topcut*@cutscale+imag(@cutcentre) float bcut = @btmcut*@cutscale+imag(@cutcentre) float fcut = @frontcut*@cutscale+@cutcentre1 float bkcut = @backcut*@cutscale+@cutcentre1 if @movecut lcut = lcut + real(@txy) rcut = rcut + real(@txy) tcut = tcut + imag(@txy) bcut = bcut + imag(@txy) fcut = fcut + @tz bkcut = bkcut + @tz endif float xcc = 0.0 float ycc = 0.0 float zcc = 0.0 float xss = 0.0 float yss = 0.0 float zss = 0.0 float wss = 0.0 float cc = 0.0 if @f<1e-5 float xc=real(#center)+@trackin*(x*m1r0c0+y*m1r1c0)+real(@txy)-@r*m1r2c0 float yc=imag(#center)+@trackin*(x*m1r0c1+y*m1r1c1)+imag(@txy)-@r*m1r2c1 float zc=@trackin*(x*m1r0c2+y*m1r1c2)+@tz-@r*m1r2c2 float xs=m1r2c0 float ys=m1r2c1 float zs=m1r2c2 float xo float yo if clipped if (@cutrot1==0.0 && @cutrot2==0.0 && !@rotcut) xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs else xo = real(@txy) yo = imag(@txy) if @rotcut xcc=real(#center)+@trackin*x+xo ycc=imag(#center)+@trackin*y+yo zcc=@tz-@r xss = 0.0 yss = 0.0 zss = 1.0 else xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs endif if @cutrot1!=0.0 || @cutrot2!=0.0 aval = xo+(xcc-xo)*cr0c0 + (ycc-yo)*cr1c0 + (zcc-@tz)*cr2c0 cc = yo+(xcc-xo)*cr0c1 + (ycc-yo)*cr1c1 + (zcc-@tz)*cr2c1 zcc = @tz+(xcc-xo)*cr0c2 + (ycc-yo)*cr1c2 + (zcc-@tz)*cr2c2 xcc = aval ycc = cc aval = xss*cr0c0 + yss*cr1c0 + zss*cr2c0 cc = xss*cr0c1 + yss*cr1c1 + zss*cr2c1 zss = xss*cr0c2 + yss*cr1c2 + zss*cr2c2 xss = aval yss = cc endif endif endif if clipped || @cutsphere bool clr = @cutlr bool ctb = @cuttb bool cfb = @cutfb if abs(xss)<=1e-19 if @cutlr && (xccrcut) found = true else clr = false endif endif if abs(yss)<=1e-19 if @cuttb && (ycc>tcut || yccbkcut) found = true else cfb = false endif endif clipped = clr || ctb || cfb if !found && (clipped || @cutsphere) if clr && abs(xss)>1e-20 aval=(lcut-xcc)/xss if ctb xo = ycc+aval*yss endif if cfb yo = zcc+aval*zss endif if (!ctb || (xo<=tcut && xo>=bcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) alpha = aval beta = aval endif aval=(rcut-xcc)/xss if ctb xo = ycc+aval*yss endif if cfb yo = zcc+aval*zss endif if (!ctb || (xo<=tcut && xo>=bcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif endif if ctb && abs(yss)>1e-20 aval=(tcut-ycc)/yss if clr xo = xcc+aval*xss endif if cfb yo = zcc+aval*zss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif aval=(bcut-ycc)/yss if clr xo = xcc+aval*xss endif if cfb yo = zcc+aval*zss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!cfb || (yo>=fcut && yo<=bkcut)) if avalbeta beta = aval endif endif endif if cfb && abs(zss)>1e-20 aval=(fcut-zcc)/zss if clr xo = xcc+aval*xss endif if ctb yo = ycc+aval*yss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!ctb || (yo<=tcut && yo>=bcut)) if avalbeta beta = aval endif endif aval=(bkcut-zcc)/zss if clr xo = xcc+aval*xss endif if ctb yo = ycc+aval*yss endif if (!clr || (xo>=lcut && xo<=rcut)) \ &&(!ctb || (yo<=tcut && yo>=bcut)) if avalbeta beta = aval endif endif endif if @clipall && clipped && alpha>1e199 found = true elseif @cutsphere cc = @spherecentre1 xo = real(@spherecentre) yo = imag(@spherecentre) if @movesphere xo = xo + real(@txy) yo = yo + imag(@txy) cc = cc + @tz endif float aa = 0.0 float bb = 0.0 if @rotsphere xo = xo-real(@txy) yo = yo-imag(@txy) cc = cc - @tz aa = real(@txy)+xo*m1r0c0+yo*m1r1c0+cc*m1r2c0 bb = imag(@txy)+xo*m1r0c1+yo*m1r1c1+cc*m1r2c1 cc = @tz+xo*m1r0c2+yo*m1r1c2+cc*m1r2c2 xo = aa yo = bb endif cc = zc - cc xo = xc - xo yo = yc - yo aa = 2.0*(xs*xs + ys*ys + zs*zs) bb = 2.0*(xs*xo+ys*yo+zs*cc) cc = bb*bb - 2.0*aa*(xo*xo + yo*yo + cc*cc - @rcut) if cc<0.0 if @clipall found = true endif else aa = 1.0/aa xo = aa*(-bb + sqrt(cc)) yo = aa*(-bb - sqrt(cc)) if @clipall || !clipped if alpha>1e199 alpha = 0.0 beta = v endif if (xo>=beta && yo>=beta) || (xo<=alpha && yo<=alpha) found = true elseif xoalpha alpha = xo endif if yoalpha alpha = yo endif if xobeta beta = yo endif else if yobeta beta = xo endif endif endif endif if !found if alpha>=v || beta<=0.0 || alpha>beta found = true else if alpha>0.0 xc = xc + alpha*xs yc = yc + alpha*ys zc = zc + alpha*zs else alpha = 0.0 endif if beta>v beta=v endif v = beta - alpha endif endif endif endif if !found v = v*dtl float ws = 1.0/dtl xs = xs*ws ys = ys*ws zs = zs*ws ws=zs*s1 zs=zs*c1 float wc=zc*s1 zc=zc*c1 if @offset>0 zc=zc-@offset*s1 wc=wc+@offset*c1 endif xo=xc yo=yc float zzo=zc*c1+wc*s1 endif else float xo=real(#center)+real(@txy)-(@r+@f)*m1r2c0 float yo=imag(#center)+imag(@txy)-(@r+@f)*m1r2c1 float zo=@tz-(@r+@f)*m1r2c2 float wc = 0.0 float wo = 0.0 if @trackin!=1.0 wc = 1.0 - @trackin xo = xo + wc*m1r2c0 yo = yo + wc*m1r2c1 zo = zo + wc*m1r2c2 endif float xs=x*m1r0c0+y*m1r1c0+@f*m1r2c0 float ys=x*m1r0c1+y*m1r1c1+@f*m1r2c1 float zs=x*m1r0c2+y*m1r1c2+@f*m1r2c2 float zc = (@r+@f-@r1+@trackin-1)/@f float xc=xo+xs*zc float yc=yo+ys*zc float zc=zo+zs*zc float s2=1.0/sqrt(xs*xs+ys*ys+zs*zs) xs=xs*s2 ys=ys*s2 zs=zs*s2 if clipped if (@cutrot1==0.0 && @cutrot2==0.0 && !@rotcut) xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs else wc = real(@txy) wo = imag(@txy) if @rotcut xss = x yss = y zss = @f zcc = (@r+@f-@r1+@trackin-1)/@f xcc=real(#center)+wc+xss*zcc ycc=imag(#center)+wo+yss*zcc zcc=@tz-(@r+@f)+zss*zcc if @trackin!=1.0 zcc = zcc + 1.0 - @trackin endif xss=xss*s2 yss=yss*s2 zss=zss*s2 else xcc = xc ycc = yc zcc = zc xss = xs yss = ys zss = zs endif if @cutrot1!=0.0 || @cutrot2!=0.0 aval = wc+(xcc-wc)*cr0c0 + (ycc-wo)*cr1c0 + (zcc-@tz)*cr2c0 cc = wo+(xcc-wc)*cr0c1 + (ycc-wo)*cr1c1 + (zcc-@tz)*cr2c1 zcc = @tz+(xcc-wc)*cr0c2 + (ycc-wo)*cr1c2 + (zcc-@tz)*cr2c2 xcc = aval ycc = cc aval = xss*cr0c0 + yss*cr1c0 + zss*cr2c0 cc = xss*cr0c1 + yss*cr1c1 + zss*cr2c1 zss = xss*cr0c2 + yss*cr1c2 + zss*cr2c2 xss = aval yss = cc endif endif endif if clipped || @cutsphere bool clr = @cutlr bool ctb = @cuttb bool cfb = @cutfb if abs(xss)<=1e-19 if @cutlr && (xccrcut) found = true else clr = false endif endif if abs(yss)<=1e-19 if @cuttb && (ycc>tcut || yccbkcut) found = true else cfb = false endif endif clipped = clr || ctb || cfb if !found && (clipped || @cutsphere) if clr && abs(xss)>1e-20 aval=(lcut-xcc)/xss if ctb wc = ycc+aval*yss endif if cfb wo = zcc+aval*zss endif if (!ctb || (wc<=tcut && wc>=bcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) alpha = aval beta = aval endif aval=(rcut-xcc)/xss if ctb wc = ycc+aval*yss endif if cfb wo = zcc+aval*zss endif if (!ctb || (wc<=tcut && wc>=bcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif endif if ctb && abs(yss)>1e-20 aval=(tcut-ycc)/yss if clr wc = xcc+aval*xss endif if cfb wo = zcc+aval*zss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif aval=(bcut-ycc)/yss if clr wc = xcc+aval*xss endif if cfb wo = zcc+aval*zss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!cfb || (wo>=fcut && wo<=bkcut)) if avalbeta beta = aval endif endif endif if cfb && abs(zss)>1e-20 aval=(fcut-zcc)/zss if clr wc = xcc+aval*xss endif if ctb wo = ycc+aval*yss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!ctb || (wo<=tcut && wo>=bcut)) if avalbeta beta = aval endif endif aval=(bkcut-zcc)/zss if clr wc = xcc+aval*xss endif if ctb wo = ycc+aval*yss endif if (!clr || (wc>=lcut && wc<=rcut)) \ &&(!ctb || (wo<=tcut && wo>=bcut)) if avalbeta beta = aval endif endif endif if @clipall && clipped && alpha>1e199 found = true elseif @cutsphere cc = @spherecentre1 wc = real(@spherecentre) wo = imag(@spherecentre) if @movesphere wc = wc + real(@txy) wo = wo + imag(@txy) cc = cc + @tz endif float aa = 0.0 float bb = 0.0 if @rotsphere wc = wc-real(@txy) wo = wo-imag(@txy) cc = cc - @tz aa = real(@txy)+wc*m1r0c0+wo*m1r1c0+cc*m1r2c0 bb = imag(@txy)+wc*m1r0c1+wo*m1r1c1+cc*m1r2c1 cc = @tz+wc*m1r0c2+wo*m1r1c2+cc*m1r2c2 wc = aa wo = bb endif cc = zc - cc wc = xc - wc wo = yc - wo float aa = 2.0*(xs*xs + ys*ys + zs*zs) float bb = 2.0*(xs*wc+ys*wo+zs*cc) cc = bb*bb - 2.0*aa*(wc*wc + wo*wo + cc*cc - @rcut) if cc<0.0 if @clipall found = true endif else aa = 1.0/aa wc = aa*(-bb + sqrt(cc)) wo = aa*(-bb - sqrt(cc)) if @clipall || !clipped if alpha>1e199 alpha = 0.0 beta = v endif if (wc>=beta && wo>=beta) || (wc<=alpha && wo<=alpha) found = true elseif wcalpha alpha = wc endif if woalpha alpha = wo endif if wcbeta beta = wo endif else if wobeta beta = wc endif endif endif endif if !found if alpha>=v || beta<=0.0 || alpha>beta found = true else if alpha>0.0 xc = xc + alpha*xs yc = yc + alpha*ys zc = zc + alpha*zs else alpha = 0.0 endif if beta>v beta=v endif v = beta - alpha endif endif endif endif if !found v = v*dtl wc = 1.0/dtl xs = xs*wc ys = ys*wc zs = zs*wc wc=zc*s1 zc=zc*c1 if @offset>0 zc=zc-@offset*s1 wc=wc+@offset*c1 endif wo=zo*s1 zo=zo*c1 if @offset>0 zo=zo-@offset*s1 wo=wo+@offset*c1 endif float zzo=zo*c1+wo*s1 float ws=zs*s1 zs=zs*c1 endif endif if !found if @colour==0 && @light>4 float px=real(#center)+real(@txy)-@light3*r2c0 float py=imag(#center)+imag(@txy)-@light3*r2c1 float pz=@tz-@light3*r2c2 if @light<7 if @offset>0 s2=pz*s1+@offset*c1 pz=pz*c1-@offset*s1 pz=pz*c1+s2*s1 endif else float shz=pz*c1 float shw=pz*s1 if @offset>0 shz=shz-@offset*s1 shw=shw+@offset*c1 pz=shz*c1+shw*s1 endif endif endif float xb=0.0000152587890625*xs float yb=0.0000152587890625*ys float zb=0.0000152587890625*zs float wb=0.0000152587890625*ws xss = xs yss = ys zss = zs wss = ws float xsb=0.5*xs float ysb=0.5*ys float zsb=0.5*zs float wsb=0.5*ws float xsub=xsb float ysub=ysb float zsub=zsb float wsub=wsb float xt=xc float yt=yc float zt=zc float wt=wc float sq=0 float xi=0 float yi=0 float zi=0 float zz=0 float w=wc int j=0 int k=0 float lsq=0 float min=0.0 float min1=0.0 complex tv1=(0,0) complex tv2=(0,0) float ldir=@bailout*@bailout float ldir1=ldir float ldir2=ldir int di=65536 int di1=di float i=0.0 int s=0 int p=0 float xp=xc float yp=yc float zp=zc float wp=wc bool b=true if @colour>0 p=-1 endif repeat i=0 found=false xc=xp yc=yp zc=zp wc=wp repeat s=0 repeat if s==0 ;iterate at current step b=true ;ready for binary search x=xc y=yc zz=zc w=wc elseif s==1 ;iterate at current step + a bit k=j lsq=sq if @smart x=xc+xs*0.0000152587890625 y=yc+ys*0.0000152587890625 zz=zc+zs*0.0000152587890625 w=wc+ws*0.0000152587890625 else x=xc+xb y=yc+yb zz=zc+zb w=wc+wb endif elseif s==2 && b ;initiate binary search if @solid==1 found=true endif if @smart xsub=0.5*xs ysub=0.5*ys zsub=0.5*zs wsub=0.5*ws else xsub=xsb ysub=ysb zsub=zsb wsub=wsb endif xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub x=xt y=yt zz=zt w=wt elseif s<@bindepth ;complete binary search if b xsub=0.5*xsub ysub=0.5*ysub zsub=0.5*zsub wsub=0.5*wsub if ldir2<0 xt=xt-xsub yt=yt-ysub zt=zt-zsub wt=wt-wsub else xt=xt+xsub yt=yt+ysub zt=zt+zsub wt=wt+wsub endif x=xt y=yt zz=zt w=wt else x=xt+0.000030517578125*xsub y=yt+0.000030517578125*ysub zz=zt+0.000030517578125*zsub w=wt+0.000030517578125*wsub endif endif j=0 if @fractal>3 if @mandy==0 ha=x-w+flip(y+zz) hb=x+w+flip(y-zz) else hca=x-w+flip(y+zz) hcb=x+w+flip(y-zz) if @fractal==9 || @fractal==11 ha=hca+@xconst-@wconst+flip(@yconst+@zconst) hb=hcb+@xconst+@wconst+flip(@yconst-@zconst) else ha=@xconst-@wconst+flip(@yconst+@zconst) hb=@xconst+@wconst+flip(@yconst-@zconst) endif if @fractal==6 || @fractal==7 ha=ha+(@k-1)/@k hb=hb+(@k-1)/@k endif endif if @fractal==8 lha=ha lhb=hb endif else if @mandy>0 mx=@xconst my=@yconst mz=@zconst mw=@wconst endif if @fractal==3 if @mandy==0 lx=x ly=y lz=zz lw=w else lx=mx ly=my lz=mz lw=mw endif endif endif repeat if @mandy==0 if @fractal==0 xi=x*x-y*y-zz*zz+w*w+@xconst yi=2*(x*y-zz*w)+@yconst zi=2*(x*zz-y*w)+@zconst w=2*(x*w+y*zz)+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi elseif @fractal==1 xi=x-x*x+y*y+zz*zz-w*w yi=y-2*x*y+2*zz*w zi=zz-2*x*zz+2*y*w w=w-2*x*w-2*y*zz x=@xconst*xi-@yconst*yi-@zconst*zi+@wconst*w y=@yconst*xi+@xconst*yi-@wconst*zi-@zconst*w zz=@zconst*xi-@wconst*yi+@xconst*zi-@yconst*w w=@wconst*xi+@zconst*yi+@yconst*zi+@xconst*w sq=x*x+y*y+zz*zz+w*w elseif @fractal==2 xi=x-x*x+y*y+zz*zz-w*w+@xconst yi=y-2*x*y+2*zz*w+@yconst zi=zz-2*x*zz+2*y*w+@zconst w=w-2*x*w-2*y*zz+@wconst sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi elseif @fractal==3 xi=x*x-y*y-zz*zz+w*w+lx+@xconst yi=2*(x*y-zz*w)+ly+@yconst zi=2*(x*zz-y*w)+lz+@zconst wi=2*(x*w+y*zz)+lw+@wconst lx=x ly=y lz=zz lw=w sq=xi*xi+yi*yi+zi*zi+wi*wi x=xi y=yi zz=zi w=wi elseif @fractal==4 ha=ha^@k+hca hb=hb^@k+hcb sq=|ha|+|hb| elseif @fractal==5 ha=fn2(ha)+hca hb=fn2(hb)+hcb sq=|ha|+|hb| elseif @fractal==6 ha=hca*ha^(@k-1)*(1-ha) hb=hcb*hb^(@k-1)*(1-hb) sq=|ha|+|hb| elseif @fractal==7 ha=ha^(@k-1)*(1-ha)+hca hb=hb^(@k-1)*(1-hb)+hcb sq=|ha|+|hb| elseif @fractal==8 oha=ha ohb=hb ha=ha^@k+lha+hca hb=hb^@k+lhb+hcb lha=oha lhb=ohb sq=|ha|+|hb| elseif @fractal==9 lha = ha^hpa1 lhb = hb^hpb1 lha = (hpa1*ha*lha+hca)/(hpa*lha) lhb = (hpb1*hb*lhb+hcb)/(hpb*lhb) sq = 1.0/(|lha-ha|+|lhb-hb|) ha = lha hb = lhb elseif @fractal==10 ha = ha^hpa+hca hb = hb^hpb+hcb sq = |ha|+|hb| elseif @fractal==11 if real(ha)+real(hb)>=0.0 ha = ha - 1.0 hb = hb - 1.0 else ha = ha + 1.0 hb = hb + 1.0 endif ha = ha*hca hb = hb*hcb sq = |ha| + |hb| endif else if @fractal==0 xi=mx*mx-my*my-mz*mz+mw*mw+x yi=2*(mx*my-mz*mw)+y zi=2*(mx*mz-my*mw)+zz mw=2*(mx*mw+my*mz)+w sq=xi*xi+yi*yi+zi*zi+mw*mw mx=xi my=yi mz=zi elseif @fractal==1 xi=mx-mx*mx+my*my+mz*mz-mw*mw yi=my-2*mx*my+2*mz*mw zi=mz-2*mx*mz+2*my*mw mw=mw-2*mx*mw-2*my*mz mx=x*xi-y*yi-zz*zi+w*mw my=y*xi+x*yi-w*zi-zz*mw mz=zz*xi-w*yi+x*zi-y*mw mw=w*xi+zz*yi+y*zi+x*mw sq=mx*mx+my*my+mz*mz+mw*mw elseif @fractal==2 xi=mx-mx*mx+my*my+mz*mz-mw*mw+x yi=my-2*mx*my+2*mz*mw+y zi=mz-2*mx*mz+2*my*mw+zz mw=mw-2*mx*mw-2*my*mz+w sq=xi*xi+yi*yi+zi*zi+mw*mw mx=xi my=yi mz=zi elseif @fractal==3 xi=mx*mx-my*my-mz*mz+mw*mw+lx+x yi=2*(mx*my-mz*mw)+ly+y zi=2*(mx*mz-my*mw)+lz+zz wi=2*(mx*mw+my*mz)+lw+w lx=mx ly=my lz=mz lw=mw sq=xi*xi+yi*yi+zi*zi+wi*wi mx=xi my=yi mz=zi mw=wi elseif @fractal==4 ha=ha^@k+hca hb=hb^@k+hcb sq=|ha|+|hb| elseif @fractal==5 ha=fn2(ha)+hca hb=fn2(hb)+hcb sq=|ha|+|hb| elseif @fractal==6 ha=hca*ha^(@k-1)*(1-ha) hb=hcb*hb^(@k-1)*(1-hb) sq=|ha|+|hb| elseif @fractal==7 ha=ha^(@k-1)*(1-ha)+hca hb=hb^(@k-1)*(1-hb)+hcb sq=|ha|+|hb| elseif @fractal==8 oha=ha ohb=hb ha=ha^@k+lha+hca hb=hb^@k+lhb+hcb lha=oha lhb=ohb sq=|ha|+|hb| elseif @fractal==9 lha = ha^hpa1 lhb = hb^hpb1 lha = (hpa1*ha*lha+hca)/(hpa*lha) lhb = (hpb1*hb*lhb+hcb)/(hpb*lhb) sq = 1.0/(|lha-ha|+|lhb-hb|) ha = lha hb = lhb elseif @fractal==10 ha = ha^hpa+hca hb = hb^hpb+hcb sq = |ha|+|hb| elseif @fractal==11 if real(ha)+real(hb)>=0.0 ha = ha - 1.0 hb = hb - 1.0 else ha = ha + 1.0 hb = hb + 1.0 endif ha = ha*hca hb = hb*hcb sq = |ha| + |hb| endif endif if @method==2 if @fractal<4 if @mandy==0 tv1 = x+flip(y)-tval1 tv2 = zz+flip(w)-tval2 else tv1 = mx+flip(my)-tval1 tv2 = mz+flip(mw)-tval2 endif else if @fixtrap tv1 = 0.5*(ha+hb)-tval1 tv2 = 0.5*(imag(ha)-imag(hb)+flip(real(hb)-real(ha)))-tval2 else tv1 = ha-tval1 tv2 = hb-tval2 endif endif if @traptype==0 min = |tv1|+|tv2| elseif @traptype==1 min = real(tv1) elseif @traptype==2 min = imag(tv1) elseif @traptype==3 min = real(tv2) elseif @traptype==4 min = imag(tv2) elseif @traptype==5 min = atan2(tv1) elseif @traptype==6 min = atan2(tv2) endif if @traptype>6 min = |tv1| if @usethreshold min = abs(min-@threshold) endif min1 = |tv2| if @usethreshold min1 = abs(min1-@threshold) endif if (@traptype==7 && min<@minval && min1<@minval) \ ||(@traptype==8 && (min<@minval || min1<@minval)) if min1#pi min = min - twopi endif if min<0 min = min + twopi endif endif elseif @traptype>0 && @traptype<5 min = abs(min) elseif @traptype>4 if @useangle==0 min = abs(min) elseif min<0 min = min + twopi endif endif endif j=j+1 until j>=#maxiter || sq>bail || (@method==2 && min<@minval) if @method==1 || (@method==3 && j>=#maxiter) if @fractal<4 if @mandy==0 tv1 = x+flip(y)-tval1 tv2 = zz+flip(w)-tval2 else tv1 = mx+flip(my)-tval1 tv2 = mz+flip(mw)-tval2 endif else if @fixtrap tv1 = 0.5*(ha+hb)-tval1 tv2 = 0.5*(imag(ha)-imag(hb)+flip(real(hb)-real(ha)))-tval2 else tv1 = ha-tval1 tv2 = hb-tval2 endif endif if @traptype==0 sq = |tv1|+|tv2| elseif @traptype==1 sq = real(tv1) elseif @traptype==2 sq = imag(tv1) elseif @traptype==3 sq = real(tv2) elseif @traptype==4 sq = imag(tv2) elseif @traptype==5 sq = atan2(tv1) elseif @traptype==6 sq = atan2(tv2) endif if @traptype>6 sq = |tv1| if @usethreshold sq = abs(sq-@threshold) endif min1 = |tv2| if @usethreshold min1 = abs(min1-@threshold) endif if (@traptype==7 && sq<@minval && min1<@minval) \ ||(@traptype==8 && (sq<@minval || min1<@minval)) if min1#pi sq = sq - twopi endif if sq<0 sq = sq + twopi endif endif elseif @traptype>0 && @traptype<5 sq = abs(sq) elseif @traptype>4 if @useangle==0 sq = abs(sq) elseif sq<0 sq = sq + twopi endif endif elseif @method==2 sq = min endif if s==0 ;iteration at current step s=1 ;iterate at current step + a bit next time if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true xt=xc yt=yc zt=zc wt=wc s=2 ;initiate binary search next time endif if @nobinary s=-1 endif elseif s==1 ;iteration at current step + a bit if @method==0 di1=j-k ldir1=di1 ;direction, towards/away if di1==0 ;if same iteration ldir1=lsq-sq ;use bailout value for direction endif elseif @method!=3 ldir1=lsq-sq elseif (ldir1=di1=j-k)==0 ldir1 = lsq-sq endif xt=xc yt=yc zt=zc wt=wc s=-1 ;Nothing found, move to next main step position if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true s=2 ;initiate binary search next time elseif (!@change && (ldir>0 && ldir1<0) || (@method==0 && dildir1) s=2 ;initiate binary search next time endif elseif s<@bindepth ;the binary search if b if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true ldir2=-1 s=s+1 else k=j lsq=sq b=false endif else if @method==0 ldir2=j-k if ldir2==0 ldir2=lsq-sq endif elseif @method!=3 ldir2=lsq-sq elseif (ldir2=j-k)==0 ldir2 = lsq-sq endif if (@method==0 && j>=#maxiter) \ ||(@method>0 && @method!=3 && sq<@minval) \ ||(@method==3 && j>=#maxiter && sq<@minval) found=true ldir2=-1 xt=xt+0.000030517578125*xsub yt=yt+0.000030517578125*ysub zt=zt+0.000030517578125*zsub wt=wt+0.000030517578125*wsub endif b=true s=s+1 endif endif if s==@bindepth s=-1 endif until s<0 if !found if @smart if j<=1 xs = xss ys = yss zs = zss ws = wss i=i+1.0 elseif j==2 xs = 0.5*xss ys = 0.5*yss zs = 0.5*zss ws = 0.5*wss i=i+0.5 elseif j==3 xs = 0.25*xss ys = 0.25*yss zs = 0.25*zss ws = 0.25*wss i=i+0.25 elseif j==3 xs = 0.125*xss ys = 0.125*yss zs = 0.125*zss ws = 0.125*wss i=i+0.125 elseif j==4 xs = 0.0625*xss ys = 0.0625*yss zs = 0.0625*zss ws = 0.0625*wss i=i+0.0625 elseif j==5 xs = 0.03125*xss ys = 0.03125*yss zs = 0.03125*zss ws = 0.03125*wss i=i+0.03125 elseif j==6 xs = 0.015625*xss ys = 0.015625*yss zs = 0.015625*zss ws = 0.015625*wss i=i+0.015625 elseif j==7 xs = 0.0078125*xss ys = 0.0078125*yss zs = 0.0078125*zss ws = 0.0078125*wss i=i+0.0078125 elseif j==8 xs = 0.00390625*xss ys = 0.00390625*yss zs = 0.00390625*zss ws = 0.00390625*wss i=i+0.00390625 elseif j==6 xs = 0.001953125*xss ys = 0.001953125*yss zs = 0.001953125*zss ws = 0.001953125*wss i=i+0.001953125 elseif j==7 xs = 0.0009765625*xss ys = 0.0009765625*yss zs = 0.0009765625*zss ws = 0.0009765625*wss i=i+0.0009765625 else xs = 0.00048828125*xss ys = 0.00048828125*yss zs = 0.00048828125*zss ws = 0.00048828125*wss i=i+0.00048828125 endif else i=i+1.0 endif xc=xc+xs yc=yc+ys zc=zc+zs wc=wc+ws ldir=ldir1 endif until i>=v || found==true if @colour==0 if p==0 if found==true x0=xt y0=yt z0=zt w0=wt if @light<3 || (@light>4 && @light<7) if @f<1e-5 xp=xt+dxx-dzx yp=yt+dxy-dzy zp=zt+dxz-dzz wp=wt+dxw-dzw else xp=xt-xo yp=yt-yo zp=zt-zo wp=wt-wo dd=sqrt(xp*xp+yp*yp+zp*zp+wp*wp) xp=xt-dzx+dxx*dd yp=yt-dzy+dxy*dd zp=zt-dzz+dxz*dd wp=wt-dzw+dxw*dd endif ldir=1 di=0 p=2 else if @smart shxs=xss shys=yss shzs=zss shws=wss else shxs=xs shys=ys shzs=zs shws=ws endif shxb=xb shyb=yb shzb=zb shwb=wb shxsb=xsb shysb=ysb shzsb=zsb shwsb=wsb shv=v if @light<5 zs=1.0/dtl xs=-r2c0*zs ys=-r2c1*zs zs=-r2c2*zs ws=zs*s1 zs=zs*c1 else xs=px-xt ys=py-yt zs=shz-zt ws=shw-wt if (s2=dtl*sqrt(xs*xs+ys*ys+zs*zs+ws*ws))6 shadow=found xs=shxs ys=shys zs=shzs ws=shws if @smart xss=xs yss=ys zss=zs wss=ws endif xb=shxb yb=shyb zb=shzb wb=shwb xsb=shxsb ysb=shysb zsb=shzsb wsb=shwsb v=shv if @f<1e-5 xp=x0+dxx-dzx yp=y0+dxy-dzy zp=z0+dxz-dzz wp=w0+dxw-dzw else xp=x0-xo yp=y0-yo zp=z0-zo wp=w0-wo dd=sqrt(xp*xp+yp*yp+zp*zp+wp*wp) xp=x0-dzx+dxx*dd yp=y0-dzy+dxy*dd zp=z0-dzz+dxz*dd wp=w0-dzw+dxw*dd endif ldir=1 di=0 p=2 endif elseif p==2 if found==true x1=xt y1=yt z1=zt*c1+wt*s1 else x1=xc y1=yc z1=zc*c1+wc*s1 endif if @f<1e-5 xp=xp-2*dxx yp=yp-2*dxy zp=zp-2*dxz wp=wp-2*dxw else xp=x0-2*dxx*dd yp=y0-2*dxy*dd zp=z0-2*dxz*dd wp=w0-2*dxw*dd endif ldir=1 di=0 p=3 elseif p==3 if found==true x2=xt y2=yt z2=zt*c1+wt*s1 else x2=xc y2=yc z2=zc*c1+wc*s1 endif if @f<1e-5 xp=xp+dxx+dyx yp=yp+dxy+dyy zp=zp+dxz+dyz wp=wp+dxw+dyw else xp=x0+(dxx+dyx)*dd yp=y0+(dxy+dyy)*dd zp=z0+(dxz+dyz)*dd wp=w0+(dxw+dyw)*dd endif ldir=1 di=0 p=4 elseif p==4 if found==true x3=xt y3=yt z3=zt*c1+wt*s1 else x3=xc y3=yc z3=zc*c1+wc*s1 endif if @f<1e-5 xp=xp-2*dyx yp=yp-2*dyy zp=zp-2*dyz wp=wp-2*dyw else xp=x0-2*dyx*dd yp=y0-2*dyy*dd zp=z0-2*dyz*dd wp=w0-2*dyw*dd endif ldir=1 di=0 p=5 elseif p==5 if found==true x4=xt y4=yt z4=zt*c1+wt*s1 else x4=xc y4=yc z4=zc*c1+wc*s1 found=true endif p=-1 endif endif until p<0 if found==true if @colour==0 xt=x0 yt=y0 zt=z0*c1+w0*s1 z0=zt x5=x0-x4 y5=y0-y4 z5=z0-z4 x4=x3-x0 y4=y3-y0 z4=z3-z0 x3=x0-x2 y3=y0-y2 z3=z0-z2 x2=x1-x0 y2=y1-y0 z2=z1-z0 x0=y2*z4-y4*z2 y0=x4*z2-x2*z4 z0=x2*y4-x4*y2 s2=1.0/sqrt(x0*x0+y0*y0+z0*z0) x0=x0*s2 y0=y0*s2 z0=z0*s2 x1=y2*z5-y5*z2 y1=x5*z2-x2*z5 z1=x2*y5-x5*y2 s2=1.0/sqrt(x1*x1+y1*y1+z1*z1) x1=x1*s2 y1=y1*s2 z1=z1*s2 x2=y3*z4-y4*z3 y2=x4*z3-x3*z4 z2=x3*y4-x4*y3 s2=1.0/sqrt(x2*x2+y2*y2+z2*z2) x2=x2*s2 y2=y2*s2 z2=z2*s2 x4=y3*z5-y5*z3 y4=x5*z3-x3*z5 z4=x3*y5-x5*y3 s2=1.0/sqrt(x4*x4+y4*y4+z4*z4) x4=x4*s2 y4=y4*s2 z4=z4*s2 x0=x0+x1+x2+x4 y0=y0+y1+y2+y4 z0=z0+z1+z2+z4 w0=1.0/sqrt(x0*x0+y0*y0+z0*z0) x0=x0*w0 ;N y0=y0*w0 z0=z0*w0 if @light==0 || @light==2 || @light==4 \ || @light==6 || @light==8 if @f<1e-5 x2=x0*m1r2c0+y0*m1r2c1+z0*m1r2c2 ;N.L else x5=xt-xo y5=yt-yo z5=zt-zzo s2=1.0/sqrt(x5*x5+y5*y5+z5*z5) x5=x5*s2 y5=y5*s2 z5=z5*s2 x2=x0*x5+y0*y5+z0*z5 ;N.L endif if x2>1.0 x2=1.0 endif if x2>0 if @f<1e-5 x3=(2*x0*x2-m1r2c0)*m1r2c0 \ +(2*y0*x2-m1r2c1)*m1r2c1 \ +(2*z0*x2-m1r2c2)*m1r2c2 ;(2*N*(N.L)-L).V else x3=(2*x0*x2-x5)*x5 \ +(2*y0*x2-y5)*y5 \ +(2*z0*x2-z5)*z5 ;(2*N*(N.L)-L).V endif if x3<0 x3=0 elseif x3>1 x3=1 endif if @diffuse<0 x2=-0.5*@diffuse*(1+x2) else x2=@diffuse*x2 endif else x3=0 if @diffuse<0 x2=-0.5*@diffuse*(1+x2) else x2=0 endif endif endif if @light==0 w0=@ambient+x2+@specular*x3^@specsize ;Ka+Kd*(N.L)+Ks*(R.V)^n if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+abs(@diffuse)+@specular) else z=w0 endif else if @light<5 ;Remote x1=r2c0 ;L y1=r2c1 z1=r2c2 else ;Point x1=xt-px y1=yt-py z1=zt-pz s2=1.0/sqrt(x1*x1+y1*y1+z1*z1) x1=x1*s2 ;L y1=y1*s2 z1=z1*s2 endif w0=x0*x1+y0*y1+z0*z1 ;N.L if w0>1.0 w0=1.0 endif if w0>0 if @f>=1e-5 && (@light==1 || @light==3 || @light==5 \ || @light==7) x5=xt-xo y5=yt-yo z5=zt-zzo s2=1.0/sqrt(x5*x5+y5*y5+z5*z5) x5=x5*s2 y5=y5*s2 z5=z5*s2 endif if @f>=1e-5 x0=(2*x0*w0-x1)*x5 \ +(2*y0*w0-y1)*y5 \ +(2*z0*w0-z1)*z5 ;(2*N*(N.L)-L).V else x0=(2*x0*w0-x1)*m1r2c0 \ +(2*y0*w0-y1)*m1r2c1 \ +(2*z0*w0-z1)*m1r2c2 ;(2*N*(N.L)-L).V endif if x0<0 x0=0 elseif x0>1 x0=1 endif if @diffuse<0 w0=-0.5*@diffuse*(1+w0) else w0=@diffuse*w0 endif else x0=0 if @diffuse<0 w0=-0.5*@diffuse*(1+w0) else w0=0 endif endif if @light==3 || @light==4 || @light>6 if shadow==true x0=x0*shad w0=w0*shad endif endif if @light==2 || @light==4 || @light==6 || @light==8 w0=@ambient+x2+@specular*x3^@specsize \ +@light4*(w0+@specular*x0^@specsize) if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+(1+@light4)*(abs(@diffuse)+@specular)) else z=w0 endif else w0=@ambient+w0+@specular*x0^@specsize ;Ka+Kd*(N.L)+Ks*(R.V)^n if w0<0 w0=0 endif if @clamp z=0.9975*w0/(@ambient+abs(@diffuse)+@specular) else z=w0 endif endif endif elseif @colour==1 && @mandy>0 if @fractal<4 x=@xconst y=@yconst zz=@zconst w=@wconst if @fractal==3 lx=x ly=y lz=zz lw=w endif else hca=xt-wt+flip(yt+zt) hcb=xt+wt+flip(yt-zt) if @fractal==9 || @fractal==11 ha=hca+@xconst-@wconst+flip(@yconst+@zconst) hb=hcb+@xconst+@wconst+flip(@yconst-@zconst) else ha=@xconst-@wconst+flip(@yconst+@zconst) hb=@xconst+@wconst+flip(@yconst-@zconst) endif if @fractal==6 || @fractal==7 ha=ha+(@k-1)/@k hb=hb+(@k-1)/@k endif if @fractal==8 lha=ha lhb=hb endif endif if @inside==0 z=fn1(@xconst+flip(@yconst)) elseif @inside==1 z=fn1(@xconst*@xconst+@yconst*@yconst \ +flip(@zconst*@zconst+@wconst*@wconst)) elseif @inside==2 z=fn1(sqr(@xconst*@xconst+@yconst*@yconst) \ +flip(sqr(@zconst*@zconst+@wconst*@wconst))) elseif @inside==3 z=fn1(@xconst+flip(@zconst)) elseif @inside==4 z=fn1(@xconst+flip(@wconst)) elseif @inside==5 z=fn1(@yconst+flip(@xconst)) elseif @inside==6 z=fn1(@yconst+flip(@zconst)) elseif @inside==7 z=fn1(@yconst+flip(@wconst)) elseif @inside==8 z=fn1(@zconst+flip(@xconst)) elseif @inside==9 z=fn1(@zconst+flip(@yconst)) elseif @inside==10 z=fn1(@zconst+flip(@wconst)) elseif @inside==11 z=fn1(@wconst+flip(@xconst)) elseif @inside==12 z=fn1(@wconst+flip(@yconst)) elseif @inside==13 z=fn1(@wconst+flip(@zconst)) elseif @inside==14 z=fn1(@xconst+flip(sqrt(@yconst*@yconst+@zconst*@zconst \ +@wconst*@wconst))) endif else if @colour==1 if @fractal>3 ha=xt-wt+flip(yt+zt) hb=xt+wt+flip(yt-zt) if @fractal==8 lha=ha lhb=hb endif elseif @fractal==3 lx=xt ly=yt lz=zt lw=wt endif endif if @colour==3 z=fn1(sqrt((xt-xo)^2+(yt-yo)^2+(zt-zzo)^2)) elseif @inside==0 z=fn1(xt+flip(yt)) elseif @inside==1 z=fn1(xt*xt+yt*yt+flip(zt*zt+wt*wt)) elseif @inside==2 z=fn1(sqr(xt*xt+yt*yt)+flip(sqr(zt*zt+wt*wt))) elseif @inside==3 z=fn1(xt+flip(zt)) elseif @inside==4 z=fn1(xt+flip(wt)) elseif @inside==5 z=fn1(yt+flip(xt)) elseif @inside==6 z=fn1(yt+flip(zt)) elseif @inside==7 z=fn1(yt+flip(wt)) elseif @inside==8 z=fn1(zt+flip(xt)) elseif @inside==9 z=fn1(zt+flip(yt)) elseif @inside==10 z=fn1(zt+flip(wt)) elseif @inside==11 z=fn1(wt+flip(xt)) elseif @inside==12 z=fn1(wt+flip(yt)) elseif @inside==13 z=fn1(wt+flip(zt)) elseif @inside==14 z=fn1(xt+flip(sqrt(yt*yt+zt*zt+wt*wt))) endif endif endif else ; found (clipped) found = false endif loop: if @colour==1 && found==true if @mandy==0 if @fractal==0 xi=xt*xt-yt*yt-zt*zt+wt*wt+@xconst yi=2*(xt*yt-zt*wt)+@yconst zi=2*(xt*zt-yt*wt)+@zconst wt=2*(xt*wt+yt*zt)+@wconst ; sq=xi*xi+yi*yi+zi*zi+wt*wt xt=xi yt=yi zt=zi elseif @fractal==1 xi=xt-xt*xt+yt*yt+zt*zt-wt*wt yi=yt-2*xt*yt+2*zt*wt zi=zt-2*xt*zt+2*yt*wt wt=wt-2*xt*wt-2*yt*zt xt=@xconst*xi-@yconst*yi-@zconst*zi+@wconst*wt yt=@yconst*xi+@xconst*yi-@wconst*zi-@zconst*wt zt=@zconst*xi-@wconst*yi+@xconst*zi-@yconst*wt wt=@wconst*xi+@zconst*yi+@yconst*zi+@xconst*wt ; sq=xt*xt+yt*yt+zt*zt+wt*wt elseif @fractal==2 xi=xt-xt*xt+yt*yt+zt*zt-wt*wt+@xconst yi=yt-2*xt*yt+2*zt*wt+@yconst zi=zt-2*xt*zt+2*yt*wt+@zconst wt=wt-2*xt*wt-2*yt*zt+@wconst ; sq=xi*xi+yi*yi+zi*zi+wt*wt xt=xi yt=yi zt=zi elseif @fractal==3 xi=xt*xt-yt*yt-zt*zt+wt*wt+lx+@xconst yi=2*(xt*yt-zt*wt)+ly+@yconst zi=2*(xt*zt-yt*wt)+lz+@zconst wi=2*(xt*wt+yt*zt)+lw+@wconst lx=xt ly=yt lz=zt lw=wt ; sq=xi*xi+yi*yi+zi*zi+wi*wi xt=xi yt=yi zt=zi wt=wi elseif @fractal==4 ha=ha^@k+hca hb=hb^@k+hcb elseif @fractal==5 ha=fn2(ha)+hca hb=fn2(hb)+hcb elseif @fractal==6 ha=hca*ha^(@k-1)*(1-ha) hb=hcb*hb^(@k-1)*(1-hb) elseif @fractal==7 ha=ha^(@k-1)*(1-ha)+hca hb=hb^(@k-1)*(1-hb)+hcb elseif @fractal==8 oha=ha ohb=hb ha=ha^@k+lha+hca hb=hb^@k+lhb+hcb lha=oha lhb=ohb elseif @fractal==9 lha = ha^hpa1 lhb = hb^hpb1 lha = (hpa1*ha*lha+hca)/(hpa*lha) lhb = (hpb1*hb*lhb+hcb)/(hpb*lhb) ; sq = 1.0/(|lha-ha|+|lhb-hb|) ha = lha hb = lhb elseif @fractal==10 ha = ha^hpa+hca hb = hb^hpb+hcb ; sq = |ha|+|hb| elseif @fractal==11 if real(ha)+real(hb)>=0.0 ha = ha - 1.0 hb = hb - 1.0 else ha = ha + 1.0 hb = hb + 1.0 endif ha = ha*hca hb = hb*hcb ; sq = |ha| + |hb| endif if @fractal>3 ; sq=|ha|+|hb| xt=0.5*(real(ha)+real(hb)) yt=0.5*(imag(ha)+imag(hb)) zt=0.5*(imag(ha)-imag(hb)) wt=0.5*(real(hb)-real(ha)) endif if @inside==0 z=fn1(xt+flip(yt)) elseif @inside==1 z=fn1(xt*xt+yt*yt+flip(zt*zt+wt*wt)) elseif @inside==2 z=fn1(sqr(xt*xt+yt*yt)+flip(sqr(zt*zt+wt*wt))) elseif @inside==3 z=fn1(xt+flip(zt)) elseif @inside==4 z=fn1(xt+flip(wt)) elseif @inside==5 z=fn1(yt+flip(xt)) elseif @inside==6 z=fn1(yt+flip(zt)) elseif @inside==7 z=fn1(yt+flip(wt)) elseif @inside==8 z=fn1(zt+flip(xt)) elseif @inside==9 z=fn1(zt+flip(yt)) elseif @inside==10 z=fn1(zt+flip(wt)) elseif @inside==11 z=fn1(wt+flip(xt)) elseif @inside==12 z=fn1(wt+flip(yt)) elseif @inside==13 z=fn1(wt+flip(zt)) elseif @inside==14 z=fn1(xt+flip(sqrt(yt*yt+zt*zt+wt*wt))) endif else if @fractal==0 xi=x*x-y*y-zz*zz+w*w+xt yi=2*(x*y-zz*w)+yt zi=2*(x*zz-y*w)+zt w=2*(x*w+y*zz)+wt ; sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi elseif @fractal==1 xi=x-x*x+y*y+zz*zz-w*w yi=y-2*x*y+2*zz*w zi=zz-2*x*zz+2*y*w w=w-2*x*w-2*y*zz x=xt*xi-yt*yi-zt*zi+wt*w y=yt*xi+xt*yi-wt*zi-zt*w zz=zt*xi-wt*yi+xt*zi-yt*w w=wt*xi+zt*yi+yt*zi+xt*w ; sq=x*x+y*y+zz*zz+w*w elseif @fractal==2 xi=x-x*x+y*y+zz*zz-w*w+xt yi=y-2*x*y+2*zz*w+yt zi=zz-2*x*zz+2*y*w+zt w=w-2*x*w-2*y*zz+wt ; sq=xi*xi+yi*yi+zi*zi+w*w x=xi y=yi zz=zi elseif @fractal==3 xi=x*x-y*y-zz*zz+w*w+lx+xt yi=2*(x*y-zz*w)+ly+yt zi=2*(x*zz-y*w)+lz+zt wi=2*(x*w+y*zz)+lw+wt lx=x ly=y lz=zz lw=w ; sq=xi*xi+yi*yi+zi*zi+wi*wi x=xi y=yi zz=zi w=wi elseif @fractal==4 ha=ha^@k+hca hb=hb^@k+hcb elseif @fractal==5 ha=fn2(ha)+hca hb=fn2(hb)+hcb elseif @fractal==6 ha=hca*ha^(@k-1)*(1-ha) hb=hcb*hb^(@k-1)*(1-hb) elseif @fractal==7 ha=ha^(@k-1)*(1-ha)+hca hb=hb^(@k-1)*(1-hb)+hcb elseif @fractal==8 oha=ha ohb=hb ha=ha^@k+lha+hca hb=hb^@k+lhb+hcb lha=oha lhb=ohb elseif @fractal==9 lha = ha^hpa1 lhb = hb^hpb1 lha = (hpa1*ha*lha+hca)/(hpa*lha) lhb = (hpb1*hb*lhb+hcb)/(hpb*lhb) ; sq = 1.0/(|lha-ha|+|lhb-hb|) ha = lha hb = lhb elseif @fractal==10 ha = ha^hpa+hca hb = hb^hpb+hcb ; sq = |ha|+|hb| elseif @fractal==11 if real(ha)+real(hb)>=0.0 ha = ha - 1.0 hb = hb - 1.0 else ha = ha + 1.0 hb = hb + 1.0 endif ha = ha*hca hb = hb*hcb ; sq = |ha| + |hb| endif if @fractal>3 ; sq=|ha|+|hb| x=0.5*(real(ha)+real(hb)) y=0.5*(imag(ha)+imag(hb)) zz=0.5*(imag(ha)-imag(hb)) w=0.5*(real(hb)-real(ha)) endif if @inside==0 z=fn1(x+flip(y)) elseif @inside==1 z=fn1(x*x+y*y+flip(zz*zz+w*w)) elseif @inside==2 z=fn1(sqr(x*x+y*y)+flip(sqr(zz*zz+w*w))) elseif @inside==3 z=fn1(x+flip(zz)) elseif @inside==4 z=fn1(x+flip(w)) elseif @inside==5 z=fn1(y+flip(x)) elseif @inside==6 z=fn1(y+flip(zz)) elseif @inside==7 z=fn1(y+flip(w)) elseif @inside==8 z=fn1(zz+flip(x)) elseif @inside==9 z=fn1(zz+flip(y)) elseif @inside==10 z=fn1(zz+flip(w)) elseif @inside==11 z=fn1(w+flip(x)) elseif @inside==12 z=fn1(w+flip(y)) elseif @inside==13 z=fn1(w+flip(zz)) elseif @inside==14 z=fn1(x+flip(sqrt(y*y+zz*zz+w*w))) endif endif endif bailout: found==true default: title = "Solid-3D Hypercomplex" helpfile = "MMF.html" center = (0, 0) magn = 1.0 method = multipass periodicity = 0 maxiter = 10 param fractal caption = "Fractal type" default = 0 enum = "h^2+c" "Lambda" "Breeder" "h^2+hold+c" "h^n+c" "fn2(h)+c" \ "Lambda^n" "Breeder^n" "h^n+hold+c" "Newton (^n)" "h^hp+c" \ "Barnsley 1" endparam param mandy caption = "Mandelbrot switch" default = 0 enum = "Julia" "Mandelbrot" hint = "Allows you to select a Julia or Mandelbrot style fractal. \ In Mandelbrot mode the constants set the start value." endparam param k caption = "Power (x,y)" default = (3,0) hint = "Power for the fractals that use it, \ e.g. h^n+c." endparam param l caption = "Power (z,w)" default = (0,0) hint = "Power for the fractals that use it, \ e.g. h^hp+c." endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 hint = "Defines how soon an orbit bails out \ i.e. is considered as tending to the infinite attractor." endparam param txy caption = "Target X and Y coord" default = (0,0) hint = "Note that using the dropper only works \ properly when the 3D rotations are zero." endparam param tz caption = "Target Zcoord" default = 0.0 endparam param r caption = "View-plane distance" default = 0.0 hint = "Sets the distance of the view-plane from the target. \ In parallel projection mode the view plane is also the \ front-clipping plane, in perspective projection mode it \ controls the perspective along with the magnification and \ the focal length." endparam param r1 caption = "Front-clipping distance" default = 2.0 hint = "Sets the distance of the front-clipping plane from the \ target when using perspective projection. You can set \ the front-clipping plane to be at a position either \ nearer the target or nearer the camera than the view-plane." endparam param view caption = "Viewing range" default = 4.0 min = 0.1 hint = "This is the maximum distance to \ scan from the front-clipping plane." endparam param f caption = "Focal length" default = 12.0 min = 0.0 hint = "Use to adjust the focal length of the camera, a value of zero \ will cause parallel projection to be used instead of perspective \ projection. In perspective projection mode this sets the distance \ of the camera from the view-plane." endparam param trackin caption = "Track in/out" default = 1.0 hint = "In perspective viewing mode this allows you to track the camera in \ and out, 1.0 is the default position and values >1 track away \ and values <1 track towards. In parallel viewing mode it's simply \ a magnification factor giving the effect of tracking the camera \ but in this case values between 0 and 1 track towards the camera \ i.e. magnify, and values >1 track away from the camera." endparam param cutlr caption = "Cut left/right ?" default = false endparam param leftcut caption = "Left cut" default = -1.0 endparam param rightcut caption = "Right cut" default = 1.0 endparam param cuttb caption = "Cut top/btm ?" default = false endparam param btmcut caption = "Bottom cut" default = -1.0 endparam param topcut caption = "Top cut" default = 1.0 endparam param cutfb caption = "Cut front/back ?" default = false endparam param frontcut caption = "Front cut" default = -1.0 endparam param backcut caption = "Back cut" default = 1.0 endparam param cutscale caption = "Plane cut scale" default = 1.0 hint = "Provides a way of scaling the cut planes/box for ease of animation." endparam param cutcentre caption = "Plane cut centre (x,y)" default = (0,0) hint = "Provides a quick way of recentreing the cutting planes." endparam param cutcentre1 caption = "Plane cut centre z" default = 0.0 hint = "Provides a quick way of recentreing the cutting planes." endparam param movecut caption = "Move cut planes" default = false hint = "When enabled the plane cut centre is adjusted to be offset from \ the current target coords." endparam param rotcut caption = "Rotate cut with camera" default = false endparam param cutrot1 caption = "Cut plane elevation" default = 0.0 endparam param cutrot2 caption = "Cut plane direction" default = 0.0 endparam param cutsphere caption = "Cut to sphere" default = false endparam param rcut caption = "Cut radius" default = 1.0 endparam param spherecentre caption = "Sphere (x,y)" default = (0,0) endparam param spherecentre1 caption = "Sphere z" default = 0.0 endparam param movesphere caption = "Move cut sphere" default = false hint = "When enabled the cut sphere centre is offset from the target." endparam param rotsphere caption = "Rotate cut sphere" default = false hint = "When enabled the sphere rotates around the target with the camera." endparam param clipall caption = "Clip all" default = true hint = "If enabled the fractal is clipped both spherically and to the \ cutting planes i.e. only areas not clipped by either method are \ visible. When disabled the two clipping are treated \ separately i.e. only areas clipped by both methods are removed." endparam param detail caption = "Detail level" default = 10.0 min = 2.0 hint = "Higher values produce more accuracy, use values \ under 40 for speed, more for detail. Around \ 100 produces reasonable final results at up to #maxiter 10. \ A #maxiter of 20 may require a value of 1000 or more ! \ You won't need values anywhere near so high when using 'Smart \ step' - in this case you're unlikely to require values over 100." endparam param smart caption = "Smart step" default = false hint = "When enabled the step distance is adjusted based on the iteration \ depth as rays are traced, producing good results at low \ 'Detail level' in quick time, very useful for when setting up. \ Currently only functions properly when using 'Iteration' as the \ solid method." endparam param nobinary caption = "Disable binary search" default = false hint = "Disable the binary search for fast but poor quality rendering." endparam param bindepth caption = "Binary search depth" default = 23 min = 8 max = 23 hint = "Min=8, Max=23. Reducing the value at higher detail levels may \ speed up rendering without visible loss of accuracy." endparam param change caption = "High Detail" default = false hint = "When enabled can vastly improve rendering quality at \ the expense of vastly reducing speed of \ calculation. Actually only worth using for final renders where \ speed of rendering is completely unimportant. Only used when the \ binary search is enabled." endparam param method caption = "Solid Method" enum = "Iteration" "Final z trap" "Orbit trap" "Max. Iter. trap" default = 0 hint = "Iteration is the standard method. The Traps consider points to \ be solid when the magnitude of the trapped value for any point \ throughout the iteration is below a minimum." endparam param trapval1 caption = "Trap Value (x,y)" default = (0,0) hint = "The (x,y) value to trap to." endparam param traprot1 caption = "Trap Rotation (x,y)" default = 0.0 hint = "Rotates the (x,y) Trap Value by this number of degrees, useful \ for producing animations." endparam param trapval2 caption = "Trap Value (z,w)" default = (0,0) hint = "The (z,w) value to trap to." endparam param traprot2 caption = "Trap Rotation (z,w)" default = 0.0 hint = "Rotates the (z,w) Trap Value by this number of degrees, useful \ for producing animations." endparam param traptype caption = "Trap type" enum = "Magnitude" "x" "y" "z" "w" "Angle x/y" "Angle w/z" "Real and Imag" \ "Real or Imag" default = 0 endparam param fixtrap caption = "Fix trap test" default = false hint = "When enabled the value being tested is converted to the true \ hypercomplex value for trapping." endparam param useangle caption = "Angle method" enum = "Abs(angle)" "All angles" default = 1 hint = "Only for the Angle Trap types" endparam param usethreshold caption = "Use Threshold" default = false hint = "When enabled the distance found is compared to this value. Note \ that the effective range when using Magnitude is >=0, using x, y, \ z and w is any value and when using Angle is -pi to +pi." endparam param threshold caption = "Threshold" default = 0.5 hint = "When enabled the distance found is compared to this value. Note \ that the effective range when using Magnitude is >=0, using x, y, \ z and w is any value and when using Angle is -pi to +pi." endparam param minval caption = "Minimum Value" default = 0.1 min = 0.0 hint = "Distances found below this value are considered to be solid." endparam param solid caption = "Solid condition" enum = "Threshold" "Direction change" default = 0 hint = "Direction change colours all and \ works faster, useful for when setting \ up position/rotation." endparam param angle1 caption = "X Rot (degrees)" default = 22.5 hint = "Rotation of Y and Z around the X axis. \ (elevation). To get roll - rotation of X \ and Y around the Z axis - use the Rotation \ angle in the location settings." endparam param angle2 caption = "Y Rot (degrees)" default = 0.0 hint = "Rotation of X and Z around the Y axis. \ (direction). To get roll - rotation of X \ and Y around the Z axis - use the Rotation \ angle in the location settings." endparam param angle3 caption = "4D Rot (degrees)" default = 0.0 hint = "Angle of the line in the plane \ of the 3rd and 4th start values, \ used as the Z-axis. \ 0=3rd part (Z), 90=4th part (W)" endparam param offset caption = "4th dimension offset" default = 0.0 hint = "Offsets the 3 dimensions viewed down the current \ 4th dimension. For a 4D rotation of zero this value \ is an offset on the W axis, for a 4D rotation of 90 \ degrees it is an offset on the Z axis." endparam param xconst caption = "X constant" default = 0.0 hint = "Value used as the X constant for the Julia set, or the \ start X value for a Mandelbrot" endparam param yconst caption = "Y constant" default = 0.0 hint = "Value used as the Y constant for the Julia set, or the \ start Y value for a Mandelbrot." endparam param zconst caption = "Z constant" default = 1.0 hint = "Value used as the Z constant for the Julia set, or the \ start Z value for a Mandelbrot." endparam param wconst caption = "W constant" default = 0.0 hint = "Value used as the W constant for the Julia set, or the \ start W value for a Mandelbrot." endparam param colour caption = "Colouring" enum = "Lighting" "Inside" "Co-ordinate" "Depth" default = 0 hint = "Use the MMF lighting UCL when using the \ lighting option. Any inside colouring can be \ used to colour the object when using \ Inside or Co-ordinate - NB. colourings or options \ that use #pixel will not remain consistent \ under 3D rotation." endparam param inside caption = "Inside/Co-ordinate" default = 0 enum = "(x,y)" "All squared" "All" "(x,z)" "(x,w)" "(y,x)" "(y,z)" \ "(y,w)" "(z,x)" "(z,y)" "(z,w)" "(w,x)" "(w,y)" "(w,z)" "(x,rest)" hint = "Sets the complex value to be passed as the complex Z \ on each iteration when using Inside colouring, \ or as the complex value when using Co-ordinate colouring. \ All squared uses (x^2+y^2,z^2+w^2) and All uses the roots \ of the same two values." endparam param ambient caption = "Ambient light" default = 0.15 min = -1.0 max = 1.0 hint = "The background light level, only relevant for the \ lighting colourings." endparam param diffuse caption = "Diffuse constant" default = 0.55 min = -1.0 max = 1.0 hint = "This value adjusts the proportion of light \ considered to be reflected by a rough surface. \ Use negative values if you wish soft diffuse lighting \ ie. light from the wrong-side of the object to \ have some effect. Only relevant for the \ lighting colourings." endparam param specular caption = "Specular constant" default = 0.3 min = 0 max = 1.0 hint = "This value adjusts the proportion of light \ considered to be reflected by a glassy-smooth \ surface. Only relevant for the \ lighting colourings." endparam param specsize caption = "Specular exponent" default = 5.0 min = 1.0 hint = "This value controls how mirror-like the specular \ reflection is, the larger the value, the more \ mirror-like the reflection. Only relevant for the \ lighting colourings." endparam param clamp caption = "Light value clamp" default = true hint = "When enabled the lighting value is clamped so as to \ fit the colour gradient. This parameter only affects \ the Remote or Point light options. You can produce \ the same result using the Colour Density but this \ option ensures no error." endparam param light caption = "Lighting method" enum = "Camera" "Remote" "Camera+Remote" "Remote+Shadows" "C+R+Shadows" \ "Point" "Camera+Point" "Point+Shadows" "C+P+Shadows" default = 0 hint = "You can light the object using a remote source from the camera \ direction, another remote source from elsewhere or another point \ source or camera and remote or camera and point, or remote with \ shadows, point with shadows or these last two with camera too." endparam param movelight caption = "Track with camera" default = false hint = "When enabled the lighting angles Light1 and Light2 are taken as \ offsets from the camera angles so that when the camera is rotated \ then the light source rotates with it." endparam param light1 caption = "Light 1 (degrees)" default = 60.0 hint = "Independant light elevation. Only relevant for the \ lighting colourings using independant lighting." endparam param light2 caption = "Light 2 (degrees)" default = 30.0 hint = "Independant light direction. Only relevant for the \ lighting colourings using independant lighting." endparam param light3 caption = "Light distance" default = 6.0 hint = "The distance of the light source from the \ camera target. Only relevant for the point \ lighting colouring using independant lighting." endparam param light4 caption = "Relative light" default = 1.0 min = 0.0 hint = "Sets the relative strength of the independant light \ compared to light from the camera. Values < 1 \ make the camera light more significant and values > \ 1 make the independant light more significant. Only applies \ when both light sources are used." endparam param shadow caption = "Depth of shadow" default = 0.5 min = 0.0 max = 1.0 hint = "Sets the darkness of the shadows, using zero is pointless \ as it produces none at all, a value of 1 produces the darkest \ shadows. Only independant lighting produces shadows." endparam param rot caption = "Rotation (Rads)" default = (0,0) hint = "For rotation using the switch preview, the real (horizontal) sets \ the direction and the imaginary (vertical) sets the pitch." endparam func fn1 caption = "Inside/Co-ord Fn" default = ident() hint = "Applied to the complex value to be passed to the colouring \ when using the Inside, Co-ordinate or Depth options. In Inside mode \ this function is applied to the complex (z) value used at the \ end of each iteration." endfunc func fn2 caption = "Comp func fn2" default = sin() hint = "Fn2 for the fractal types that use it, eg. fn2(h)+c. \ Note that some settings require a larger bailout \ value and others will not work due to convergence." endfunc switch: type = "MMFu-Solid3DHypercomplex" fractal = fractal mandy = mandy k = k l = l bailout = bailout txy = txy tz = tz r = r r1 = r1 view = view f = f trackin = trackin cutlr = cutlr leftcut = leftcut rightcut = rightcut cuttb = cuttb topcut = topcut btmcut = btmcut cutfb = cutfb frontcut = frontcut backcut = backcut cutscale = cutscale cutcentre = cutcentre cutcentre1 = cutcentre1 movecut = movecut rotcut = rotcut cutrot1 = cutrot1 cutrot2 = cutrot2 cutsphere = cutsphere rcut = rcut spherecentre = spherecentre spherecentre1 = spherecentre1 movesphere = movesphere rotsphere = rotsphere clipall = clipall detail = detail smart = smart nobinary = nobinary bindepth = bindepth change = change method = method trapval1 = trapval1 traprot1 = traprot1 trapval2 = trapval2 traprot2 = traprot2 traptype = traptype fixtrap = fixtrap useangle = useangle usethreshold = usethreshold threshold = threshold minval = minval solid = solid angle1 = angle1 angle2 = angle2 angle3 = angle3 offset = offset xconst = xconst yconst = yconst zconst = zconst wconst = wconst colour = colour inside = inside ambient = ambient diffuse = diffuse specular = specular specsize = specsize clamp = clamp light = light movelight = movelight light1 = light1 light2 = light2 light3 = light3 light4 = light4 shadow = shadow rot = #pixel fn1 = fn1 fn2 = fn2 } MMFv-MDerivative { ; ; Here's a formula that sets Zstart to a critical ; value properly for a change (critical values ; generally mean that the Mandelbrot-style formula ; provides a reasonable map of the Julias). ; By the parameters specifying the root/s of the ; derivative, suitable values of zstart are known. ; To produce the formula to iterate, the derivative ; must be integrated, this is done by expansion of ; brackets followed by integration. ; Please note that the integrals have been scaled so ; the highest power in p(z) has a coefficient of 1. ; An option for the "self-rotation" of z ie. by atan2(z) ; has been included as has the transformation of z by ; a fixed rotation and/or a fixed matrix and/or a ; translation, the value of z being transformed at ; the start of each iteration. ; The new self-rotation transformation (when enabled) ; rotates z by the angle atan2(z) using z*z/cabs(z) ; and is applied prior to the fixed transforms. ; There are also options to multiply p(z) by another ; function of z and/or apply a post-function before ; the result is used in the normal manner or using one ; of the lambda-style variations. ; There are parameters to allow you to adjust the ; position and scaling of the switched Julia as many ; options produce small Julias. ; ; The possibilities for the base polynomial are: ; ; Degree 1: ; Derivative: (a = first root) ; p'(z) = z - a ; Integral (*2): ; p(z) = z^2 - 2*az ; ; Degree 2: ; Derivative: (b = second root) ; p'(z) = (z-a)(z-b) = z^2 - (a+b)z + ab ; Integral (*3): ; p(z) = z^3 - 3*(a+b)(z^2)/2 + 3*abz ; ; Degree 3: ; Derivative: (c = third root) ; p'(z) = (z-a)(z-b)(z-c) ; = z^3 - (a+b+c)(z^2) + (ab+ac+bc)z - abc ; Integral (*4): ; p(z) = z^4 - 4*(a+b+c)(z^3)/3 + 2*(ab+ac+bc)(z^2) - 4*abcz ; ; Degree 4: ; Derivative: (d = fourth root) ; p'(z) = (z-a)(z-b)(z-c)(z-d) ; = z^4 - (a+b+c+d)(z^3) + (ab+ac+ad+bc+bd+cd)(z^2) - (abc+abd+acd+bcd)z + abcd ; Integral (*5): ; p(z) = ; z^5 - 5*(a+b+c+d)(z^4)/4 + 5*(ab+ac+ad+bc+bd+cd)(z^3)/3 - 5*(abc+abd+acd+bcd)(z^2)/2 + 5*abcdz ; ; "Iterate the product" added 6th April 2002 ; The option to "iterate the sum" added 11th August 2001 ; "Mu/Lambda" variants extended 1st May 2001 ; Transformations, functions and switch settings ; added 26th April 2001 ; "Mu/Lambda" variants added 25th April 2001 ; Created 4th April 2001 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex p = #pixel if @scalem != 1.0 p = p/@scalem endif if @centrem != (0,0) p = p + @centrem endif if @degree == 0 || @root == 0 complex z = @a + @start elseif @degree == 1 || @root == 1 complex z = @b + @start elseif @degree == 2 || @root == 2 complex z = @c + @start else complex z = @d + @start endif complex apb = 0 complex ab = 0 complex apbpc = 0 complex abpacpbc = 0 complex abc = 0 complex cpd = 0 complex cd = 0 complex apbpcpd = 0 complex abpacpadpbcpbdpcd = 0 complex abcpabdpacdpbcd = 0 complex abcd = 0 if @degree == 1 complex apb = 3*(@a + @b)/2 complex ab = 3*@a*@b elseif @degree == 2 complex apbpc = 4*(@a + @b + @c)/3 complex abpacpbc = 2*(@a*(@b+@c) + @b*@c) complex abc = 4*@a*@b*@c elseif @degree == 3 complex cpd = @c + @d complex cd = @c*@d complex apbpcpd = 5*(@a + @b + cpd)/4 complex abpacpadpbcpbdpcd = 5*(@a*(@b+cpd) + @b*(cpd) + cd)/3 complex abcpabdpacdpbcd = 5*(@a*@b*cpd + cd*(@a+@b))/2 complex abcd = 5*@a*@b*cd endif complex zold = z complex zs = (0,0) complex zp = (1,0) float x = real(z) float y = imag(z) float t = x float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + p endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @t if @degree == 0 z = z*z - 2*@a*z elseif @degree == 1 z = z^3 - apb*z^2 + ab*z elseif @degree == 2 z = z^4 - apbpc*z^3 + abpacpbc*z^2 - abc*z elseif @degree ==3 z = z^5 - apbpcpd*z^4 + abpacpadpbcpbdpcd*z^3 \ - abcpabdpacdpbcd*z^2 + abcd*z endif if @extra == 0 if @lambda == 0 z = fn1(z) + p elseif @lambda == 1 z = p*fn1(z) + @v elseif @lambda == 2 z = p*(fn1(z) + @v) elseif @lambda == 3 z = fn1(z) + 1/p + @v elseif @lambda == 4 z = (1/p + @v1)*fn1(z) + @v elseif @lambda == 5 z = fn1(z) + 1/p + p + @v else z = (1/p + p + @v1)*fn1(z) + @v endif else if @lambda == 0 z = fn1(z*fn2(zold)) + p elseif @lambda == 1 z = p*fn1(z*fn2(zold)) + @v elseif @lambda == 2 z = p*(fn1(z*fn2(zold)) + @v) elseif @lambda == 3 z = fn1(z*fn2(zold)) + 1/p + @v elseif @lambda == 4 z = (1/p + @v1)*fn1(z*fn2(zold)) + @v elseif @lambda == 5 z = fn1(z*fn2(zold)) + 1/p + p + @v else z = (1/p + p + @v1)*fn1(z*fn2(zold)) + @v endif endif if @smallbail > 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Derivative, Mandelbrot" method = multipass periodicity = 0 center = (0, 0) helpfile = "MMF.html" param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing which may be required \ when using the functions in particular." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param degree caption = "Degree (derivative)" default = 0 enum = "Linear" "Quadratic" "Cubic" "Quartic" hint = "Sets the number of brackets of the form \ (z - v) to be multiplied in the formula, \ ie. determines the highest power of the \ derivative and hence the iterated formula \ will be one power in z higher. Also determines \ the number of roots available." endparam param a caption = "First Root" default = (0,0) hint = "This root is used in all cases." endparam param b caption = "Second Root" default = (0,0) hint = "This root applies when Degree is Quadratic or higher" endparam param c caption = "Third Root" default = (0,0) hint = "This root applies when degree is Cubic or higher." endparam param d caption = "Fourth Root" default = (0,0) hint = "This root only applies when Degree is Quartic." endparam param root caption = "Start z" default = 0 enum = "First Root" "Second Root" "Third Root" "Fourth Root" hint = "Specifies which root to use as Zstart, when a choice \ is available (Degree > Linear)." endparam param lambda caption = "Mu/Lambda version" default = 0 enum = "f(z)+c" "c*f(z)+v" "c*(f(z)+v)" "f(z)+1/c+v" \ "(1/c+v1)*f(z)+v" "f(z)+1/c+c+v" "(1/c+c+v1)*f(z)+v" hint = "Mu as f(z)+c, Lambda as c*f(z)+v or c*(f(z)+v), \ inverted Mu as f(z)+1/c+v, inverted Lambda as \ (1/c+v1)*f(z)+v plus inverted Mu as f(z)+1/c+c+v \ and inverted Lambda as (1/c+c+v1)*f(z)+v." endparam param v caption = "Mu/Lambda v" default = (0,0) hint = "Sets the value of v as used by some of the Mu/Lambda versions." endparam param v1 caption = "Mu/Lambda v1" default = (0,0) hint = "Sets the value of v1 as used by some of the Mu/Lambda versions." endparam func fn1 caption = "Overall function f1" default = ident() hint = "Applied to the whole polynomial ie. as f(z) = f1(p(z)). \ Since the derivative of f1(p(z)) is f1'(p(z))p'(z) \ then the roots of p'(z) are also roots of the \ derivative of f1(p(z))." endfunc param extra caption = "Extra multiply" default = 0 enum = "Disabled" "Enabled" hint = "When enabled p(z) is multiplied by f2(z). Note that \ this will generally alter the highest power of z and \ will often alter the derivative of the overall formula \ such that it's roots are no longer the roots of p'(z)." endparam func fn2 caption = "Multiply function f2" default = ident() hint = "Only used when Extra multiply is enabled. When in use \ the equation used effectively becomes f(z) = f1(p(z)*f2(z)), \ hence the roots of f'(z) don't necessarily match those of p'(z)." endfunc param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param selfrot caption = "Self-rotation" default = 1 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration." endparam param t caption = "Translation" default = (0,0) hint = "Translates (moves) the value of z \ on each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param centrej caption = "Julia-switch offset" default = (0,0) hint = "Use this to adjust the position of the Julia set you wish to view \ using the switch function when it's off centre." endparam param scalej caption = "Julia-switch scale" default = 1.0 hint = "Use this adjust the scale of the Julia set you wish to view \ using the switch function when it's too large or too small. \ Use values >1.0 to zoom in and values 0 < v < 1.0 to zoom out." endparam param start caption = "Perturbation" default = (0,0) hint = "Perturbation of Zstart, use to deform the fractal." endparam param centrem caption = "Mandy-switch offset" default = (0,0) hint = "This should normally be (0,0), it should really only be modified \ when adjusting the switched Mandelbrot from the Julia version." endparam param scalem caption = "Mandy-switch scale" default = 1.0 hint = "This should normally be 1.0, it should really only be modified \ when adjusting the switched Mandelbrot from the Julia version." endparam switch: type = "MMFv-JDerivative" seed = #pixel smallbail = smallbail test = test bailout = bailout bailout1 = bailout1 degree = degree a = a b = b c = c d = d root = root lambda = lambda v = v v1 = v1 fn1 = fn1 extra = extra fn2 = fn2 sigma = sigma product = product selfrot = selfrot ang = ang t = t m = m n = n centrem = centrem scalem = scalem centrej = centrej scalej = scalej } MMFv-JDerivative { ; ; Here's a formula that sets Zstart to a critical ; value properly for a change (in the Mandelbrot form) ; and this is the Julia version of that formula. ; By the parameters specifying the root/s of the ; derivative, suitable values of zstart are known. ; To produce the formula to iterate, the derivative ; must be integrated, this is done by expansion of ; brackets followed by integration. ; Please note that the integrals have been scaled so ; the highest power in p(z) has a coefficient of 1. ; An option for the "self-rotation" of z ie. by atan2(z) ; has been included as has the transformation of z by ; a fixed rotation and/or a fixed matrix and/or a ; translation, the value of z being transformed at ; the start of each iteration. ; The new self-rotation transformation (when enabled) ; rotates z by the angle atan2(z) using z*z/cabs(z) ; and is applied prior to the fixed transforms. ; There are also options to multiply p(z) by another ; function of z and/or apply a post-function before ; the result is used in the normal manner or using one ; of the lambda-style variations. ; There are parameters to allow you to adjust the ; position and scaling of the switched Mandelbrot as ; many options produce small Mandelbrots. ; ; The possibilities for the base polynomial are: ; ; Degree 1: ; Derivative: (a = first root) ; p'(z) = z - a ; Integral (*2): ; p(z) = z^2 - 2*az ; ; Degree 2: ; Derivative: (b = second root) ; p'(z) = (z-a)(z-b) = z^2 - (a+b)z + ab ; Integral (*3): ; p(z) = z^3 - 3*(a+b)(z^2)/2 + 3*abz ; ; Degree 3: ; Derivative: (c = third root) ; p'(z) = (z-a)(z-b)(z-c) ; = z^3 - (a+b+c)(z^2) + (ab+ac+bc)z - abc ; Integral (*4): ; p(z) = z^4 - 4*(a+b+c)(z^3)/3 + 2*(ab+ac+bc)(z^2) - 4*abcz ; ; Degree 4: ; Derivative: (d = fourth root) ; p'(z) = (z-a)(z-b)(z-c)(z-d) ; = z^4 - (a+b+c+d)(z^3) + (ab+ac+ad+bc+bd+cd)(z^2) - (abc+abd+acd+bcd)z + abcd ; Integral (*5): ; p(z) = ; z^5 - 5*(a+b+c+d)(z^4)/4 + 5*(ab+ac+ad+bc+bd+cd)(z^3)/3 - 5*(abc+abd+acd+bcd)(z^2)/2 + 5*abcdz ; ; "Iterate the product" added 6th April 2002 ; The option to "iterate the sum" added 11th August 2001 ; "Mu/Lambda" variants extended 1st May 2001 ; Transformations, functions and switch settings ; added 26th April 2001 ; "Mu/Lambda" variants added 25th April 2001 ; Created 4th April 2001 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel if @scalej != 1.0 z = z/@scalej endif if @centrej != (0,0) z = z + @centrej endif complex apb = 0 complex ab = 0 complex apbpc = 0 complex abpacpbc = 0 complex abc = 0 complex cpd = 0 complex cd = 0 complex apbpcpd = 0 complex abpacpadpbcpbdpcd = 0 complex abcpabdpacdpbcd = 0 complex abcd = 0 if @degree == 1 apb = 3*(@a + @b)/2 ab = 3*@a*@b elseif @degree == 2 apbpc = 4*(@a + @b + @c)/3 abpacpbc = 2*(@a*(@b+@c) + @b*@c) abc = 4*@a*@b*@c elseif @degree == 3 cpd = @c + @d cd = @c*@d apbpcpd = 5*(@a + @b + cpd)/4 abpacpadpbcpbdpcd = 5*(@a*(@b+cpd) + @b*(cpd) + cd)/3 abcpabdpacdpbcd = 5*(@a*@b*cpd + cd*(@a+@b))/2 abcd = 5*@a*@b*cd endif complex zold = z complex zs = (0,0) complex zp = (1,0) float x = real(z) float y = imag(z) float t = x float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca ; float twodpi = 2/#pi bool bail = true loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif if @selfrot > 0 ; z = z * (0,1)^(twodpi*atan2(z)) t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + @seed endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @t if @degree == 0 z = z*z - 2*@a*z elseif @degree == 1 z = z^3 - apb*z^2 + ab*z elseif @degree == 2 z = z^4 - apbpc*z^3 + abpacpbc*z^2 - abc*z elseif @degree ==3 z = z^5 - apbpcpd*z^4 + abpacpadpbcpbdpcd*z^3 \ - abcpabdpacdpbcd*z^2 + abcd*z endif if @extra == 0 if @lambda == 0 z = fn1(z) + @seed elseif @lambda == 1 z = @seed*fn1(z) + @v elseif @lambda == 2 z = @seed*(fn1(z) + @v) elseif @lambda == 3 z = fn1(z) + 1/@seed + @v elseif @lambda == 4 z = (1/@seed + @v1)*fn1(z) + @v elseif @lambda == 5 z = fn1(z) + 1/@seed + @seed + @v else z = (1/@seed + @seed + @v1)*fn1(z) + @v endif else if @lambda == 0 z = fn1(z*fn2(zold)) + @seed elseif @lambda == 1 z = @seed*fn1(z*fn2(zold)) + @v elseif @lambda == 2 z = @seed*(fn1(z*fn2(zold)) + @v) elseif @lambda == 3 z = fn1(z*fn2(zold)) + 1/@seed + @v elseif @lambda == 4 z = (1/@seed + @v1)*fn1(z*fn2(zold)) + @v elseif @lambda == 5 z = fn1(z*fn2(zold)) + 1/@seed + @seed + @v else z = (1/@seed + @seed + @v1)*fn1(z*fn2(zold)) + @v endif endif if @smallbail > 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Derivative, Julia" method = multipass periodicity = 0 center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (-0.0375,0.75) hint = "Modify for different Julia sets." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing which may be required \ when using the functions in particular." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Julia set anymore." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param degree caption = "Degree (derivative)" default = 0 enum = "Linear" "Quadratic" "Cubic" "Quartic" hint = "Sets the number of brackets of the form \ (z - v) to be multiplied in the formula, \ ie. determines the highest power of the \ derivative and hence the iterated formula \ will be one power in z higher. Also determines \ the number of roots available." endparam param a caption = "First Root" default = (0,0) hint = "This root is used in all cases." endparam param b caption = "Second Root" default = (0,0) hint = "This root applies when Degree is Quadratic or higher" endparam param c caption = "Third Root" default = (0,0) hint = "This root applies when degree is Cubic or higher." endparam param d caption = "Fourth Root" default = (0,0) hint = "This root only applies when Degree is Quartic." endparam param lambda caption = "Mu/Lambda version" default = 0 enum = "f(z)+c" "c*f(z)+v" "c*(f(z)+v)" "f(z)+1/c+v" \ "(1/c+v1)*f(z)+v" "f(z)+1/c+c+v" "(1/c+c+v1)*f(z)+v" hint = "Mu as f(z)+c, Lambda as c*f(z)+v or c*(f(z)+v), \ inverted Mu as f(z)+1/c+v, inverted Lambda as \ (1/c+v1)*f(z)+v plus inverted Mu as f(z)+1/c+c+v \ and inverted Lambda as (1/c+c+v1)*f(z)+v." endparam param v caption = "Mu/Lambda v" default = (0,0) hint = "Sets the value of v as used by some of the Mu/Lambda versions." endparam param v1 caption = "Mu/Lambda v1" default = (0,0) hint = "Sets the value of v1 as used by some of the Mu/Lambda versions." endparam func fn1 caption = "Overall function f1" default = ident() hint = "Applied to the whole polynomial ie. as f(z) = f1(p(z)). \ Since the derivative of f1(p(z)) is f1'(p(z))p'(z) \ then the roots of p'(z) are also roots of the \ derivative of f1(p(z))." endfunc param extra caption = "Extra multiply" default = 0 enum = "Disabled" "Enabled" hint = "When enabled p(z) is multiplied by f2(z). Note that \ this will generally alter the highest power of z and \ will often alter the derivative of the overall formula \ such that it's roots are no longer the roots of p'(z)." endparam func fn2 caption = "Multiply function f2" default = ident() hint = "Only used when Extra multiply is enabled. When in use \ the equation used effectively becomes f(z) = f1(p(z)*f2(z)), \ hence the roots of f'(z) don't necessarily match those of p'(z)." endfunc param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param selfrot caption = "Self-rotation" default = 1 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds the seed to the rotated value, it's \ only here as it produces some interesting results." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration." endparam param t caption = "Translation" default = (0,0) hint = "Translates (moves) the value of z \ on each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param centrem caption = "Mandy-switch offset" default = (0,0) hint = "Use this to adjust the position of the Mandelbrot set you wish to view \ using the switch function when it's off centre." endparam param scalem caption = "Mandy-switch scale" default = 1.0 hint = "Use this adjust the scale of the Mandelbrot set you wish to view \ using the switch function when it's too large or too small. \ Use values >1.0 to zoom in and values 0 < v < 1.0 to zoom out." endparam param root caption = "Start Z (switch)" default = 0 enum = "First Root" "Second Root" "Third Root" "Fourth Root" hint = "Specifies which root to use as Zstart in the switched \ Mandelbrot version, when a choice is available \ (Degree > Linear). Modifying this parameter will not \ affect the Julia set, it will modify the Mandelbrot on \ the switch tool." endparam param centrej caption = "Julia-switch offset" default = (0,0) hint = "This should normally be (0,0), it should really only be modified \ when adjusting the switched Julia from the Mandelbrot version." endparam param scalej caption = "Julia-switch scale" default = 1.0 hint = "This should normally be 1.0, it should really only be modified \ when adjusting the switched Julia from the Mandelbrot version." endparam switch: type = "MMFv-MDerivative" start = #pixel smallbail = smallbail test = test bailout = bailout bailout1 = bailout1 degree = degree a = a b = b c = c d = d lambda = lambda v = v v1 = v1 fn1 = fn1 extra = extra fn2 = fn2 sigma = sigma product = product selfrot = selfrot ang = ang t = t m = m n = n root = root centrem = centrem scalem = scalem centrej = centrej scalej = scalej } MMFw-MNotRot { ; ; The idea for this formula came from considering ; the fact that calculating z^2 is effectively rotation ; and scaling of z based on the value of z. ; Since the rotation part of this can be done using the ; 2*2 rotation matrix including sin and cos of atan2(z), ; it struck me that this could be considered (ignoring ; the atan2) as involving two functions and/or their ; derivatives so I decided to try a formula loosely based ; on this idea, the functions being real polynomials - ; ie. a selection from: ; p'(x), p(x), q'(x), q(x) and p'(y), p(y), q'(y), q(y). ; Since the idea is based on rotation I decided to call ; the formula/method "Not Rotation". ; In this case each complex parameter defines two real ; roots, one used to define p'() and one q'(). ; The "complex" formula produced is: ; f(z) = f(x + iy) = +/-a(x)+/-b(y) + i*(+/-c(x)+/-d(y)) ; or (Multiply) = +/-a(x)*b(y) + i*(+/-c(x)*d(y)) ; or ("Rotate1") = +/-x*a(x)+/-y*b(y) ; + i*(+/-x*c(x)+/-y*d(y)) ; or ("Rotate2") = +/-y*a(x)+/-x*b(y) ; + i*(+/-y*c(x)+/-x*d(y)) ; where a(x) and c(x) each may be defined as p(x), p'(x), ; q(x) or q'(x), similarly b(y) and d(y) each may be ; defined as p(y), p'(y), q(y) or q'(y). ; Note that the Rotate1 version simply raises the powers of ; the polynomials used by one - meaning there is no longer ; a constant term when using p'() or q'(). ; Also note that the derivatives have been scaled so ; the highest powers in p() and q() each have ; coefficients of 1. ; Options for the "self-rotation" of z by atan2(z), ; and/or the transformation of z by a fixed rotation ; and/or by a fixed matrix and/or by a translation ; have been included, the value of z being transformed ; at the start of each iteration. ; The self-rotation transformation (when enabled) ; rotates z by the angle atan2(z) using ; rot(z)=z*z/cabs(z) and is applied prior to the ; fixed transforms. ; There are also options to multiply the result of f(z) ; by another function of z and/or apply a post-function ; before the result is used in the normal manner or using ; one of the lambda-style variations. ; ; Please note that in the definition of p(z) below the ; roots specified are the real part of the parameters, ; q'(z) and q(z) are defined in the same manner using ; the imaginary parts of the parameters. ; Consider z here as being either x or y. ; The possibilities for the polynomials are: ; ; Degree 1: ; Derivative: (a = first root) ; p'(z) = 2*(z - a) = 2*z - 2*a ; Integral: ; p(z) = z^2 - 2*az ; ; Degree 2: ; Derivative: (b = second root) ; p'(z) = 3*(z-a)(z-b) = 3*z^2 - 3*(a+b)z + 3*ab ; Integral (*3): ; p(z) = z^3 - 3*(a+b)(z^2)/2 + 3*abz ; ; Degree 3: ; Derivative: (c = third root) ; p'(z) = 4*(z-a)(z-b)(z-c) ; = 4*z^3 - 4*(a+b+c)(z^2) + 4*(ab+ac+bc)z - 4*abc ; Integral (*4): ; p(z) = z^4 - 4*(a+b+c)(z^3)/3 + 2*(ab+ac+bc)(z^2) - 4*abcz ; ; Degree 4: ; Derivative: (d = fourth root) ; p'(z) = 5*(z-a)(z-b)(z-c)(z-d) ; = 5*z^4 - 5*(a+b+c+d)(z^3) + 5*(ab+ac+ad+bc+bd+cd)(z^2) - 5*(abc+abd+acd+bcd)z + 5*abcd ; Integral (*5): ; p(z) = ; z^5 - 5*(a+b+c+d)(z^4)/4 + 5*(ab+ac+ad+bc+bd+cd)(z^3)/3 - 5*(abc+abd+acd+bcd)(z^2)/2 + 5*abcdz ; ; "Iterate the product" added 6th April 2002 ; The option to "iterate the sum" added 11th August 2001 ; Multiply and "rotate" variants added 30th April 2001 ; Split into p() and q() 29th April 2001 ; Created 28th April 2001 ; ; Copyright 2001 Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex p = #pixel complex zold = z complex zs = (0,0) complex zp = (1,0) float x = real(z) float y = imag(z) float t = x float x1 = x float y1 = y float ap = real(@a) float aq = imag(@a) float bp = real(@b) float bq = imag(@b) float cp = real(@c) float cq = imag(@c) float dp = real(@d) float dq = imag(@d) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca ; float twodpi = 2/#pi bool bail = true if @scalem != 1.0 p = p/@scalem endif if @centrem != (0,0) p = p + @centrem endif if (@degreep == 0 && @degreeq == 0) || @root == 0 complex z = @a + @start elseif (@degreep < 2 && @degreeq < 2) || @root == 1 complex z = @b + @start elseif (@degreep < 3 && @degreeq < 3) || @root == 2 complex z = @c + @start else complex z = @d + @start endif if @usexy == 1 || @usexx == 1 || @useyx == 1 || @useyy == 1 \ || @usexy == 5 || @usexx == 5 || @useyx == 5 || @useyy == 5 if @degreep == 1 float apbp = 3*(ap + bp)/2 float abp = 3*ap*bp elseif @degreep == 2 float apbpcp = 4*(ap + bp + cp)/3 float abpacpbcp = 2*(ap*(bp+cp) + bp*cp) float abcp = 4*ap*bp*cp elseif @degreep == 3 float cpdp = cp + dp float cdp = cp*dp float apbpcpdp = 5*(ap + bp + cpdp)/4 float abpacpadpbcpbdpcdp = 5*(ap*(bp+cpdp) + bp*(cpdp) + cdp)/3 float abcpabdpacdpbcdp = 5*(ap*bp*cpdp + cdp*(ap+bp))/2 float abcdp = 5*ap*bp*cdp endif endif if @usexy == 3 || @usexx == 3 || @useyx == 3 || @useyy == 3 \ || @usexy == 7 || @usexx == 7 || @useyx == 7 || @useyy == 7 if @degreeq == 1 float apbq = 3*(aq + bq)/2 float abq = 3*aq*bq elseif @degreeq == 2 float apbpcq = 4*(aq + bq + cq)/3 float abpacpbcq = 2*(aq*(bq+cq) + bq*cq) float abcq = 4*aq*bq*cq elseif @degreeq == 3 float cpdq = cq + dq float cdq = cq*dq float apbpcpdq = 5*(aq + bq + cpdq)/4 float abpacpadpbcpbdpcdq = 5*(aq*(bq+cpdq) + bq*(cpdq) + cdq)/3 float abcpabdpacdpbcdq = 5*(aq*bq*cpdq + cdq*(aq+bq))/2 float abcdq = 5*aq*bq*cdq endif endif loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif if @selfrot > 0 ; z = z * (0,1)^(twodpi*atan2(z)) t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + p endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @t x = real(z) y = imag(z) if @degreep == 0 if @usexy == 0 || @usexy == 4 x1 = 2*(x - ap) elseif @usexy == 1 || @usexy == 5 x1 = x*x - 2*ap*x endif if @useyx == 0 || @useyx == 4 y1 = 2*(y - ap) elseif @useyx == 1 || @useyx == 5 y1 = y*y - 2*ap*y endif elseif @degreep == 1 if @usexy == 0 || @usexy == 4 x1 = 3*(x - ap)*(x - bp) elseif @usexy == 1 || @usexy == 5 x1 = x^3 - apbp*x^2 + abp*x endif if @useyx == 0 || @useyx == 4 y1 = 3*(y - ap)*(y - bp) elseif @useyx == 1 || @useyx == 5 y1 = y^3 - apbp*y^2 + abp*y endif elseif @degreep == 2 if @usexy == 0 || @usexy == 4 x1 = 4*(x - ap)*(x - bp)*(x - cp) elseif @usexy == 1 || @usexy == 5 x1 = x^4 - apbpcp*x^3 + abpacpbcp*x^2 - abcp*x endif if @useyx == 0 || @useyx == 4 y1 = 4*(y - ap)*(y - bp)*(y - cp) elseif @useyx == 1 || @useyx == 5 y1 = y^4 - apbpcp*y^3 + abpacpbcp*y^2 - abcp*y endif elseif @degreep == 3 if @usexy == 0 || @usexy == 4 x1 = 5*(x - ap)*(x - bp)*(x - cp)*(x - dp) elseif @usexy == 1 || @usexy == 5 x1 = x^5 - apbpcpdp*x^4 + abpacpadpbcpbdpcdp*x^3 \ - abcpabdpacdpbcdp*x^2 + abcdp*x endif if @useyx == 0 || @useyx == 4 y1 = 5*(y - ap)*(y - bp)*(y - cp)*(y - dp) elseif @useyx == 1 || @useyx == 5 y1 = y^5 - apbpcpdp*y^4 + abpacpadpbcpbdpcdp*y^3 \ - abcpabdpacdpbcdp*y^2 + abcdp*y endif endif if @degreeq == 0 if @usexy == 2 || @usexy == 6 x1 = 2*(x - aq) elseif @usexy == 3 || @usexy == 7 x1 = x*x - 2*aq*x endif if @useyx == 2 || @useyx == 6 y1 = 2*(y - aq) elseif @useyx == 3 || @useyx == 7 y1 = y*y - 2*aq*y endif elseif @degreeq == 1 if @usexy == 2 || @usexy == 6 x1 = 3*(x - aq)*(x - bq) elseif @usexy == 3 || @usexy == 7 x1 = x^3 - apbq*x^2 + abq*x endif if @useyx == 2 || @useyx == 6 y1 = 3*(y - aq)*(y - bq) elseif @useyx == 3 || @useyx == 7 y1 = y^3 - apbq*y^2 + abq*y endif elseif @degreeq == 2 if @usexy == 2 || @usexy == 6 x1 = 4*(x - aq)*(x - bq)*(x - cq) elseif @usexy == 3 || @usexy == 7 x1 = x^4 - apbpcq*x^3 + abpacpbcq*x^2 - abcq*x endif if @useyx == 2 || @useyx == 6 y1 = 4*(y - aq)*(y - bq)*(y - cq) elseif @useyx == 3 || @useyx == 7 y1 = y^4 - apbpcq*y^3 + abpacpbcq*y^2 - abcq*y endif elseif @degreeq == 3 if @usexy == 2 || @usexy == 6 x1 = 5*(x - aq)*(x - bq)*(x - cq)*(x - dq) elseif @usexy == 3 || @usexy == 7 x1 = x^5 - apbpcpdq*x^4 + abpacpadpbcpbdpcdq*x^3 \ - abcpabdpacdpbcdq*x^2 + abcdq*x endif if @useyx == 2 || @useyx == 6 y1 = 5*(y - aq)*(y - bq)*(y - cq)*(y - dq) elseif @useyx == 3 || @useyx == 7 y1 = y^5 - apbpcpdq*y^4 + abpacpadpbcpbdpcdq*y^3 \ - abcpabdpacdpbcdq*y^2 + abcdq*y endif endif if @degreep == 0 if @usexx == 0 || @usexx == 4 x = 2*(x - ap) elseif @usexx == 1 || @usexx == 5 x = x*x - 2*ap*x endif if @useyy == 0 || @useyy == 4 y = 2*(y - ap) elseif @useyy == 1 || @useyy == 5 y = y*y - 2*ap*y endif elseif @degreep == 1 if @usexx == 0 || @usexx == 4 x = 3*(x - ap)*(x - bp) elseif @usexx == 1 || @usexx == 5 x = x^3 - apbp*x^2 + abp*x endif if @useyy == 0 || @useyy == 4 y = 3*(y - ap)*(y - bp) elseif @useyy == 1 || @useyy == 5 y = y^3 - apbp*y^2 + abp*y endif elseif @degreep == 2 if @usexx == 0 || @usexx == 4 x = 4*(x - ap)*(x - bp)*(x - cp) elseif @usexx == 1 || @usexx == 5 x = x^4 - apbpcp*x^3 + abpacpbcp*x^2 - abcp*x endif if @useyy == 0 || @useyy == 4 y = 4*(y - ap)*(y - bp)*(y - cp) elseif @useyy == 1 || @useyy == 5 y = y^4 - apbpcp*y^3 + abpacpbcp*y^2 - abcp*y endif elseif @degreep == 3 if @usexx == 0 || @usexx == 4 x = 5*(x - ap)*(x - bp)*(x - cp)*(x - dp) elseif @usexx == 1 || @usexx == 5 x = x^5 - apbpcpdp*x^4 + abpacpadpbcpbdpcdp*x^3 \ - abcpabdpacdpbcdp*x^2 + abcdp*x endif if @useyy == 0 || @useyy == 4 y = 5*(y - ap)*(y - bp)*(y - cp)*(y - dp) elseif @useyy == 1 || @useyy == 5 y = y^5 - apbpcpdp*y^4 + abpacpadpbcpbdpcdp*y^3 \ - abcpabdpacdpbcdp*y^2 + abcdp*y endif endif if @degreeq== 0 if @usexx == 2 || @usexx == 6 x = 2*(x - aq) elseif @usexx == 3 || @usexx == 7 x = x*x - 2*aq*x endif if @useyy == 2 || @useyy == 6 y = 2*(y - aq) elseif @useyy == 3 || @useyy == 7 y = y*y - 2*aq*y endif elseif @degreeq == 1 if @usexx == 2 || @usexx == 6 x = 3*(x - aq)*(x - bq) elseif @usexx == 3 || @usexx == 7 x = x^3 - apbq*x^2 + abq*x endif if @useyy == 2 || @useyy == 6 y = 3*(y - aq)*(y - bq) elseif @useyy == 3 || @useyy == 7 y = y^3 - apbq*y^2 + abq*y endif elseif @degreeq == 2 if @usexx == 2 || @usexx == 6 x = 4*(x - aq)*(x - bq)*(x - cq) elseif @usexx == 3 || @usexx == 7 x = x^4 - apbpcq*x^3 + abpacpbcq*x^2 - abcq*x endif if @useyy == 2 || @useyy == 6 y = 4*(y - aq)*(y - bq)*(y - cq) elseif @useyy == 3 || @useyy == 7 y = y^4 - apbpcq*y^3 + abpacpbcq*y^2 - abcq*y endif elseif @degreeq == 3 if @usexx == 2 || @usexx == 6 x = 5*(x - aq)*(x - bq)*(x - cq)*(x - dq) elseif @usexx == 3 || @usexx == 7 x = x^5 - apbpcpdq*x^4 + abpacpadpbcpbdpcdq*x^3 \ - abcpabdpacdpbcdq*x^2 + abcdq*x endif if @useyy == 2 || @useyy == 6 y = 5*(y - aq)*(y - bq)*(y - cq)*(y - dq) elseif @useyy == 3 || @useyy == 7 y = y^5 - apbpcpdq*y^4 + abpacpadpbcpbdpcdq*y^3 \ - abcpabdpacdpbcdq*y^2 + abcdq*y endif endif if @usexx > 3 x = -x endif if @useyx > 3 y1 = -y1 endif if @usexy > 3 x1 = -x1 endif if @useyy > 3 y = -y endif if @variant == 0 z = x + y1 + flip(x1 + y) elseif @variant == 1 z = x*y1 + flip(x1*y) elseif @variant == 2 z = real(z)*x + imag(z)*y1 + flip(real(z)*x1 + imag(z)*y) else z = imag(z)*x + real(z)*y1 + flip(imag(z)*x1 + real(z)*y) endif if @extra == 0 if @lambda == 0 z = fn1(z) + p elseif @lambda == 1 z = p*fn1(z) else z = p*(fn1(z) + 1) endif else if @lambda == 0 z = fn1(z*fn2(zold)) + p elseif @lambda == 1 z = p*fn1(z*fn2(zold)) else z = p*(fn1(z*fn2(zold)) + 1) endif endif if @smallbail > 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Not Rotation, Mandelbrot" method = multipass periodicity = 0 center = (0, 0) helpfile = "MMF.html" param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing which may be required \ when using the functions in particular." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param degreep caption = "Degree of p'()" default = 0 enum = "Linear" "Quadratic" "Cubic" "Quartic" hint = "Sets the number of brackets of the form \ (x or y - real(root)) to be multiplied \ to get p'(), ie. determines the highest \ power of the derivative of p() which will \ therefore be one power higher." endparam param degreeq caption = "Degree of q'()" default = 0 enum = "Linear" "Quadratic" "Cubic" "Quartic" hint = "Sets the number of brackets of the form \ (x or y - real(root)) to be multiplied \ to get q'(), ie. determines the highest \ power of the derivative of q() which will \ therefore be one power higher." endparam param a caption = "First Roots" default = (0,0) hint = "The real part is a root of p'() and the imaginary a \ root of q'(). The real part only has an effect if p'() \ or p() is in use, the imaginary only if q'() or q() \ is in use." endparam param b caption = "Second Roots" default = (0,0) hint = "The real part is a root of p'() if the degree of p'() \ is at least quadratic, the imaginary part is a root \ of q'() if the degree of q'() is at least quadratic. \ The real part only has an effect if p'() or p() \ is in use, the imaginary only if q'() or q() is in use." endparam param c caption = "Third Roots" default = (0,0) hint = "The real part is a root of p'() if the degree of p'() \ is at least cubic, the imaginary part is a root \ of q'() if the degree of q'() is at least cubic. \ The real part only has an effect if p'() or p() \ is in use, the imaginary only if q'() or q() is in use." endparam param d caption = "Fourth Roots" default = (0,0) hint = "The real part is a root of p'() if the degree of p'() \ is quartic, the imaginary part is a root \ of q'() if the degree of q'() is quartic. \ The real part only has an effect if p'() or p() \ is in use, the imaginary only if q'() or q() is in use." endparam param usexx caption = "First function" default = 1 enum = "p'(x)" "p(x)" "q'(x)" "q(x)" "-p'(x)" "-p(x)" "-q'(x)" "-q(x)" hint = "Allows you to choose a() in a(x)+b(y)+flip(c(x)+d(y))." endparam param useyx caption = "Second function" default = 2 enum = "p'(y)" "p(y)" "q'(y)" "q(y)" "-p'(y)" "-p(y)" "-q'(y)" "-q(y)" hint = "Allows you to choose b() in a(x)+b(y)+flip(c(x)+d(y))." endparam param usexy caption = "Third function" default = 0 enum = "p'(x)" "p(x)" "q'(x)" "q(x)" "-p'(x)" "-p(x)" "-q'(x)" "-q(x)" hint = "Allows you to choose c() in a(x)+b(y)+flip(c(x)+d(y))." endparam param useyy caption = "Fourth function" default = 1 enum = "p'(y)" "p(y)" "q'(y)" "q(y)" "-p'(y)" "-p(y)" "-q'(y)" "-q(y)" hint = "Allows you to choose d() in a(x)+b(y)+flip(c(x)+d(y))." endparam param variant caption = "Variation" default = 0 enum = "Original" "Multiply" "'Rotate1'" "'Rotate2'" hint = "Allows you to choose the method of 'not-rotation'. \ Original uses +/-a(x)+/-b(y) + flip(+/-c(x)+/-d(y)), \ Multiply uses +/-a(x)*b(y) + flip(+/-c(x)*d(y)) and \ 'Rotate1' uses +/-x*a(x)+/-y*b(y) + flip(+/-x*c(x)+/-y*d(y)) \ 'Rotate2' uses +/-y*a(x)+/-x*b(y) + flip(+/-y*c(x)+/-x*d(y))" endparam param root caption = "Start z" default = 0 enum = "First Root" "Second Root" "Third Root" "Fourth Root" hint = "Specifies which root to use as Zstart, when a choice \ is available (Degree > Linear)." endparam param lambda caption = "Lambda version" default = 0 enum = "Disabled" "Enabled" "Use c*(f(z)+1)" hint = "If disabled then the normal f(z)+c is used, \ when Enabled the lambda version c*f(z) is used, \ the third option is an interesting alternative." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam func fn1 caption = "Overall function f1" default = ident() hint = "Applied to the whole polynomial ie. as f(z) = f1(p(z))." endfunc param extra caption = "Extra multiply" default = 0 enum = "Disabled" "Enabled" hint = "When enabled p(z) is multiplied by f2(z). Note that \ this will generally alter the highest power of z." endparam func fn2 caption = "Multiply function f2" default = ident() hint = "Only used when Extra multiply is enabled. When in use \ the equation used effectively becomes f(z) = f1(p(z)*f2(z))." endfunc param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration." endparam param t caption = "Translation" default = (0,0) hint = "Translates (moves) the value of z \ on each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param centrej caption = "Julia-switch offset" default = (0,0) hint = "Use this to adjust the position of the Julia set you wish to view \ using the switch function when it's off centre." endparam param scalej caption = "Julia-switch scale" default = 1.0 hint = "Use this adjust the scale of the Julia set you wish to view \ using the switch function when it's too large or too small. \ Use values >1.0 to zoom in and values 0 < v < 1.0 to zoom out." endparam param start caption = "Perturbation" default = (0,0) hint = "Perturbation of Zstart, use to deform the fractal." endparam param centrem caption = "Mandy-switch offset" default = (0,0) hint = "This should normally be (0,0), it should really only be modified \ when adjusting the switched Mandelbrot from the Julia version." endparam param scalem caption = "Mandy-switch scale" default = 1.0 hint = "This should normally be 1.0, it should really only be modified \ when adjusting the switched Mandelbrot from the Julia version." endparam switch: type = "MMFw-JNotRot" seed = #pixel smallbail = smallbail test = test bailout = bailout bailout1 = bailout1 degreep = degreep degreeq = degreeq a = a b = b c = c d = d usexx = usexx useyx = useyx usexy = usexy useyy = useyy variant = variant root = root lambda = lambda sigma = sigma product = product fn1 = fn1 extra = extra fn2 = fn2 selfrot = selfrot ang = ang t = t m = m n = n centrem = centrem scalem = scalem centrej = centrej scalej = scalej } MMFw-JNotRot { ; ; The idea for this formula came from considering ; the fact that calculating z^2 is effectively rotation ; and scaling of z based on the value of z. ; Since the rotation part of this can be done using the ; 2*2 rotation matrix including sin and cos of atan2(z), ; it struck me that this could be considered (ignoring ; the atan2) as involving two functions and/or their ; derivatives so I decided to try a formula loosely based ; on this idea, the functions being real polynomials - ; ie. a selection from: ; p'(x), p(x), q'(x), q(x) and p'(y), p(y), q'(y), q(y). ; Since the idea is based on rotation I decided to call ; the formula/method "Not Rotation". ; In this case each complex parameter defines two real ; roots, one used to define p'() and one q'(). ; The "complex" formula produced is: ; f(z) = f(x + iy) = +/-a(x)+/-b(y) + i*(+/-c(x)+/-d(y)) ; or (Multiply) = +/-a(x)*b(y) + i*(+/-c(x)*d(y)) ; or ("Rotate1") = +/-x*a(x)+/-y*b(y) ; + i*(+/-x*c(x)+/-y*d(y)) ; or ("Rotate2") = +/-y*a(x)+/-x*b(y) ; + i*(+/-y*c(x)+/-x*d(y)) ; where a(x) and c(x) each may be defined as p(x), p'(x), ; q(x) or q'(x), similarly b(y) and d(y) each may be ; defined as p(y), p'(y), q(y) or q'(y). ; Note that the Rotate1 version simply raises the powers of ; the polynomials used by one - meaning there is no longer ; a constant term when using p'() or q'(). ; Also note that the derivatives have been scaled so ; the highest powers in p() and q() each have ; coefficients of 1. ; Options for the "self-rotation" of z by atan2(z), ; and/or the transformation of z by a fixed rotation ; and/or by a fixed matrix and/or by a translation ; have been included, the value of z being transformed ; at the start of each iteration. ; The self-rotation transformation (when enabled) ; rotates z by the angle atan2(z) using ; rot(z)=z*z/cabs(z) and is applied prior to the ; fixed transforms. ; There are also options to multiply the result of f(z) ; by another function of z and/or apply a post-function ; before the result is used in the normal manner or using ; one of the lambda-style variations. ; ; Please note that in the definition of p(z) below the ; roots specified are the real part of the parameters, ; q'(z) and q(z) are defined in the same manner using ; the imaginary parts of the parameters. ; Consider z here as being either x or y. ; The possibilities for the polynomials are: ; ; Degree 1: ; Derivative: (a = first root) ; p'(z) = 2*(z - a) = 2*z - 2*a ; Integral: ; p(z) = z^2 - 2*az ; ; Degree 2: ; Derivative: (b = second root) ; p'(z) = 3*(z-a)(z-b) = 3*z^2 - 3*(a+b)z + 3*ab ; Integral (*3): ; p(z) = z^3 - 3*(a+b)(z^2)/2 + 3*abz ; ; Degree 3: ; Derivative: (c = third root) ; p'(z) = 4*(z-a)(z-b)(z-c) ; = 4*z^3 - 4*(a+b+c)(z^2) + 4*(ab+ac+bc)z - 4*abc ; Integral (*4): ; p(z) = z^4 - 4*(a+b+c)(z^3)/3 + 2*(ab+ac+bc)(z^2) - 4*abcz ; ; Degree 4: ; Derivative: (d = fourth root) ; p'(z) = 5*(z-a)(z-b)(z-c)(z-d) ; = 5*z^4 - 5*(a+b+c+d)(z^3) + 5*(ab+ac+ad+bc+bd+cd)(z^2) - 5*(abc+abd+acd+bcd)z + 5*abcd ; Integral (*5): ; p(z) = ; z^5 - 5*(a+b+c+d)(z^4)/4 + 5*(ab+ac+ad+bc+bd+cd)(z^3)/3 - 5*(abc+abd+acd+bcd)(z^2)/2 + 5*abcdz ; ; "Iterate the product" added 6th April 2002 ; The option to "iterate the sum" added 11th August 2001 ; Multiply and "rotate" variants added 30th April 2001 ; Split into p() and q() 29th April 2001 ; Created 28th April 2001 ; ; Copyright 2001 Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel complex zold = z complex zs = (0,0) complex zp = (1,0) float x = real(z) float y = imag(z) float t = x float x1 = x float y1 = y float ap = real(@a) float aq = imag(@a) float bp = real(@b) float bq = imag(@b) float cp = real(@c) float cq = imag(@c) float dp = real(@d) float dq = imag(@d) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca ; float twodpi = 2/#pi bool bail = true if @scalej != 1.0 z = z/@scalej endif if @centrej != (0,0) z = z + @centrej endif if @usexy == 1 || @usexx == 1 || @useyx == 1 || @useyy == 1 \ || @usexy == 5 || @usexx == 5 || @useyx == 5 || @useyy == 5 if @degreep == 1 float apbp = 3*(ap + bp)/2 float abp = 3*ap*bp elseif @degreep == 2 float apbpcp = 4*(ap + bp + cp)/3 float abpacpbcp = 2*(ap*(bp+cp) + bp*cp) float abcp = 4*ap*bp*cp elseif @degreep == 3 float cpdp = cp + dp float cdp = cp*dp float apbpcpdp = 5*(ap + bp + cpdp)/4 float abpacpadpbcpbdpcdp = 5*(ap*(bp+cpdp) + bp*(cpdp) + cdp)/3 float abcpabdpacdpbcdp = 5*(ap*bp*cpdp + cdp*(ap+bp))/2 float abcdp = 5*ap*bp*cdp endif endif if @usexy == 3 || @usexx == 3 || @useyx == 3 || @useyy == 3 \ || @usexy == 7 || @usexx == 7 || @useyx == 7 || @useyy == 7 if @degreeq == 1 float apbq = 3*(aq + bq)/2 float abq = 3*aq*bq elseif @degreeq == 2 float apbpcq = 4*(aq + bq + cq)/3 float abpacpbcq = 2*(aq*(bq+cq) + bq*cq) float abcq = 4*aq*bq*cq elseif @degreeq == 3 float cpdq = cq + dq float cdq = cq*dq float apbpcpdq = 5*(aq + bq + cpdq)/4 float abpacpadpbcpbdpcdq = 5*(aq*(bq+cpdq) + bq*(cpdq) + cdq)/3 float abcpabdpacdpbcdq = 5*(aq*bq*cpdq + cdq*(aq+bq))/2 float abcdq = 5*aq*bq*cdq endif endif loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif if @selfrot > 0 ; z = z * (0,1)^(twodpi*atan2(z)) t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + @seed endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @t x = real(z) y = imag(z) if @degreep == 0 if @usexy == 0 || @usexy == 4 x1 = 2*(x - ap) elseif @usexy == 1 || @usexy == 5 x1 = x*x - 2*ap*x endif if @useyx == 0 || @useyx == 4 y1 = 2*(y - ap) elseif @useyx == 1 || @useyx == 5 y1 = y*y - 2*ap*y endif elseif @degreep == 1 if @usexy == 0 || @usexy == 4 x1 = 3*(x - ap)*(x - bp) elseif @usexy == 1 || @usexy == 5 x1 = x^3 - apbp*x^2 + abp*x endif if @useyx == 0 || @useyx == 4 y1 = 3*(y - ap)*(y - bp) elseif @useyx == 1 || @useyx == 5 y1 = y^3 - apbp*y^2 + abp*y endif elseif @degreep == 2 if @usexy == 0 || @usexy == 4 x1 = 4*(x - ap)*(x - bp)*(x - cp) elseif @usexy == 1 || @usexy == 5 x1 = x^4 - apbpcp*x^3 + abpacpbcp*x^2 - abcp*x endif if @useyx == 0 || @useyx == 4 y1 = 4*(y - ap)*(y - bp)*(y - cp) elseif @useyx == 1 || @useyx == 5 y1 = y^4 - apbpcp*y^3 + abpacpbcp*y^2 - abcp*y endif elseif @degreep == 3 if @usexy == 0 || @usexy == 4 x1 = 5*(x - ap)*(x - bp)*(x - cp)*(x - dp) elseif @usexy == 1 || @usexy == 5 x1 = x^5 - apbpcpdp*x^4 + abpacpadpbcpbdpcdp*x^3 \ - abcpabdpacdpbcdp*x^2 + abcdp*x endif if @useyx == 0 || @useyx == 4 y1 = 5*(y - ap)*(y - bp)*(y - cp)*(y - dp) elseif @useyx == 1 || @useyx == 5 y1 = y^5 - apbpcpdp*y^4 + abpacpadpbcpbdpcdp*y^3 \ - abcpabdpacdpbcdp*y^2 + abcdp*y endif endif if @degreeq == 0 if @usexy == 2 || @usexy == 6 x1 = 2*(x - aq) elseif @usexy == 3 || @usexy == 7 x1 = x*x - 2*aq*x endif if @useyx == 2 || @useyx == 6 y1 = 2*(y - aq) elseif @useyx == 3 || @useyx == 7 y1 = y*y - 2*aq*y endif elseif @degreeq == 1 if @usexy == 2 || @usexy == 6 x1 = 3*(x - aq)*(x - bq) elseif @usexy == 3 || @usexy == 7 x1 = x^3 - apbq*x^2 + abq*x endif if @useyx == 2 || @useyx == 6 y1 = 3*(y - aq)*(y - bq) elseif @useyx == 3 || @useyx == 7 y1 = y^3 - apbq*y^2 + abq*y endif elseif @degreeq == 2 if @usexy == 2 || @usexy == 6 x1 = 4*(x - aq)*(x - bq)*(x - cq) elseif @usexy == 3 || @usexy == 7 x1 = x^4 - apbpcq*x^3 + abpacpbcq*x^2 - abcq*x endif if @useyx == 2 || @useyx == 6 y1 = 4*(y - aq)*(y - bq)*(y - cq) elseif @useyx == 3 || @useyx == 7 y1 = y^4 - apbpcq*y^3 + abpacpbcq*y^2 - abcq*y endif elseif @degreeq == 3 if @usexy == 2 || @usexy == 6 x1 = 5*(x - aq)*(x - bq)*(x - cq)*(x - dq) elseif @usexy == 3 || @usexy == 7 x1 = x^5 - apbpcpdq*x^4 + abpacpadpbcpbdpcdq*x^3 \ - abcpabdpacdpbcdq*x^2 + abcdq*x endif if @useyx == 2 || @useyx == 6 y1 = 5*(y - aq)*(y - bq)*(y - cq)*(y - dq) elseif @useyx == 3 || @useyx == 7 y1 = y^5 - apbpcpdq*y^4 + abpacpadpbcpbdpcdq*y^3 \ - abcpabdpacdpbcdq*y^2 + abcdq*y endif endif if @degreep == 0 if @usexx == 0 || @usexx == 4 x = 2*(x - ap) elseif @usexx == 1 || @usexx == 5 x = x*x - 2*ap*x endif if @useyy == 0 || @useyy == 4 y = 2*(y - ap) elseif @useyy == 1 || @useyy == 5 y = y*y - 2*ap*y endif elseif @degreep == 1 if @usexx == 0 || @usexx == 4 x = 3*(x - ap)*(x - bp) elseif @usexx == 1 || @usexx == 5 x = x^3 - apbp*x^2 + abp*x endif if @useyy == 0 || @useyy == 4 y = 3*(y - ap)*(y - bp) elseif @useyy == 1 || @useyy == 5 y = y^3 - apbp*y^2 + abp*y endif elseif @degreep == 2 if @usexx == 0 || @usexx == 4 x = 4*(x - ap)*(x - bp)*(x - cp) elseif @usexx == 1 || @usexx == 5 x = x^4 - apbpcp*x^3 + abpacpbcp*x^2 - abcp*x endif if @useyy == 0 || @useyy == 4 y = 4*(y - ap)*(y - bp)*(y - cp) elseif @useyy == 1 || @useyy == 5 y = y^4 - apbpcp*y^3 + abpacpbcp*y^2 - abcp*y endif elseif @degreep == 3 if @usexx == 0 || @usexx == 4 x = 5*(x - ap)*(x - bp)*(x - cp)*(x - dp) elseif @usexx == 1 || @usexx == 5 x = x^5 - apbpcpdp*x^4 + abpacpadpbcpbdpcdp*x^3 \ - abcpabdpacdpbcdp*x^2 + abcdp*x endif if @useyy == 0 || @useyy == 4 y = 5*(y - ap)*(y - bp)*(y - cp)*(y - dp) elseif @useyy == 1 || @useyy == 5 y = y^5 - apbpcpdp*y^4 + abpacpadpbcpbdpcdp*y^3 \ - abcpabdpacdpbcdp*y^2 + abcdp*y endif endif if @degreeq== 0 if @usexx == 2 || @usexx == 6 x = 2*(x - aq) elseif @usexx == 3 || @usexx == 7 x = x*x - 2*aq*x endif if @useyy == 2 || @useyy == 6 y = 2*(y - aq) elseif @useyy == 3 || @useyy == 7 y = y*y - 2*aq*y endif elseif @degreeq == 1 if @usexx == 2 || @usexx == 6 x = 3*(x - aq)*(x - bq) elseif @usexx == 3 || @usexx == 7 x = x^3 - apbq*x^2 + abq*x endif if @useyy == 2 || @useyy == 6 y = 3*(y - aq)*(y - bq) elseif @useyy == 3 || @useyy == 7 y = y^3 - apbq*y^2 + abq*y endif elseif @degreeq == 2 if @usexx == 2 || @usexx == 6 x = 4*(x - aq)*(x - bq)*(x - cq) elseif @usexx == 3 || @usexx == 7 x = x^4 - apbpcq*x^3 + abpacpbcq*x^2 - abcq*x endif if @useyy == 2 || @useyy == 6 y = 4*(y - aq)*(y - bq)*(y - cq) elseif @useyy == 3 || @useyy == 7 y = y^4 - apbpcq*y^3 + abpacpbcq*y^2 - abcq*y endif elseif @degreeq == 3 if @usexx == 2 || @usexx == 6 x = 5*(x - aq)*(x - bq)*(x - cq)*(x - dq) elseif @usexx == 3 || @usexx == 7 x = x^5 - apbpcpdq*x^4 + abpacpadpbcpbdpcdq*x^3 \ - abcpabdpacdpbcdq*x^2 + abcdq*x endif if @useyy == 2 || @useyy == 6 y = 5*(y - aq)*(y - bq)*(y - cq)*(y - dq) elseif @useyy == 3 || @useyy == 7 y = y^5 - apbpcpdq*y^4 + abpacpadpbcpbdpcdq*y^3 \ - abcpabdpacdpbcdq*y^2 + abcdq*y endif endif if @usexx > 3 x = -x endif if @useyx > 3 y1 = -y1 endif if @usexy > 3 x1 = -x1 endif if @useyy > 3 y = -y endif if @variant == 0 z = x + y1 + flip(x1 + y) elseif @variant == 1 z = x*y1 + flip(x1*y) elseif @variant == 2 z = real(z)*x + imag(z)*y1 + flip(real(z)*x1 + imag(z)*y) else z = imag(z)*x + real(z)*y1 + flip(imag(z)*x1 + real(z)*y) endif if @extra == 0 if @lambda == 0 z = fn1(z) + @seed elseif @lambda == 1 z = @seed*fn1(z) else z = @seed*(fn1(z) + 1) endif else if @lambda == 0 z = fn1(z*fn2(zold)) + @seed elseif @lambda == 1 z = @seed*fn1(z*fn2(zold)) else z = @seed*(fn1(z*fn2(zold)) + 1) endif endif if @smallbail > 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Not Rotation, Julia" method = multipass periodicity = 0 center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (-0.0375,0.75) hint = "Modify for different Julia sets." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing which may be required \ when using the functions in particular." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Julia set anymore." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param degreep caption = "Degree of p'()" default = 0 enum = "Linear" "Quadratic" "Cubic" "Quartic" hint = "Sets the number of brackets of the form \ (x or y - real(root)) to be multiplied \ to get p'(), ie. determines the highest \ power of the derivative of p() which will \ therefore be one power higher." endparam param degreeq caption = "Degree of q'()" default = 0 enum = "Linear" "Quadratic" "Cubic" "Quartic" hint = "Sets the number of brackets of the form \ (x or y - real(root)) to be multiplied \ to get q'(), ie. determines the highest \ power of the derivative of q() which will \ therefore be one power higher." endparam param a caption = "First Roots" default = (0,0) hint = "The real part is a root of p'() and the imaginary a \ root of q'(). The real part only has an effect if p'() \ or p() is in use, the imaginary only if q'() or q() \ is in use." endparam param b caption = "Second Roots" default = (0,0) hint = "The real part is a root of p'() if the degree of p'() \ is at least quadratic, the imaginary part is a root \ of q'() if the degree of q'() is at least quadratic. \ The real part only has an effect if p'() or p() \ is in use, the imaginary only if q'() or q() is in use." endparam param c caption = "Third Roots" default = (0,0) hint = "The real part is a root of p'() if the degree of p'() \ is at least cubic, the imaginary part is a root \ of q'() if the degree of q'() is at least cubic. \ The real part only has an effect if p'() or p() \ is in use, the imaginary only if q'() or q() is in use." endparam param d caption = "Fourth Roots" default = (0,0) hint = "The real part is a root of p'() if the degree of p'() \ is quartic, the imaginary part is a root \ of q'() if the degree of q'() is quartic. \ The real part only has an effect if p'() or p() \ is in use, the imaginary only if q'() or q() is in use." endparam param usexx caption = "First function" default = 1 enum = "p'(x)" "p(x)" "q'(x)" "q(x)" "-p'(x)" "-p(x)" "-q'(x)" "-q(x)" hint = "Allows you to choose a() in a(x)+b(y)+flip(c(x)+d(y))." endparam param useyx caption = "Second function" default = 2 enum = "p'(y)" "p(y)" "q'(y)" "q(y)" "-p'(y)" "-p(y)" "-q'(y)" "-q(y)" hint = "Allows you to choose b() in a(x)+b(y)+flip(c(x)+d(y))." endparam param usexy caption = "Third function" default = 0 enum = "p'(x)" "p(x)" "q'(x)" "q(x)" "-p'(x)" "-p(x)" "-q'(x)" "-q(x)" hint = "Allows you to choose c() in a(x)+b(y)+flip(c(x)+d(y))." endparam param useyy caption = "Fourth function" default = 1 enum = "p'(y)" "p(y)" "q'(y)" "q(y)" "-p'(y)" "-p(y)" "-q'(y)" "-q(y)" hint = "Allows you to choose d() in a(x)+b(y)+flip(c(x)+d(y))." endparam param variant caption = "Variation" default = 0 enum = "Original" "Multiply" "'Rotate1'" "'Rotate2'" hint = "Allows you to choose the method of 'not-rotation'. \ Original uses +/-a(x)+/-b(y) + flip(+/-c(x)+/-d(y)), \ Multiply uses +/-a(x)*b(y) + flip(+/-c(x)*d(y)) and \ 'Rotate1' uses +/-x*a(x)+/-y*b(y) + flip(+/-x*c(x)+/-y*d(y)) \ 'Rotate2' uses +/-y*a(x)+/-x*b(y) + flip(+/-y*c(x)+/-x*d(y))" endparam param lambda caption = "Lambda version" default = 0 enum = "Disabled" "Enabled" "Use c*(f(z)+1)" hint = "If disabled then the normal f(z)+c is used, \ when enabled the lambda version c*f(z) is used, \ the third option is an interesting alternative." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam func fn1 caption = "Overall function f1" default = ident() hint = "Applied to the whole polynomial ie. as f(z) = f1(p(z))." endfunc param extra caption = "Extra multiply" default = 0 enum = "Disabled" "Enabled" hint = "When enabled p(z) is multiplied by f2(z). Note that \ this will generally alter the highest power of z." endparam func fn2 caption = "Multiply function f2" default = ident() hint = "Only used when Extra multiply is enabled. When in use \ the equation used effectively becomes f(z) = f1(p(z)*f2(z))." endfunc param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds the seed to the rotated value, it's \ only here as it produces some interesting results." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration." endparam param t caption = "Translation" default = (0,0) hint = "Translates (moves) the value of z \ on each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param centrem caption = "Mandy-switch offset" default = (0,0) hint = "Use this to adjust the position of the Mandelbrot set you wish to view \ using the switch function when it's off centre." endparam param scalem caption = "Mandy-switch scale" default = 1.0 hint = "Use this adjust the scale of the Mandelbrot set you wish to view \ using the switch function when it's too large or too small. \ Use values >1.0 to zoom in and values 0 < v < 1.0 to zoom out." endparam param root caption = "Start Z (switch)" default = 0 enum = "First Root" "Second Root" "Third Root" "Fourth Root" hint = "Specifies which root to use as Zstart in the switched \ Mandelbrot version, when a choice is available \ (Degree > Linear). Modifying this parameter will not \ affect the Julia set, it will modify the Mandelbrot on \ the switch tool." endparam param centrej caption = "Julia-switch offset" default = (0,0) hint = "This should normally be (0,0), it should really only be modified \ when adjusting the switched Julia from the Mandelbrot version." endparam param scalej caption = "Julia-switch scale" default = 1.0 hint = "This should normally be 1.0, it should really only be modified \ when adjusting the switched Julia from the Mandelbrot version." endparam switch: type = "MMFw-MNotRot" start = #pixel smallbail = smallbail test = test bailout = bailout bailout1 = bailout1 degreep = degreep degreeq = degreeq a = a b = b c = c d = d usexx = usexx useyx = useyx usexy = usexy useyy = useyy variant = variant lambda = lambda sigma = sigma product = product fn1 = fn1 extra = extra fn2 = fn2 selfrot = selfrot ang = ang t = t m = m n = n root = root centrem = centrem scalem = scalem centrej = centrej scalej = scalej } MMFx-FxyGxyM { ; ; This formula came about when I was trying to ; derive the constants in: ; P = (ax+by+c)(dx+ey+f)(gx+hy+i) ; given 9 points P(x,y) and I suddenly thought ; that equations of the above form applied as ; z = (F(x,y) G(x,y)) may give interesting ; fractals - why stick to complex numbers only ? ; ; "Iterate the product" added 6th April 2002 ; Mu/Lambda options, presets and overall function ; added 12th August 2001 ; The option to "iterate the sum" added 11th August 2001 ; Created 31st March 2001 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = @start float x = real(z) float y = imag(z) float t = 0 float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca float tx = x float ty = y complex zold = z complex zs = (0,0) complex zp = (1,0) bool bail = true complex a1 = 0 complex b1 = 0 complex c1 = 0 complex a2 = 0 complex b2 = 0 complex c2 = 0 complex a3 = 0 complex b3 = 0 complex c3 = 0 complex a4 = 0 complex b4 = 0 complex c4 = 0 complex a5 = 0 complex b5 = 0 complex c5 = 0 complex a6 = 0 complex b6 = 0 complex c6 = 0 if @usepreset == false a1 = @a1 b1 = @b1 c1 = @c1 if @degree > 0 a2 = @a2 b2 = @b2 c2 = @c2 endif if @degree > 1 a3 = @a3 b3 = @b3 c3 = @c3 endif if @degree > 2 a4 = @a4 b4 = @b4 c4 = @c4 endif if @degree > 3 a5 = @a5 b5 = @b5 c5 = @c5 endif if @degree > 4 a6 = @a6 b6 = @b6 c6 = @c6 endif else if @degree == 0 a1 = @a1 b1 = @b1 c1 = @c1 elseif @degree == 1 a1 = @a1+1+flip(2) b1 = @b1+1 c1 = @c1 a2 = @a2+1 b2 = @b2-1+flip(1) c2 = @c2 elseif @degree == 2 float r3 = sqrt(3) a1 = @a1+1 b1 = @b1+flip(1) c1 = @c1 a2 = @a2+1+flip(r3) b2 = @b2+r3+flip(1) c2 = @c2 a3 = @a3+1+flip(r3) b3 = @b3-r3-flip(1) c3 = @c3 elseif @degree == 3 float a = sqrt(sqrt(3+2*sqrt(2))) float b = 1/a a1 = @a1+a+flip(2) b1 = @b1+b c1 = @c1 a2 = @a2+a b2 = @b2-b+flip(2) c2 = @c2 a3 = @a3+b+flip(1) b3 = @b3+a+flip(1) c3 = @c3 a4 = @a4+b+flip(1) b4 = @b4-a-flip(1) c4 = @c4 elseif @degree == 4 float qr5 = sqrt(sqrt(5)) float a = sqrt(2+sqrt(5)) float b = 1/a a1 = @a1+1 b1 = @b1+flip(1) c1 = @c1 a2 = @a2+a+flip(qr5) b2 = @b2+qr5+flip(a) c2 = @c2 a3 = @a3+a+flip(qr5) b3 = @b3-qr5-flip(a) c3 = @c3 a4 = @a4+b+flip(qr5) b4 = @b4+qr5+flip(b) c4 = @c4 a5 = @a5+b+flip(qr5) b5 = @b5-qr5-flip(b) c5 = @c5 elseif @degree == 5 float r3 = sqrt(3) float a = 2+r3 float b = 1/a a1 = @a1+1+flip(2) b1 = @b1+1 c1 = @c1 a2 = @a2+1 b2 = @b2-1+flip(1) c2 = @c2 a3 = @a3+1+flip(r3) b3 = @b3+a+flip(1) c3 = @c3 a4 = @a4+1+flip(r3) b4 = @b4-a-flip(1) c4 = @c4 a5 = @a5+1+flip(1) b5 = @b5+b+flip(r3) c5 = @c5 a6 = @a6+1+flip(1) b6 = @b6-b-flip(r3) c6 = @c6 endif endif loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif if @selfrot > 0 ; z = z * (0,1)^(twodpi*atan2(z)) t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @t x = real(z) y = imag(z) tx = x ty = y if @pix == 1 x = real(a1)*tx + real(b1)*ty + real(#pixel) y = imag(a1)*tx + imag(b1)*ty + imag(#pixel) else x = real(a1)*tx + real(b1)*ty + real(c1) y = imag(a1)*tx + imag(b1)*ty + imag(c1) endif if @degree > 0 if @pix == 2 x = x*(real(a2)*tx + real(b2)*ty + real(#pixel)) y = y*(imag(a2)*tx + imag(b2)*ty + imag(#pixel)) else x = x*(real(a2)*tx + real(b2)*ty + real(c2)) y = y*(imag(a2)*tx + imag(b2)*ty + imag(c2)) endif endif if @degree > 1 if @pix == 3 x = x*(real(a3)*tx + real(b3)*ty + real(#pixel)) y = y*(imag(a3)*tx + imag(b3)*ty + imag(#pixel)) else x = x*(real(a3)*tx + real(b3)*ty + real(c3)) y = y*(imag(a3)*tx + imag(b3)*ty + imag(c3)) endif endif if @degree > 2 if @pix == 4 x = x*(real(a4)*tx + real(b4)*ty + real(#pixel)) y = y*(imag(a4)*tx + imag(b4)*ty + imag(#pixel)) else x = x*(real(a4)*tx + real(b4)*ty + real(c4)) y = y*(imag(a4)*tx + imag(b4)*ty + imag(c4)) endif endif if @degree > 3 if @pix == 5 x = x*(real(a5)*tx + real(b5)*ty + real(#pixel)) y = y*(imag(a5)*tx + imag(b5)*ty + imag(#pixel)) else x = x*(real(a5)*tx + real(b5)*ty + real(c5)) y = y*(imag(a5)*tx + imag(b5)*ty + imag(c5)) endif endif if @degree > 4 if @pix == 6 x = x*(real(a6)*tx + real(b6)*ty + real(#pixel)) y = y*(imag(a6)*tx + imag(b6)*ty + imag(#pixel)) else x = x*(real(a6)*tx + real(b6)*ty + real(c6)) y = y*(imag(a6)*tx + imag(b6)*ty + imag(c6)) endif endif if @lambda==0 && (@pix == 0 || @pix > @degree+1) z = fn1(x+flip(y)) + #pixel elseif @lambda == 0 z = fn1(x+flip(y)) elseif @lambda == 1 z = #pixel*fn1(x+flip(y)) + @v elseif @lambda == 2 z = #pixel*(fn1(x+flip(y)) + @v) elseif @lambda == 3 z = fn1(x+flip(y)) + 1/#pixel + @v elseif @lambda == 4 z = (1/#pixel + @v1)*fn1(x+flip(y)) + @v elseif @lambda == 5 z = fn1(x+flip(y)) + 1/#pixel + #pixel + @v else z = (1/#pixel + #pixel + @v1)*fn1(x+flip(y)) + @v endif if @smallbail > 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "F(xy),G(xy)#1, Mandelbrot" method = multipass periodicity = 0 center = (-.5, 0) helpfile = "MMF.html" param start caption = "Starting point" default = (0,0) hint = "Perturbation of start Z, use to deform the fractal." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param degree caption = "Highest powers in x and y" default = 1 enum = "1" "2" "3" "4" "5" "6" hint = "Sets the number of brackets of the form \ (ax+by+c) to be multiplied in the formula." endparam param usepreset caption = "Complex presets" default = false hint = "If enabled then coefficient parameters of zero will \ produce the standard z^n+c fractal where n is the \ selected highest power. Small variations applied as \ the coefficient parameters produce interesting results." endparam param pix caption = "Use of #pixel" default = 0 enum = "Extra constant" "First bracket" "Second bracket" \ "Third bracket" "Fourth bracket" "Fifth bracket" "Sixth bracket" hint = "If set as the Extra constant then the pixel value is simply \ added to the newly calculated z value, otherwise it is used to \ replace the constant in the specified bracket." endparam param a1 caption = "A1" default = (0,0) hint = "The constant A in the first bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b1 caption = "B1" default = (0,0) hint = "The constant B in the first bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c1 caption = "C1" default = (0,0) hint = "The constant C in the first bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param a2 caption = "A2" default = (0,0) hint = "The constant A in the second bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b2 caption = "B2" default = (0,0) hint = "The constant B in the second bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c2 caption = "C2" default = (0,0) hint = "The constant C in the second bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param a3 caption = "A3" default = (0,0) hint = "The constant A in the third bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b3 caption = "B3" default = (0,0) hint = "The constant B in the third bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c3 caption = "C3" default = (0,0) hint = "The constant C in the third bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param a4 caption = "A4" default = (0,0) hint = "The constant A in the fourth bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b4 caption = "B4" default = (0,0) hint = "The constant B in the fourth bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c4 caption = "C4" default = (0,0) hint = "The constant C in the fourth bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param a5 caption = "A5" default = (0,0) hint = "The constant A in the fifth bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b5 caption = "B5" default = (0,0) hint = "The constant B in the fifth bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c5 caption = "C5" default = (0,0) hint = "The constant C in the fifth bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param a6 caption = "A6" default = (0,0) hint = "The constant A in the sixth bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b6 caption = "B6" default = (0,0) hint = "The constant B in the sixth bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c6 caption = "C6" default = (0,0) hint = "The constant C in the sixth bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds the seed to the rotated value, it's \ only here as it produces some interesting results." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration." endparam param t caption = "Translation" default = (0,0) hint = "Translates (moves) the value of z \ on each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param lambda caption = "Mu/Lambda version" default = 0 enum = "f(z)+c" "c*f(z)+v" "c*(f(z)+v)" "f(z)+1/c+v" \ "(1/c+v1)*f(z)+v" "f(z)+1/c+c+v" "(1/c+c+v1)*f(z)+v" hint = "Mu as f(z)+c, Lambda as c*f(z)+v or c*(f(z)+v), \ inverted Mu as f(z)+1/c+v, inverted Lambda as \ (1/c+v1)*f(z)+v plus inverted Mu as f(z)+1/c+c+v \ and inverted Lambda as (1/c+c+v1)*f(z)+v." endparam param v caption = "Mu/Lambda v" default = (0,0) hint = "Sets the value of v as used by some of the Mu/Lambda versions." endparam param v1 caption = "Mu/Lambda v1" default = (0,0) hint = "Sets the value of v1 as used by some of the Mu/Lambda versions." endparam func fn1 caption = "Overall function f1" default = ident() hint = "Applied to the z value after calculation of F(x,y) and G(x,y)." endfunc switch: type = "MMFx-FxyGxyJ" seed = #pixel smallbail = smallbail test = test bailout = bailout bailout1 = bailout1 sigma = sigma product = product degree = degree usepreset = usepreset pix = pix a1 = a1 b1 = b1 c1 = c1 a2 = a2 b2 = b2 c2 = c2 a3 = a3 b3 = b3 c3 = c3 a4 = a4 b4 = b4 c4 = c4 a5 = a5 b5 = b5 c5 = c5 a6 = a6 b6 = b6 c6 = c6 selfrot = selfrot ang = ang t = t m = m n = n lambda = lambda v = v v1 = v1 fn1 = fn1 } MMFx-FxyGxyJ { ; ; This formula came about when I was trying to ; derive the constants in: ; P = (ax+by+c)(dx+ey+f)(gx+hy+i) ; given 9 points P(x,y) and I suddenly thought ; that equations of the above form applied as ; z = (F(x,y) G(x,y)) may give interesting ; fractals - why stick to complex numbers only ? ; ; "Iterate the product" added 6th April 2002 ; Mu/Lambda options, presets and overall function ; added 12th August 2001 ; The option to "iterate the sum" added 11th August 2001 ; Created 31st March 2001 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel float x = real(z) float y = imag(z) float t = 0 float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca float tx = x float ty = y complex zold = z complex zs = (0,0) complex zp = (1,0) bool bail = true complex a1 = 0 complex b1 = 0 complex c1 = 0 complex a2 = 0 complex b2 = 0 complex c2 = 0 complex a3 = 0 complex b3 = 0 complex c3 = 0 complex a4 = 0 complex b4 = 0 complex c4 = 0 complex a5 = 0 complex b5 = 0 complex c5 = 0 complex a6 = 0 complex b6 = 0 complex c6 = 0 if @usepreset == false a1 = @a1 b1 = @b1 c1 = @c1 if @degree > 0 a2 = @a2 b2 = @b2 c2 = @c2 endif if @degree > 1 a3 = @a3 b3 = @b3 c3 = @c3 endif if @degree > 2 a4 = @a4 b4 = @b4 c4 = @c4 endif if @degree > 3 a5 = @a5 b5 = @b5 c5 = @c5 endif if @degree > 4 a6 = @a6 b6 = @b6 c6 = @c6 endif else if @degree == 0 a1 = @a1 b1 = @b1 c1 = @c1 elseif @degree == 1 a1 = @a1+1+flip(2) b1 = @b1+1 c1 = @c1 a2 = @a2+1 b2 = @b2-1+flip(1) c2 = @c2 elseif @degree == 2 float r3 = sqrt(3) a1 = @a1+1 b1 = @b1+flip(1) c1 = @c1 a2 = @a2+1+flip(r3) b2 = @b2+r3+flip(1) c2 = @c2 a3 = @a3+1+flip(r3) b3 = @b3-r3-flip(1) c3 = @c3 elseif @degree == 3 float a = sqrt(sqrt(3+2*sqrt(2))) float b = 1/a a1 = @a1+a+flip(2) b1 = @b1+b c1 = @c1 a2 = @a2+a b2 = @b2-b+flip(2) c2 = @c2 a3 = @a3+b+flip(1) b3 = @b3+a+flip(1) c3 = @c3 a4 = @a4+b+flip(1) b4 = @b4-a-flip(1) c4 = @c4 elseif @degree == 4 float qr5 = sqrt(sqrt(5)) float a = sqrt(2+sqrt(5)) float b = 1/a a1 = @a1+1 b1 = @b1+flip(1) c1 = @c1 a2 = @a2+a+flip(qr5) b2 = @b2+qr5+flip(a) c2 = @c2 a3 = @a3+a+flip(qr5) b3 = @b3-qr5-flip(a) c3 = @c3 a4 = @a4+b+flip(qr5) b4 = @b4+qr5+flip(b) c4 = @c4 a5 = @a5+b+flip(qr5) b5 = @b5-qr5-flip(b) c5 = @c5 elseif @degree == 5 float r3 = sqrt(3) float a = 2+r3 float b = 1/a a1 = @a1+1+flip(2) b1 = @b1+1 c1 = @c1 a2 = @a2+1 b2 = @b2-1+flip(1) c2 = @c2 a3 = @a3+1+flip(r3) b3 = @b3+a+flip(1) c3 = @c3 a4 = @a4+1+flip(r3) b4 = @b4-a-flip(1) c4 = @c4 a5 = @a5+1+flip(1) b5 = @b5+b+flip(r3) c5 = @c5 a6 = @a6+1+flip(1) b6 = @b6-b-flip(r3) c6 = @c6 endif endif loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif if @selfrot > 0 ; z = z * (0,1)^(twodpi*atan2(z)) t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + @seed endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @t x = real(z) y = imag(z) tx = x ty = y if @pix == 1 x = real(a1)*tx + real(b1)*ty + real(@seed) y = imag(a1)*tx + imag(b1)*ty + imag(@seed) else x = real(a1)*tx + real(b1)*ty + real(c1) y = imag(a1)*tx + imag(b1)*ty + imag(c1) endif if @degree > 0 if @pix == 2 x = x*(real(a2)*tx + real(b2)*ty + real(@seed)) y = y*(imag(a2)*tx + imag(b2)*ty + imag(@seed)) else x = x*(real(a2)*tx + real(b2)*ty + real(c2)) y = y*(imag(a2)*tx + imag(b2)*ty + imag(c2)) endif endif if @degree > 1 if @pix == 3 x = x*(real(a3)*tx + real(b3)*ty + real(@seed)) y = y*(imag(a3)*tx + imag(b3)*ty + imag(@seed)) else x = x*(real(a3)*tx + real(b3)*ty + real(c3)) y = y*(imag(a3)*tx + imag(b3)*ty + imag(c3)) endif endif if @degree > 2 if @pix == 4 x = x*(real(a4)*tx + real(b4)*ty + real(@seed)) y = y*(imag(a4)*tx + imag(b4)*ty + imag(@seed)) else x = x*(real(a4)*tx + real(b4)*ty + real(c4)) y = y*(imag(a4)*tx + imag(b4)*ty + imag(c4)) endif endif if @degree > 3 if @pix == 5 x = x*(real(a5)*tx + real(b5)*ty + real(@seed)) y = y*(imag(a5)*tx + imag(b5)*ty + imag(@seed)) else x = x*(real(a5)*tx + real(b5)*ty + real(c5)) y = y*(imag(a5)*tx + imag(b5)*ty + imag(c5)) endif endif if @degree > 4 if @pix == 6 x = x*(real(a6)*tx + real(b6)*ty + real(@seed)) y = y*(imag(a6)*tx + imag(b6)*ty + imag(@seed)) else x = x*(real(a6)*tx + real(b6)*ty + real(c6)) y = y*(imag(a6)*tx + imag(b6)*ty + imag(c6)) endif endif if @lambda==0 && (@pix == 0 || @pix > @degree+1) z = fn1(x+flip(y)) + @seed elseif @lambda == 0 z = fn1(x+flip(y)) elseif @lambda == 1 z = @seed*fn1(x+flip(y)) + @v elseif @lambda == 2 z = @seed*(fn1(x+flip(y)) + @v) elseif @lambda == 3 z = fn1(x+flip(y)) + 1/@seed + @v elseif @lambda == 4 z = (1/@seed + @v1)*fn1(x+flip(y)) + @v elseif @lambda == 5 z = fn1(x+flip(y)) + 1/@seed + @seed + @v else z = (1/@seed + @seed + @v1)*fn1(x+flip(y)) + @v endif if @smallbail > 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "F(xy),G(xy)#1, Julia" method = multipass periodicity = 0 center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (1,.75) hint = "Modify for different Julia sets." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param degree caption = "Highest powers in x and y" default = 1 enum = "1" "2" "3" "4" "5" "6" hint = "Sets the number of brackets of the form \ (ax+by+c) to be multiplied in the formula." endparam param usepreset caption = "Complex presets" default = false hint = "If enabled then coefficient parameters of zero will \ produce the standard z^n+c fractal where n is the \ selected highest power. Small variations applied as \ the coefficient parameters produce interesting results." endparam param pix caption = "Use of the seed" default = 0 enum = "Extra constant" "First bracket" "Second bracket" \ "Third bracket" "Fourth bracket" "Fifth bracket" "Sixth bracket" hint = "If set as the Extra constant then the seed is simply added to the \ newly calculated z value, otherwise it is used to replace the \ constant in the specified bracket." endparam param a1 caption = "A1" default = (1,2) hint = "The constant A in the first bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b1 caption = "B1" default = (1,0) hint = "The constant B in the first bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c1 caption = "C1" default = (0,0) hint = "The constant C in the first bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param a2 caption = "A2" default = (1,0) hint = "The constant A in the second bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b2 caption = "B2" default = (-1,1) hint = "The constant B in the second bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c2 caption = "C2" default = (0,0) hint = "The constant C in the second bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param a3 caption = "A3" default = (1,1) hint = "The constant A in the third bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b3 caption = "B3" default = (1,1) hint = "The constant B in the third bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c3 caption = "C3" default = (1,1) hint = "The constant C in the third bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param a4 caption = "A4" default = (1,1) hint = "The constant A in the fourth bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b4 caption = "B4" default = (1,1) hint = "The constant B in the fourth bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c4 caption = "C4" default = (1,1) hint = "The constant C in the fourth bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param a5 caption = "A5" default = (1,1) hint = "The constant A in the fifth bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b5 caption = "B5" default = (1,1) hint = "The constant B in the fifth bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c5 caption = "C5" default = (1,1) hint = "The constant C in the fifth bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param a6 caption = "A6" default = (1,1) hint = "The constant A in the sixth bracket (Ax+by+c), \ please note that the real part of A sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of A sets the value to use in \ calculation of the new y part of z." endparam param b6 caption = "B6" default = (1,1) hint = "The constant B in the sixth bracket (ax+By+c), \ please note that the real part of B sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of B sets the value to use in \ calculation of the new y part of z." endparam param c6 caption = "C6" default = (1,1) hint = "The constant C in the sixth bracket (ax+by+C), \ please note that the real part of C sets the value \ to use in the calculation of the new x part of z \ and the imaginary part of C sets the value to use in \ calculation of the new y part of z. This value can \ be overridden by use of #pixel as C for this bracket." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds the seed to the rotated value, it's \ only here as it produces some interesting results." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration." endparam param t caption = "Translation" default = (0,0) hint = "Translates (moves) the value of z \ on each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param lambda caption = "Mu/Lambda version" default = 0 enum = "f(z)+c" "c*f(z)+v" "c*(f(z)+v)" "f(z)+1/c+v" \ "(1/c+v1)*f(z)+v" "f(z)+1/c+c+v" "(1/c+c+v1)*f(z)+v" hint = "Mu as f(z)+c, Lambda as c*f(z)+v or c*(f(z)+v), \ inverted Mu as f(z)+1/c+v, inverted Lambda as \ (1/c+v1)*f(z)+v plus inverted Mu as f(z)+1/c+c+v \ and inverted Lambda as (1/c+c+v1)*f(z)+v." endparam param v caption = "Mu/Lambda v" default = (0,0) hint = "Sets the value of v as used by some of the Mu/Lambda versions." endparam param v1 caption = "Mu/Lambda v1" default = (0,0) hint = "Sets the value of v1 as used by some of the Mu/Lambda versions." endparam func fn1 caption = "Overall function f1" default = ident() hint = "Applied to the z value after calculation of F(x,y) and G(x,y)." endfunc switch: type = "MMFx-FxyGxyM" start = #pixel smallbail = smallbail test = test bailout = bailout bailout1 = bailout1 sigma = sigma product = product degree = degree usepreset = usepreset pix = pix a1 = a1 b1 = b1 c1 = c1 a2 = a2 b2 = b2 c2 = c2 a3 = a3 b3 = b3 c3 = c3 a4 = a4 b4 = b4 c4 = c4 a5 = a5 b5 = b5 c5 = c5 a6 = a6 b6 = b6 c6 = c6 selfrot = selfrot ang = ang t = t m = m n = n lambda = lambda v = v v1 = v1 fn1 = fn1 } MMFy-FxyGxyM { ; ; This is a more general version of (F(x,y),G(x,y)) in ; which you may explicitly define the coefficients of ; the individual terms in F() and G(). ; ; "Iterate the product" added 6th April 2002 ; Created 16th August 2001 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = @start float x = real(z) float y = imag(z) float t = 0 float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca float tx = x float ty = y complex zold = z complex zs = (0,0) complex zp = (1,0) bool bail = true float x2 = x float xy = x float y2 = y float x3 = x float x2y = x float xy2 = y float y3 = y float x4 = x float x3y = x float x2y2 = x float xy3 = y float y4 = y float x5 = x float x4y = x float x3y2 =x float x2y3 = y float xy4 = y float y5 = y float x6 = x float x5y = x float x4y2 = x float x3y3 = x float x2y4 = y float xy5 = y float y6 = y complex cx = @cx complex cy = @cy complex cx2 = @cx2 complex cxy = @cxy complex cy2 = @cy2 complex cx3 = @cx3 complex cx2y = @cx2y complex cxy2 = @cxy2 complex cy3 = @cy3 complex cx4 = @cx4 complex cx3y = @cx3y complex cx2y2 = @cx2y2 complex cxy3 = @cxy3 complex cy4 = @cy4 complex cx5 = @cx5 complex cx4y = @cx4y complex cx3y2 = @cx3y2 complex cx2y3 = @cx2y3 complex cxy4 = @cxy4 complex cy5 = @cy5 complex cx6 = @cx6 complex cx5y = @cx5y complex cx4y2 = @cx4y2 complex cx3y3 = @cx3y3 complex cx2y4 = @cx2y4 complex cxy5 = @cxy5 complex cy6 = @cy6 if @usepreset == true if @degree == 1 complex cx2 = @cx2 + 1 complex cxy = @cxy + flip(2) complex cy2 = @cy2 - 1 endif if @degree == 2 complex cx3 = @cx3 + 1 complex cx2y = @cx2y + flip(3) complex cxy2 = @cxy2 - 3 complex cy3 = @cy3 - flip(1) endif if @degree == 3 complex cx4 = @cx4 + 1 complex cx3y = @cx3y + flip(4) complex cx2y2 = @cx2y2 - 6 complex cxy3 = @cxy3 - flip(4) complex cy4 = @cy4 + 1 endif if @degree == 4 complex cx5 = @cx5 + 1 complex cx4y = @cx4y + flip(5) complex cx3y2 = @cx3y2 - 10 complex cx2y3 = @cx2y3 - flip(10) complex cxy4 = @cxy4 + 5 complex cy5 = @cy5 + flip(1) endif if @degree == 5 complex cx6 = @cx6 + 1 complex cx5y = @cx5y + flip(6) complex cx4y2 = @cx4y2 - 15 complex cx3y3 = @cx3y3 - flip(20) complex cx2y4 = @cx2y4 + (15) complex cxy5 = @cxy5 + flip(6) complex cy6 = @cy6 - 1 endif endif loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif if @selfrot > 0 ; z = z * (0,1)^(twodpi*atan2(z)) t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @t x = real(z) y = imag(z) tx = x ty = y x = real(cx)*tx + real(cy)*ty y = imag(cx)*tx + imag(cy)*ty if @degree > 0 x2 = tx*tx xy = tx*ty y2 = ty*ty x = x + real(cx2)*x2 + real(cxy)*xy + real(cy2)*y2 y = y + imag(cx2)*x2 + imag(cxy)*xy + imag(cy2)*y2 endif if @degree > 1 x3 = x2*tx x2y = x2*ty xy2 = tx*y2 y3 = ty*y2 x = x + real(cx3)*x3 + real(cx2y)*x2y \ + real(cxy2)*xy2 + real(cy3)*y3 y = y + imag(cx3)*x3 + imag(cx2y)*x2y \ + imag(cxy2)*xy2 + imag(cy3)*y3 endif if @degree > 2 x4 = x3*tx x3y = x2y*tx x2y2 = x2y*ty xy3 = xy2*ty y4 = ty*y3 x = x + real(cx4)*x4 + real(cx3y)*x3y + real(cx2y2)*x2y2 \ + real(cxy3)*xy3 + real(cy4)*y4 y = y + imag(cx4)*x4 + imag(cx3y)*x3y + imag(cx2y2)*x2y2 \ + imag(cxy3)*xy3 + imag(cy4)*y4 endif if @degree > 3 x5 = x4*tx x4y = x3y*tx x3y2 = x2y2*tx x2y3 = x2y2*ty xy4 = xy3*ty y5 = ty*y4 x = x + real(cx5)*x5 + real(cx4y)*x4y + real(cx3y2)*x3y2 \ + real(cx2y3)*x2y3 + real(cxy4)*xy4 + real(cy5)*y5 y = y + imag(cx5)*x5 + imag(cx4y)*x4y + imag(cx3y2)*x3y2 \ + imag(cx2y3)*x2y3 + imag(cxy4)*xy4 + imag(cy5)*y5 endif if @degree > 4 x6 = x5*tx x5y = x4y*tx x4y2 = x3y2*tx x3y3 = x3y2*ty x2y4 = x2y3*ty xy5 = xy4*ty y6 = ty*y5 x = x + real(cx6)*x6 + real(cx5y)*x5y + real(cx4y2)*x4y2 + real(cx3y3)*x3y3 \ + real(cx2y4)*x2y4 + real(cxy5)*xy5 + real(cy6)*y6 y = y + imag(cx6)*x6 + imag(cx5y)*x5y + imag(cx4y2)*x4y2 + imag(cx3y3)*x3y3 \ + imag(cx2y4)*x2y4 + imag(cxy5)*xy5 + imag(cy6)*y6 endif if @lambda == 0 z = fn1(x+flip(y)) + #pixel elseif @lambda == 1 z = #pixel*fn1(x+flip(y)) + @v elseif @lambda == 2 z = #pixel*(fn1(x+flip(y)) + @v) elseif @lambda == 3 z = fn1(x+flip(y)) + 1/#pixel + @v elseif @lambda == 4 z = (1/#pixel + @v1)*fn1(x+flip(y)) + @v elseif @lambda == 5 z = fn1(x+flip(y)) + 1/#pixel + #pixel + @v else z = (1/#pixel + #pixel + @v1)*fn1(x+flip(y)) + @v endif if @smallbail > 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "F(xy),G(xy)#2, Mandelbrot" method = multipass periodicity = 0 center = (-.5, 0) helpfile = "MMF.html" param start caption = "Starting point" default = (0,0) hint = "Perturbation of start Z, use to deform the fractal." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param degree caption = "Highest powers in x and y" default = 1 enum = "1" "2" "3" "4" "5" "6" hint = "Sets the highest powers in x and y to be used \ in F() and G() ie. the degree of the polynomials." endparam param usepreset caption = "Complex presets" default = true hint = "If enabled then coefficient parameters of zero will \ produce the standard z^n+c fractal where n is the \ selected highest power. Small variations applied as \ the coefficient parameters produce interesting results." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds the seed to the rotated value, it's \ only here as it produces some interesting results." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration." endparam param t caption = "Translation" default = (0,0) hint = "Translates (moves) the value of z \ on each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param lambda caption = "Mu/Lambda version" default = 0 enum = "f(z)+c" "c*f(z)+v" "c*(f(z)+v)" "f(z)+1/c+v" \ "(1/c+v1)*f(z)+v" "f(z)+1/c+c+v" "(1/c+c+v1)*f(z)+v" hint = "Mu as f(z)+c, Lambda as c*f(z)+v or c*(f(z)+v), \ inverted Mu as f(z)+1/c+v, inverted Lambda as \ (1/c+v1)*f(z)+v plus inverted Mu as f(z)+1/c+c+v \ and inverted Lambda as (1/c+c+v1)*f(z)+v." endparam param v caption = "Mu/Lambda v" default = (0,0) hint = "Sets the value of v as used by some of the Mu/Lambda versions." endparam param v1 caption = "Mu/Lambda v1" default = (0,0) hint = "Sets the value of v1 as used by some of the Mu/Lambda versions." endparam param cx caption = "Coeffs of x" default = (0,0) hint = "The coefficients of x in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy caption = "Coeffs of y" default = (0,0) hint = "The coefficients of y in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx2 caption = "Co. of x^2" default = (0,0) hint = "The coefficients of x^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cxy caption = "Co. of xy" default = (0,0) hint = "The coefficients of xy in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy2 caption = "Co. of y^2" default = (0,0) hint = "The coefficients of y^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx3 caption = "Co. of x^3" default = (0,0) hint = "The coefficients of x^3 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx2y caption = "Co. of x^2.y" default = (0,0) hint = "The coefficients of x^2.y in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cxy2 caption = "Co. of x.y^2" default = (0,0) hint = "The coefficients of x.y^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy3 caption = "Co. of y^3" default = (0,0) hint = "The coefficients of y^3 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx4 caption = "Co. of x^4" default = (0,0) hint = "The coefficients of x^4 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx3y caption = "Co. of x^3.y" default = (0,0) hint = "The coefficients of x^3.y in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx2y2 caption = "Co. of x^2.y^2" default = (0,0) hint = "The coefficients of x^2.y^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cxy3 caption = "Co. of x.y^3" default = (0,0) hint = "The coefficients of x.y^3 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy4 caption = "Co. of y^4" default = (0,0) hint = "The coefficients of y^4 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx5 caption = "Co. of x^5" default = (0,0) hint = "The coefficients of x^5 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx4y caption = "Co. of x^4.y" default = (0,0) hint = "The coefficients of x^4.y in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx3y2 caption = "Co. of x^3.y^2" default = (0,0) hint = "The coefficients of x^3.y^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx2y3 caption = "Co. of x^2.y^3" default = (0,0) hint = "The coefficients of x^2.y^3 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cxy4 caption = "Co. of x.y^4" default = (0,0) hint = "The coefficients of x.y^4 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy5 caption = "Co. of y^5" default = (0,0) hint = "The coefficients of y^5 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx6 caption = "Co. of x^6" default = (0,0) hint = "The coefficients of x^6 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx5y caption = "Co. of x^5.y" default = (0,0) hint = "The coefficients of x^5.y in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx4y2 caption = "Co. of x^4.y^2" default = (0,0) hint = "The coefficients of x^4.y^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx3y3 caption = "Co. of x^3.y^3" default = (0,0) hint = "The coefficients of x^3.y^3 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx2y4 caption = "Co. of x^2.y^4" default = (0,0) hint = "The coefficients of x^2.y^4 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cxy5 caption = "Co. of x.y^5" default = (0,0) hint = "The coefficients of x.y^5 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy6 caption = "Co. of y^6" default = (0,0) hint = "The coefficients of y^6 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam func fn1 caption = "Overall function f1" default = ident() hint = "Applied to the z value after calculation of F(x,y) and G(x,y)." endfunc switch: type = "MMFy-FxyGxyJ" seed = #pixel smallbail = smallbail test = test bailout = bailout bailout1 = bailout1 sigma = sigma product = product degree = degree usepreset = usepreset selfrot = selfrot ang = ang t = t m = m n = n lambda = lambda v = v v1 = v1 cx = cx cy = cy cx2 = cx2 cxy = cxy cy2 = cy2 cx3 = cx3 cx2y = cx2y cxy2 = cxy2 cy3 = cy3 cx4 = cx4 cx3y = cx3y cx2y2 = cx2y2 cxy3 = cxy3 cy4 = cy4 cx5 = cx5 cx4y = cx4y cx3y2 = cx3y2 cx2y3 = cx2y3 cxy4 = cxy4 cy5 = cy5 cx6 = cx6 cx5y = cx5y cx4y2 = cx4y2 cx3y3 = cx3y3 cx2y4 = cx2y4 cxy5 = cxy5 cy6 = cy6 fn1 = fn1 } MMFy-FxyGxyJ { ; ; This is a more general version of (F(x,y),G(x,y)) in ; which you may explicitly define the coefficients of ; the individual terms in F() and G(). ; ; "Iterate the product" added 6th April 2002 ; Created 16th August 2001 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel float x = real(z) float y = imag(z) float t = 0 float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca float tx = x float ty = y complex zold = z complex zs = (0,0) complex zp = (1,0) bool bail = true float x2 = x float xy = x float y2 = y float x3 = x float x2y = x float xy2 = y float y3 = y float x4 = x float x3y = x float x2y2 = x float xy3 = y float y4 = y float x5 = x float x4y = x float x3y2 =x float x2y3 = y float xy4 = y float y5 = y float x6 = x float x5y = x float x4y2 = x float x3y3 = x float x2y4 = y float xy5 = y float y6 = y complex cx = @cx complex cy = @cy complex cx2 = @cx2 complex cxy = @cxy complex cy2 = @cy2 complex cx3 = @cx3 complex cx2y = @cx2y complex cxy2 = @cxy2 complex cy3 = @cy3 complex cx4 = @cx4 complex cx3y = @cx3y complex cx2y2 = @cx2y2 complex cxy3 = @cxy3 complex cy4 = @cy4 complex cx5 = @cx5 complex cx4y = @cx4y complex cx3y2 = @cx3y2 complex cx2y3 = @cx2y3 complex cxy4 = @cxy4 complex cy5 = @cy5 complex cx6 = @cx6 complex cx5y = @cx5y complex cx4y2 = @cx4y2 complex cx3y3 = @cx3y3 complex cx2y4 = @cx2y4 complex cxy5 = @cxy5 complex cy6 = @cy6 if @usepreset == true if @degree == 1 complex cx2 = @cx2 + 1 complex cxy = @cxy + flip(2) complex cy2 = @cy2 - 1 endif if @degree == 2 complex cx3 = @cx3 + 1 complex cx2y = @cx2y + flip(3) complex cxy2 = @cxy2 - 3 complex cy3 = @cy3 - flip(1) endif if @degree == 3 complex cx4 = @cx4 + 1 complex cx3y = @cx3y + flip(4) complex cx2y2 = @cx2y2 - 6 complex cxy3 = @cxy3 - flip(4) complex cy4 = @cy4 + 1 endif if @degree == 4 complex cx5 = @cx5 + 1 complex cx4y = @cx4y + flip(5) complex cx3y2 = @cx3y2 - 10 complex cx2y3 = @cx2y3 - flip(10) complex cxy4 = @cxy4 + 5 complex cy5 = @cy5 + flip(1) endif if @degree == 5 complex cx6 = @cx6 + 1 complex cx5y = @cx5y + flip(6) complex cx4y2 = @cx4y2 - 15 complex cx3y3 = @cx3y3 - flip(20) complex cx2y4 = @cx2y4 + (15) complex cxy5 = @cxy5 + flip(6) complex cy6 = @cy6 - 1 endif endif loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif if @selfrot > 0 ; z = z * (0,1)^(twodpi*atan2(z)) t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + @seed endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @t x = real(z) y = imag(z) tx = x ty = y x = real(cx)*tx + real(cy)*ty y = imag(cx)*tx + imag(cy)*ty if @degree > 0 x2 = tx*tx xy = tx*ty y2 = ty*ty x = x + real(cx2)*x2 + real(cxy)*xy + real(cy2)*y2 y = y + imag(cx2)*x2 + imag(cxy)*xy + imag(cy2)*y2 endif if @degree > 1 x3 = x2*tx x2y = x2*ty xy2 = tx*y2 y3 = ty*y2 x = x + real(cx3)*x3 + real(cx2y)*x2y \ + real(cxy2)*xy2 + real(cy3)*y3 y = y + imag(cx3)*x3 + imag(cx2y)*x2y \ + imag(cxy2)*xy2 + imag(cy3)*y3 endif if @degree > 2 x4 = x3*tx x3y = x2y*tx x2y2 = x2y*ty xy3 = xy2*ty y4 = ty*y3 x = x + real(cx4)*x4 + real(cx3y)*x3y + real(cx2y2)*x2y2 \ + real(cxy3)*xy3 + real(cy4)*y4 y = y + imag(cx4)*x4 + imag(cx3y)*x3y + imag(cx2y2)*x2y2 \ + imag(cxy3)*xy3 + imag(cy4)*y4 endif if @degree > 3 x5 = x4*tx x4y = x3y*tx x3y2 = x2y2*tx x2y3 = x2y2*ty xy4 = xy3*ty y5 = ty*y4 x = x + real(cx5)*x5 + real(cx4y)*x4y + real(cx3y2)*x3y2 \ + real(cx2y3)*x2y3 + real(cxy4)*xy4 + real(cy5)*y5 y = y + imag(cx5)*x5 + imag(cx4y)*x4y + imag(cx3y2)*x3y2 \ + imag(cx2y3)*x2y3 + imag(cxy4)*xy4 + imag(cy5)*y5 endif if @degree > 4 x6 = x5*tx x5y = x4y*tx x4y2 = x3y2*tx x3y3 = x3y2*ty x2y4 = x2y3*ty xy5 = xy4*ty y6 = ty*y5 x = x + real(cx6)*x6 + real(cx5y)*x5y + real(cx4y2)*x4y2 + real(cx3y3)*x3y3 \ + real(cx2y4)*x2y4 + real(cxy5)*xy5 + real(cy6)*y6 y = y + imag(cx6)*x6 + imag(cx5y)*x5y + imag(cx4y2)*x4y2 + imag(cx3y3)*x3y3 \ + imag(cx2y4)*x2y4 + imag(cxy5)*xy5 + imag(cy6)*y6 endif if @lambda == 0 z = fn1(x+flip(y)) + @seed elseif @lambda == 1 z = @seed*fn1(x+flip(y)) + @v elseif @lambda == 2 z = @seed*(fn1(x+flip(y)) + @v) elseif @lambda == 3 z = fn1(x+flip(y)) + 1/@seed + @v elseif @lambda == 4 z = (1/@seed + @v1)*fn1(x+flip(y)) + @v elseif @lambda == 5 z = fn1(x+flip(y)) + 1/@seed + @seed + @v else z = (1/@seed + @seed + @v1)*fn1(x+flip(y)) + @v endif if @smallbail > 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "F(xy),G(xy)#2, Julia" method = multipass periodicity = 0 center = (0, 0) helpfile = "MMF.html" param seed caption = "Julia seed" default = (1,.75) hint = "Modify for different Julia sets." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param degree caption = "Highest powers in x and y" default = 1 enum = "1" "2" "3" "4" "5" "6" hint = "Sets the highest powers in x and y to be used \ in F() and G() ie. the degree of the polynomials." endparam param usepreset caption = "Complex presets" default = false hint = "If enabled then coefficient parameters of zero will \ produce the standard z^n+c fractal where n is the \ selected highest power. Small variations applied as \ the coefficient parameters produce interesting results." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds the seed to the rotated value, it's \ only here as it produces some interesting results." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration." endparam param t caption = "Translation" default = (0,0) hint = "Translates (moves) the value of z \ on each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param lambda caption = "Mu/Lambda version" default = 0 enum = "f(z)+c" "c*f(z)+v" "c*(f(z)+v)" "f(z)+1/c+v" \ "(1/c+v1)*f(z)+v" "f(z)+1/c+c+v" "(1/c+c+v1)*f(z)+v" hint = "Mu as f(z)+c, Lambda as c*f(z)+v or c*(f(z)+v), \ inverted Mu as f(z)+1/c+v, inverted Lambda as \ (1/c+v1)*f(z)+v plus inverted Mu as f(z)+1/c+c+v \ and inverted Lambda as (1/c+c+v1)*f(z)+v." endparam param v caption = "Mu/Lambda v" default = (0,0) hint = "Sets the value of v as used by some of the Mu/Lambda versions." endparam param v1 caption = "Mu/Lambda v1" default = (0,0) hint = "Sets the value of v1 as used by some of the Mu/Lambda versions." endparam param cx caption = "Coeffs of x" default = (0,0) hint = "The coefficients of x in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy caption = "Coeffs of y" default = (0,0) hint = "The coefficients of y in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx2 caption = "Co. of x^2" default = (0,0) hint = "The coefficients of x^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cxy caption = "Co. of xy" default = (0,0) hint = "The coefficients of xy in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy2 caption = "Co. of y^2" default = (0,0) hint = "The coefficients of y^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx3 caption = "Co. of x^3" default = (0,0) hint = "The coefficients of x^3 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx2y caption = "Co. of x^2.y" default = (0,0) hint = "The coefficients of x^2.y in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cxy2 caption = "Co. of x.y^2" default = (0,0) hint = "The coefficients of x.y^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy3 caption = "Co. of y^3" default = (0,0) hint = "The coefficients of y^3 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx4 caption = "Co. of x^4" default = (0,0) hint = "The coefficients of x^4 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx3y caption = "Co. of x^3.y" default = (0,0) hint = "The coefficients of x^3.y in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx2y2 caption = "Co. of x^2.y^2" default = (0,0) hint = "The coefficients of x^2.y^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cxy3 caption = "Co. of x.y^3" default = (0,0) hint = "The coefficients of x.y^3 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy4 caption = "Co. of y^4" default = (0,0) hint = "The coefficients of y^4 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx5 caption = "Co. of x^5" default = (0,0) hint = "The coefficients of x^5 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx4y caption = "Co. of x^4.y" default = (0,0) hint = "The coefficients of x^4.y in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx3y2 caption = "Co. of x^3.y^2" default = (0,0) hint = "The coefficients of x^3.y^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx2y3 caption = "Co. of x^2.y^3" default = (0,0) hint = "The coefficients of x^2.y^3 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cxy4 caption = "Co. of x.y^4" default = (0,0) hint = "The coefficients of x.y^4 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy5 caption = "Co. of y^5" default = (0,0) hint = "The coefficients of y^5 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx6 caption = "Co. of x^6" default = (0,0) hint = "The coefficients of x^6 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx5y caption = "Co. of x^5.y" default = (0,0) hint = "The coefficients of x^5.y in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx4y2 caption = "Co. of x^4.y^2" default = (0,0) hint = "The coefficients of x^4.y^2 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx3y3 caption = "Co. of x^3.y^3" default = (0,0) hint = "The coefficients of x^3.y^3 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cx2y4 caption = "Co. of x^2.y^4" default = (0,0) hint = "The coefficients of x^2.y^4 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cxy5 caption = "Co. of x.y^5" default = (0,0) hint = "The coefficients of x.y^5 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam param cy6 caption = "Co. of y^6" default = (0,0) hint = "The coefficients of y^6 in F(x,y) and G(x,y), \ please note that the real part sets the value in F() \ to use for the calculation of the new x part of z \ and the imaginary part sets the value in G() to use for \ calculation of the new y part of z." endparam func fn1 caption = "Overall function f1" default = ident() hint = "Applied to the z value after calculation of F(x,y) and G(x,y)." endfunc switch: type = "MMFy-FxyGxyM" start = #pixel smallbail = smallbail test = test bailout = bailout bailout1 = bailout1 sigma = sigma product = product degree = degree usepreset = usepreset selfrot = selfrot ang = ang t = t m = m n = n lambda = lambda v = v v1 = v1 cx = cx cy = cy cx2 = cx2 cxy = cxy cy2 = cy2 cx3 = cx3 cx2y = cx2y cxy2 = cxy2 cy3 = cy3 cx4 = cx4 cx3y = cx3y cx2y2 = cx2y2 cxy3 = cxy3 cy4 = cy4 cx5 = cx5 cx4y = cx4y cx3y2 = cx3y2 cx2y3 = cx2y3 cxy4 = cxy4 cy5 = cy5 cx6 = cx6 cx5y = cx5y cx4y2 = cx4y2 cx3y3 = cx3y3 cx2y4 = cx2y4 cxy5 = cxy5 cy6 = cy6 fn1 = fn1 } MMFz-Extra1M { ; ; These formulas are basically the extrapolation ; of z = m*f(z) + c, given z0, z1 and z2. ; We have: ; z1 = m*f(z0) + c AND z2 = m*f(z1) + c ; Hence: ; z2 - z1 = m(f(z1) - f(z0)) ; m = (z2 - z1)/(f(z1) - f(z(0)) ; and: ; (z1 - c)/f(z0) = (z2 - c)/f(z1) ; z1*f(z1) - c*f(z1) = z2*f(z0) - c*f(z0) ; c = (z1*f(z1) - z2*f(z0))/(f(z1) - f(z0)) ; ; In this version z0 and z1 are user parameters and ; z2 is #pixel. ; ; Created 10th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: if @invert == true complex p = @centre + @radius / (#pixel - @centre) else complex p = #pixel endif complex z = @z0 complex fz0 = z complex fz1 = @z1 complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @sigma == true fz1 = fz1 + fz0 endif if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif t = cabs(fz1) if t > 0 fz1 = fz1*fz1/t endif if @selfrot == 2 fz0 = fz0 + p fz1 = fz1 + p endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy x = real(fz1) y = imag(fz1) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz1 = x + flip(y) + @xy fz0 = Fn2(Fn1(fz0)^@power) fz1 = Fn2(Fn1(fz1)^@power) complex zd = fz1 - fz0 complex m = (p-@z1)/zd complex c = (@z1*fz1 - p*fz0)/zd loop: zold = z if zd != (0,0) if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = m*Fn2(Fn1(z)^@power) + c endif if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #1 (Mandelbrot)" magn = 1.0 center = (0.5, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param z0 caption = "Starting point z0" default = (0,0) hint = "Sets the first of the three values to use for extrapolation. \ You can also set the second of these using Second value z1. \ The third is set to #pixel." endparam param z1 caption = "Second value z1" default = (1,0) hint = "Sets the second of the three values to use for extrapolation. \ You can also set the first of these using Starting point z0. \ The third is set to #pixel." endparam param power caption = "Power" default = (2.0,0) hint = "Sets the power z is raised to in the extrapolation - \ ie. the value of n in Fn2(Fn1(z)^n)." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam param invert caption = "Inversion" default = false hint = "Performs an inversion transformation when enabled. \ Use the Inversion Centre and Inversion Radius to control \ the inversion." endparam param centre caption = "Inversion centre" default = (0,0) hint = "Sets the coordinates around which an inversion is performed." endparam param radius caption = "Inversion radius" default = 1.0 hint = "Sets the radius for an inversion." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn2(Fn1(z)^n). Some settings will produce convergence." endfunc func Fn2 caption = "Function 2" default = ident() hint = "Fn2 in Fn2(Fn1(z)^n). Some settings will produce convergence," endfunc switch: type = "MMFz-Extra1J" z1 = z1 z2 = #pixel power = power test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot invert = invert centre = centre radius = radius Fn1 = Fn1 Fn2 = Fn2 } MMFz-Extra1I { ; ; These formulas are basically the extrapolation ; of z = m*f(z) + c, given z0, z1 and z2. ; We have: ; z1 = m*f(z0) + c AND z2 = m*f(z1) + c ; Hence: ; z2 - z1 = m(f(z1) - f(z0)) ; m = (z2 - z1)/(f(z1) - f(z(0)) ; and: ; (z1 - c)/f(z0) = (z2 - c)/f(z1) ; z1*f(z1) - c*f(z1) = z2*f(z0) - c*f(z0) ; c = (z1*f(z1) - z2*f(z0))/(f(z1) - f(z0)) ; ; In this version z0 and z2 are user parameters and ; z1 is #pixel. ; ; Created 10th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: if @invert == true complex p = @centre + @radius / (#pixel - @centre) else complex p = #pixel endif complex z = @z0 complex fz0 = z complex fz1 = p complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @sigma == true fz1 = fz1 + fz0 endif if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif t = cabs(fz1) if t > 0 fz1 = fz1*fz1/t endif if @selfrot == 2 fz0 = fz0 + p fz1 = fz1 + p endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy x = real(fz1) y = imag(fz1) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz1 = x + flip(y) + @xy fz0 = Fn2(Fn1(fz0)^@power) fz1 = Fn2(Fn1(fz1)^@power) complex zd = fz1 - fz0 complex m = (@z2-p)/zd complex c = (p*fz1 - @z2*fz0)/zd loop: zold = z if zd != (0,0) if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = m*Fn2(Fn1(z)^@power) + c endif if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #1 (Inverse)" magn = 0.35 center = (0, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param z0 caption = "Starting point z0" default = (0,0) hint = "Sets the first of the three values to use for extrapolation. \ You can also set third of these using Third value z2. \ The second is set to #pixel." endparam param z2 caption = "Third value z2" default = (1,0) hint = "Sets the third of the three values to use for extrapolation. \ You can also set the first of these using Starting point z0. \ The second is set to #pixel." endparam param power caption = "Power" default = (2.0,0) hint = "Sets the power z is raised to in the extrapolation - \ ie. the value of n in Fn2(Fn1(z)^n)." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings may \ require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam param invert caption = "Inversion" default = false hint = "Performs an inversion transformation when enabled. \ Use the Inversion Centre and Inversion Radius to control \ the inversion." endparam param centre caption = "Inversion centre" default = (0,0) hint = "Sets the coordinates around which an inversion is performed." endparam param radius caption = "Inversion radius" default = 1.0 hint = "Sets the radius for an inversion." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn2(Fn1(z)^n). Some settings will produce convergence." endfunc func Fn2 caption = "Function 2" default = ident() hint = "Fn2 in Fn2(Fn1(z)^n). Some settings will produce convergence," endfunc switch: type = "MMFz-Extra1J" z1 = #pixel z2 = z2 power = power test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot invert = invert centre = centre radius = radius Fn1 = Fn1 Fn2 = Fn2 } MMFz-Extra1J { ; ; These formulas are basically the extrapolation ; of z = m*f(z) + c, given z0, z1 and z2. ; We have: ; z1 = m*f(z0) + c AND z2 = m*f(z1) + c ; Hence: ; z2 - z1 = m(f(z1) - f(z0)) ; m = (z2 - z1)/(f(z1) - f(z(0)) ; and: ; (z1 - c)/f(z0) = (z2 - c)/f(z1) ; z1*f(z1) - c*f(z1) = z2*f(z0) - c*f(z0) ; c = (z1*f(z1) - z2*f(z0))/(f(z1) - f(z0)) ; ; In this version z1 and z2 are user parameters and ; z0 is #pixel. ; ; Created 10th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: if @invert == true complex z = @centre + @radius / (#pixel - @centre) else complex z = #pixel endif complex fz0 = z complex fz1 = @z1 complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @sigma == true fz1 = fz1 + fz0 endif if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif t = cabs(fz1) if t > 0 fz1 = fz1*fz1/t endif if @selfrot == 2 fz0 = fz0 + z fz1 = fz1 + z endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy x = real(fz1) y = imag(fz1) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz1 = x + flip(y) + @xy fz0 = Fn2(Fn1(fz0)^@power) fz1 = Fn2(Fn1(fz1)^@power) complex zd = fz1 - fz0 complex m = (@z2-@z1)/zd complex c = (@z1*fz1 - @z2*fz0)/zd loop: zold = z if zd != (0,0) if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = m*Fn2(Fn1(z)^@power) + c endif if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #1 (Julia)" magn = 0.55 center = (0, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param z1 caption = "Second value z1" default = (1,0) hint = "Sets the second of the three values to use for extrapolation. \ You can also set the third of these using Third value z2. \ The first is set to #pixel." endparam param z2 caption = "Third value z2" default = (2,0) hint = "Sets the third of the three values to use for extrapolation. \ You can also set the second of these using Second value z1. \ The first is set to #pixel." endparam param power caption = "Power" default = (2.0,0) hint = "Sets the power z is raised to in the extrapolation - \ ie. the value of n in Fn2(Fn1(z)^n)." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings may \ require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam param invert caption = "Inversion" default = false hint = "Performs an inversion transformation when enabled. \ Use the Inversion Centre and Inversion Radius to control \ the inversion." endparam param centre caption = "Inversion centre" default = (0,0) hint = "Sets the coordinates around which an inversion is performed." endparam param radius caption = "Inversion radius" default = 1.0 hint = "Sets the radius for an inversion." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn2(Fn1(z)^n). Some settings will produce convergence." endfunc func Fn2 caption = "Function 2" default = ident() hint = "Fn2 in Fn2(Fn1(z)^n). Some settings will produce convergence," endfunc switch: type = "MMFz-Extra1I" z0 = #pixel z2 = z2 power = power test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot invert = invert centre = centre radius = radius Fn1 = Fn1 Fn2 = Fn2 } MMFA-Extra2M1 { ; ; These formulas are basically the extrapolation ; of z = c*f(z)^p, given z0, z1 and z2. ; We have: ; z1 = c*f(z0)^p AND z2 = c*f(z1)^p ; Hence: ; z1/f(z0)^p = z2/f(z1)^p ; (f(z1)/f(z0))^p = z2/z1 ; p = log(z2/z1)/log(f(z1)/f(z0)) ; and so we also have: ; c = z1/f(z0)^p ; ; In this version z0 and z1 are user parameters and ; z2 is #pixel. ; ; Created 17th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = @z0 complex fz0 = z complex fz1 = @z1 complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @sigma == true fz1 = fz1 + fz0 endif if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif t = cabs(fz1) if t > 0 fz1 = fz1*fz1/t endif if @selfrot == 2 fz0 = fz0 + #pixel fz1 = fz1 + #pixel endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy x = real(fz1) y = imag(fz1) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz1 = x + flip(y) + @xy fz0 = Fn1(fz0) fz1 = Fn1(fz1) complex p = log(#pixel/@z1)/log(fz1/fz0) complex c = @z1/(fz0^p) loop: zold = z if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy if @version==0 z = c*Fn1(z)^p else z = Fn1(z)^p + c endif if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #2 (M1)" magn = 0.125 center = (0, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param version caption = "Version" default = 0 enum = "Correct" "Incorrect" hint = "Correct calculates the values of p and c for c*f(z)^p and \ iterates c*f(z)^p. Incorrect uses the same values of c and p \ but iterates f(z)^p + c (it was an interesting mistake)." endparam param z0 caption = "Starting point z0" default = (1,0) hint = "Sets the first of the three values to use for extrapolation. \ You can also set the second of these using Second value z1. \ The third is set to #pixel." endparam param z1 caption = "Second value z1" default = (2,0) hint = "Sets the second of the three values to use for extrapolation. \ You can also set the first of these using Starting point z0. \ The third is set to #pixel." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in c*Fn1(z)^p. Some settings will produce convergence." endfunc switch: type = "MMFA-Extra2J" version = version z1 = z1 z2 = #pixel test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot Fn1 = Fn1 } MMFA-Extra2M2 { ; ; These formulas are basically the extrapolation ; of z = c*f(z)^p, given z0, z1 and z2. ; We have: ; z1 = c*f(z0)^p AND z2 = c*f(z1)^p ; Hence: ; z1/f(z0)^p = z2/f(z1)^p ; (f(z1)/f(z0))^p = z2/z1 ; p = log(z2/z1)/log(f(z1)/f(z0)) ; and so we also have: ; c = z1/f(z0)^p ; ; In this version z0 and z2 are user parameters and ; z1 is #pixel. ; ; Created 17th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = @z0 complex fz0 = z complex fz1 = #pixel complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @sigma == true fz1 = fz1 + fz0 endif if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif t = cabs(fz1) if t > 0 fz1 = fz1*fz1/t endif if @selfrot == 2 fz0 = fz0 + #pixel fz1 = fz1 + #pixel endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy x = real(fz1) y = imag(fz1) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz1 = x + flip(y) + @xy fz0 = Fn1(fz0) fz1 = Fn1(fz1) complex p = log(@z2/#pixel)/log(fz1/fz0) complex c = #pixel/(fz0^p) loop: zold = z if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy if @version==0 z = c*Fn1(z)^p else z = Fn1(z)^p + c endif if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #2 (M2)" magn = 1 center = (0, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param version caption = "Version" default = 0 enum = "Correct" "Incorrect" hint = "Correct calculates the values of p and c for c*f(z)^p and \ iterates c*f(z)^p. Incorrect uses the same values of c and p \ but iterates f(z)^p + c. It was an interesting mistake." endparam param z0 caption = "Starting point z0" default = (1,0) hint = "Sets the first of the three values to use for extrapolation. \ You can also set the third of these using Third value z2. \ The second is set to #pixel." endparam param z2 caption = "Third value z2" default = (2,0) hint = "Sets the third of the three values to use for extrapolation. \ You can also set the first of these using Starting point z0. \ The second is set to #pixel." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in c*Fn1(z)^p. Some settings will produce convergence." endfunc switch: type = "MMFA-Extra2J" version = version z1 = #pixel z2 = z2 test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot Fn1 = Fn1 } MMFA-Extra2J { ; ; These formulas are basically the extrapolation ; of z = c*f(z)^p, given z0, z1 and z2. ; We have: ; z1 = c*f(z0)^p AND z2 = c*f(z1)^p ; Hence: ; z1/f(z0)^p = z2/f(z1)^p ; (f(z1)/f(z0))^p = z2/z1 ; p = log(z2/z1)/log(f(z1)/f(z0)) ; and so we also have: ; c = z1/f(z0)^p ; ; In this version z1 and z2 are user parameters and ; z0 is #pixel. ; ; Created 17th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel complex fz0 = z complex fz1 = @z1 complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @sigma == true fz1 = fz1 + fz0 endif if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif t = cabs(fz1) if t > 0 fz1 = fz1*fz1/t endif if @selfrot == 2 fz0 = fz0 + #pixel fz1 = fz1 + #pixel endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy x = real(fz1) y = imag(fz1) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz1 = x + flip(y) + @xy fz0 = Fn1(fz0) fz1 = Fn1(fz1) complex p = log(@z2/@z1)/log(fz1/fz0) complex c = @z1/(#pixel^p) loop: zold = z if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy if @version==0 z = c*Fn1(z)^p else z = Fn1(z)^p + c endif if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #2 (Julia)" magn = 2 center = (1, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param version caption = "Version" default = 0 enum = "Correct" "Incorrect" hint = "Correct calculates the values of p and c for c*f(z)^p and \ iterates c*f(z)^p. Incorrect uses the same values of c and p \ but iterates f(z)^p + c. It was an interesting mistake." endparam param z1 caption = "Second value z1" default = (1,0) hint = "Sets the second of the three values to use for extrapolation. \ You can also set the third of these using Third value z2. \ The first is set to #pixel." endparam param z2 caption = "Third value z2" default = (2,0) hint = "Sets the third of the three values to use for extrapolation. \ You can also set the second of these using Second value z1. \ The first is set to #pixel." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in c*Fn1(z)^p. Some settings will produce convergence." endfunc switch: type = "MMFA-Extra2M2" version = version z0 = #pixel z2 = z2 test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot Fn1 = Fn1 } MMFB-Extra3M { ; ; These formulas are basically the extrapolation ; of z = f(z)^p + c, given z0, z1 and c. ; We have: ; z1 = f(z0)^p + c ; Hence: ; p = log(z1 - c)/log(f(z0)) ; ; This is the Mandelbrot-style version where z0 ; and z1 are user parameters and c is #pixel. ; ; Created 17th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = @z0 complex fz0 = z complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif if @selfrot == 2 fz0 = fz0 + #pixel endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy complex p = log(@z1-#pixel)/log(Fn1(fz0)) loop: zold = z if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = Fn1(z)^p + #pixel if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #3 (Mandelbrot)" magn = 0.5 center = (0, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param z0 caption = "Starting point z0" default = (2,0) hint = "Sets the first of the two values to use for extrapolation." endparam param z1 caption = "Second value z1" default = (1,0) hint = "Sets the second of the two values to use for extrapolation." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn1(z)^p + c. Some settings will produce convergence." endfunc switch: type = "MMFB-Extra3J" seed = #pixel z1 = z1 test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot Fn1 = Fn1 } MMFB-Extra3J { ; ; These formulas are basically the extrapolation ; of z = f(z)^p + c, given z0, z1 and c. ; We have: ; z1 = f(z0)^p + c ; Hence: ; p = log(z1 - c)/log(f(z0)) ; ; This is the Julia-style version where z0 is #pixel ; and z1 and c (the seed) are user parameters. ; ; Created 17th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel complex fz0 = z complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif if @selfrot == 2 fz0 = fz0 + #pixel endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy complex p = log(@z1-@seed)/log(Fn1(fz0)) loop: zold = z if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = Fn1(z)^p + @seed if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #3 (Julia)" magn = 0.5 center = (0, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param seed caption = "Julia seed" default = (2,0) hint = "Sets the standard Julia seed." endparam param z1 caption = "Second value z1" default = (1,0) hint = "Sets the second of the two values to use for extrapolation. \ In this Julia formula the first value is #pixel." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn1(z)^p + c. Some settings will produce convergence." endfunc switch: type = "MMFB-Extra3M" z0 = #pixel z1 = z1 test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot Fn1 = Fn1 } MMFC-Extra4M { ; ; These formulas are basically the extrapolation ; of z = m*f(z) + c, given z0, z1 and c. ; We have: ; z1 = m*f(z0) + c ; Hence: ; m = (z1 - c)/f(z0) ; ; This is the Mandelbrot-style version where z0 ; and z1 are user parameters and c is #pixel. ; ; Created 18th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = @z0 complex fz0 = z complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif if @selfrot == 2 fz0 = fz0 + #pixel endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy complex m = (@z1-#pixel)/Fn2(Fn1(fz0)^@power) loop: zold = z if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = m*Fn2(Fn1(z)^@power) + #pixel if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #4 (Mandelbrot)" magn = 0.5 center = (0.5, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param z0 caption = "Starting point z0" default = (2,0) hint = "Sets the first of the two values to use for extrapolation." endparam param z1 caption = "Second value z1" default = (1,0) hint = "Sets the second of the two values to use for extrapolation." endparam param power caption = "Power" default = (2,0) hint = "The power (exponent) to use, ie. p in Fn2(Fn1(z)^p)." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn2(Fn1(z)^p). Some settings will produce convergence." endfunc func Fn2 caption = "Function 2" default = ident() hint = "Fn2 in Fn2(Fn1(z)^p). Some settings will produce convergence." endfunc switch: type = "MMFC-Extra4J" seed = #pixel z1 = z1 power = power test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot Fn1 = Fn1 Fn2 = Fn2 } MMFC-Extra4J { ; ; These formulas are basically the extrapolation ; of z = m*f(z) + c, given z0, z1 and c. ; We have: ; z1 = m*f(z0) + c ; Hence: ; m = (z1 - c)/f(z0) ; ; This is the Julia-style version where z0 is #pixel ; and z1 and c (the seed) are user parameters. ; ; Created 18th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel complex fz0 = z complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif if @selfrot == 2 fz0 = fz0 + #pixel endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy complex m = (@z1-@seed)/Fn2(Fn1(fz0)^@power) loop: zold = z if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = m*Fn2(Fn1(z)^@power) + @seed if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #4 (Julia)" magn = 0.5 center = (0, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param seed caption = "Julia seed" default = (2,0) hint = "Sets the standard Julia seed." endparam param z1 caption = "Second value z1" default = (1,0) hint = "Sets the second of the two values to use for extrapolation. \ In this Julia formula the first value is #pixel." endparam param power caption = "Power" default = (2,0) hint = "The power (exponent) to use, ie. p in Fn2(Fn1(z)^p)." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn2(Fn1(z)^p). Some settings will produce convergence." endfunc func Fn2 caption = "Function 2" default = ident() hint = "Fn2 in Fn2(Fn1(z)^p). Some settings will produce convergence." endfunc switch: type = "MMFC-Extra4M" z0 = #pixel z1 = z1 power = power test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot Fn1 = Fn1 Fn2 = Fn2 } MMFD-Extra5M { ; ; These formulas are basically the extrapolation ; of z = c*f(z) + k, given z0, z1 and c. ; We have: ; z1 = c*f(z0) + k ; Hence: ; k = z1 - c*f(z0) ; ; This is the Mandelbrot-style version where z0 ; and z1 are user parameters and c is #pixel. ; ; Created 20th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = @z0 complex fz0 = z complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif if @selfrot == 2 fz0 = fz0 + #pixel endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy complex k = @z1-#pixel*Fn2(Fn1(fz0)^@power) loop: zold = z if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = #pixel*Fn2(Fn1(z)^@power) + k if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #5 (Mandelbrot)" magn = 1 center = (-0.5, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param z0 caption = "Starting point z0" default = (0,0) hint = "Sets the first of the two values to use for extrapolation." endparam param z1 caption = "Second value z1" default = (1,0) hint = "Sets the second of the two values to use for extrapolation." endparam param power caption = "Power" default = (2,0) hint = "The power (exponent) to use, ie. p in Fn2(Fn1(z)^p)." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn2(Fn1(z)^p). Some settings will produce convergence." endfunc func Fn2 caption = "Function 2" default = ident() hint = "Fn2 in Fn2(Fn1(z)^p). Some settings will produce convergence." endfunc switch: type = "MMFD-Extra5J" seed = #pixel z1 = z1 power = power test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot Fn1 = Fn1 Fn2 = Fn2 } MMFD-Extra5J { ; ; These formulas are basically the extrapolation ; of z = c*f(z) + k, given z0, z1 and c. ; We have: ; z1 = c*f(z0) + k ; Hence: ; k = z1 - c*f(z0) ; ; This is the Julia-style version where z0 is #pixel ; and z1 and c (the seed) are user parameters. ; ; Created 18th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel complex fz0 = z complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true if @selfrot > 0 t = cabs(fz0) if t > 0 fz0 = fz0*fz0/t endif if @selfrot == 2 fz0 = fz0 + #pixel endif endif x = real(fz0) y = imag(fz0) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 fz0 = x + flip(y) + @xy complex k = @z1-@seed*Fn2(Fn1(fz0)^@power) loop: zold = z if @sigma == true z=z+zs zs=z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = @seed*Fn2(Fn1(z)^@power) + k if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Extrapolation #5 (Julia)" magn = 0.5 center = (0, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param seed caption = "Julia seed" default = (-0.75,0) hint = "Sets the standard Julia seed." endparam param z1 caption = "Second value z1" default = (1,0) hint = "Sets the second of the two values to use for extrapolation. \ In this Julia formula the first value is #pixel." endparam param power caption = "Power" default = (2,0) hint = "The power (exponent) to use, ie. p in Fn2(Fn1(z)^p)." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn2(Fn1(z)^p). Some settings will produce convergence." endfunc func Fn2 caption = "Function 2" default = ident() hint = "Fn2 in Fn2(Fn1(z)^p). Some settings will produce convergence." endfunc switch: type = "MMFD-Extra5M" z0 = #pixel z1 = z1 power = power test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma selfrot = selfrot Fn1 = Fn1 Fn2 = Fn2 } MMFE-PowerM { ; ; I had the idea for this formula after doing the ; extrapolation formulae. ; This formula is essentially just the standard ; complex formula but with the twist that the power ; is set to #pixel and a multiplier and constant ; are set by user parameters ie. ; z = m*f(z)^#pixel + c ; ; "Iterate the product" added 6th April 2002 ; Created 20th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = @z0 complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) complex zp = (1,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = @s*Fn1(z)^#pixel + @c if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Power (Mandelbrot)" magn = 0.25 center = (0.7, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param z0 caption = "Starting point z0" default = (0,0) hint = "Sets the start value to be iterated." endparam param s caption = "Multiplier m" default = (1,0) hint = "Sets the value of m in m*f(z)^#pixel + c." endparam param c caption = "Constant c" default = (0.5,0) hint = "Sets the value of c in m*f(z)^#pixel + c." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn1(z)^#pixel. Some settings will produce convergence." endfunc switch: type = "MMFE-PowerJ" power = #pixel s = s c = c test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma product = product selfrot = selfrot Fn1 = Fn1 } MMFE-PowerJ { ; ; This is just a fairly standard Julia formula, for use ; with the MMF-Power Mandelbrot formula. ; ; "Iterate the product" added 6th April 2002 ; Created 20th March 2002 ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex z = #pixel complex zold = z float x = real(z) float y = imag(z) float t = x complex zs = (0,0) complex zp = (1,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true loop: zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy z = @s*Fn1(z)^@power + @c if @smallbail != 0 && |z-zold| < @bailout1 bail = false endif bailout: bail && ((@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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Power (Julia)" magn = 1 center = (0, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param power caption = "Power" default = (2,0) hint = "Sets the power (exponent) to use." endparam param s caption = "Multiplier m" default = (1,0) hint = "Sets the value of m in m*f(z)^#pixel + c." endparam param c caption = "Constant c" default = (0.5,0.25) hint = "Sets the value of c in m*f(z)^#pixel + c." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" default = 0 hint = "Enables or disables convergence testing, some settings \ may require convergence testing enabled to produce an image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam func Fn1 caption = "Function 1" default = ident() hint = "Fn1 in Fn1(z)^power. Some settings will produce convergence." endfunc switch: type = "MMFE-PowerM" z0 = #pixel s = s c = c test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 ang = ang xy = xy m = m n = n sigma = sigma product = product selfrot = selfrot Fn1 = Fn1 } MMFF-FormulaWars { ; ; This formula allows you to pit two formulas against ; each other. On each iteration one or other of the ; formulas is used based either on the current value ; of z or on the iteration count (or both are used). ; ; Tips: ; If setting "Formula 1" to a and "Formula 2" to b ; doesn't produce anything worthwhile, it's worth ; trying "Formula 1" set to b and "Formula 2" set to a. ; It's ALWAYS worth trying the different conditions and ; changing the point/distance values or the iteration ; counts when in use. ; If you want to use the Mandelbrot mode as a map of ; the Julias then in many cases it's worth setting the ; "Switch to" parameter to "Mandelbrot" first and using ; the switch to find the critical value of zstart - this ; is generally when the "inside" area of the Mandelbrot ; is largest. ; It's very often interesting to pit a generally divergent ; formula against a convergent one - but remember you may ; need to enable convergence bailout and/or use a non-zero ; zstart value for the Mandelbrot. ; ; Created 1st-3rd April 2002 ; ; November 2004 ; Added convergent Hinrich and the Integrate formula option. ; Try Integrate with 'Iterate the sum'. ; ; (c) Dave Makin (Makin' Magic) ; http://website.lineone.net/~dave_makin/ ; init: complex p = #pixel if @usescale != 1.0 p = p/@usescale endif if @usecentre != (0,0) p = p + @usecentre endif complex z = @startseed complex c = p if @mjmode == 1 z = p c = @startseed endif float x = real(z) float y = imag(z) float t = x complex ztest = z complex ztest1 = z complex zold = z complex zold1 = z complex zolds = z complex zprev = z complex zs = (0,0) complex zp = (1,0) complex zsold = zs complex zpold = zp complex q = zs float v = sqrt(@bailout) float v1 = sqrt(@bailout1) float m = 0 float m1 = 1e100 complex t1 = (0,0) float ang = #pi*@ang/180.0 float ca = cos(ang) float sa = sin(ang) float r0c0 = real(@m)*ca-real(@n)*sa float r0c1 = real(@m)*sa+real(@n)*ca float r1c0 = imag(@m)*ca-imag(@n)*sa float r1c1 = imag(@m)*sa+imag(@n)*ca bool bail = true bool first = true complex sum2 = @nr1 + @nr2 complex pro2 = @nr1*@nr2 complex sum3a = sum2 + @nr3 complex sum3b = pro2 + @nr3*sum2 complex pro3 = pro2*@nr3 complex sum4a = sum3a + @nr4 complex sum4b = sum3b + @nr4*sum3a complex sum4c = pro3 + @nr4*sum3b complex pro4 = pro3*@nr4 complex sum5a = sum4a + @nr5 complex sum5b = sum4b + @nr5*sum4a complex sum5c = sum4c + @nr5*sum4b complex sum5d = pro4 + @nr5*sum4c complex pro5 = pro4*@nr5 complex sum6a = sum5a + @nr6 complex sum6b = sum5b + @nr6*sum5a complex sum6c = sum5c + @nr6*sum5b complex sum6d = sum5d + @nr6*sum5c complex sum6e = pro5 + @nr6*sum5d complex s2um2 = @n2r1 + @n2r2 complex p2ro2 = @n2r1*@n2r2 complex s2um3a = s2um2 + @n2r3 complex s2um3b = p2ro2 + @n2r3*s2um2 complex p2ro3 = p2ro2*@n2r3 complex s2um4a = s2um3a + @n2r4 complex s2um4b = s2um3b + @n2r4*s2um3a complex s2um4c = p2ro3 + @n2r4*s2um3b complex p2ro4 = p2ro3*@n2r4 complex s2um5a = s2um4a + @n2r5 complex s2um5b = s2um4b + @n2r5*s2um4a complex s2um5c = s2um4c + @n2r5*s2um4b complex s2um5d = p2ro4 + @n2r5*s2um4c complex p2ro5 = p2ro4*@n2r5 complex s2um6a = s2um5a + @n2r6 complex s2um6b = s2um5b + @n2r6*s2um5a complex s2um6c = s2um5c + @n2r6*s2um5b complex s2um6d = s2um5d + @n2r6*s2um5c complex s2um6e = p2ro5 + @n2r6*s2um5d int i = 0 int j = 0 int oldi = 0 bool r = true loop: ztest1 = ztest ztest = z zolds = zold zsold = zs zpold = zp oldi = i repeat zprev = z repeat zold1 = zold zold = z if @sigma == true z=z+zs zs=z endif if |z|>0 && @product == true z = z*zp zp = z endif z = @fn2(z) if @selfrot > 0 t = cabs(z) if t > 0 z = z*z/t endif if @selfrot == 2 z = z + #pixel endif endif x = real(z) y = imag(z) t = x x = x*r0c0 + y*r1c0 y = t*r0c1 + y*r1c1 z = x + flip(y) + @xy t1 = zold - @point if (@cond==0 && |t1|<@dist) || \ (@cond==1 && |zold-zold1|<@dist) || \ (@cond==2 && real(t1)*imag(t1)>=0) || \ (@cond==3 && i%(@usef1+@usef2)<@usef1) || \ (@cond==4) || (@cond==5 && real(z)>=imag(z)) || \ (@cond==6 && abs(real(z))>=abs(imag(z))) || \ (@cond==7 && real(zold)>=imag(zold)) || \ (@cond==8 && abs(real(zold))>=abs(imag(zold))) first = true else first = false endif if first==true if @fractal == 0 z = z^@power + c elseif @fractal == 1 z = ((z^2+c-1)/(2*z+c-2))^2 elseif @fractal == 2 z = ((z^3+3*(c-1)*z+(c-1)*(c-2))/(3*z^2+3*(c-2)*z+(c-1)*(c-2)+1))^2 elseif @fractal == 3 z=@Fn(z)+c elseif @fractal == 4 z=1/@Fn(z)+c elseif @fractal == 5 z=z*@Fn(z)+c elseif @fractal == 6 z=(@Fn(z)-c)/z elseif @fractal == 7 z=z/(@Fn(z)-c) elseif @fractal == 8 z=z*@Fn(z)+z+c elseif @fractal == 9 z=@Fn(z)+z*z+c elseif @fractal == 10 z=z*(@Fn(z)+z)+c elseif @fractal == 11 z=c*@Fn(z) elseif @fractal == 12 z=@Fn(z)+z+c elseif @fractal == 13 z=c*@Fn(z)+z elseif @fractal == 14 z = c*z*(1-z) elseif @fractal == 15 z = z*(1-z) + c elseif @fractal == 16 z = @fn1(c*@fn(z)) elseif @fractal == 17 z = @fn1(z*@fn(c)) elseif @fractal == 18 if x >= 0 z = (z-1)*c else z = (z+1)*c endif elseif @fractal == 19 if x*imag(c)+real(c)*y >= 0 z = (z-1)*c else z = (z+1)*c endif elseif @fractal == 20 F = @fn(z) z = @fn1(c*F)/@fn1(F) elseif @fractal == 21 F = @fn(c) z = @fn1(z*F)/@fn1(F) elseif @fractal == 22 z = z^(i+1) + c elseif @fractal == 23 && @ndegree==0 z = z - (z-@nr1)*(z-@nr2)/(2*z-sum2) + c elseif @fractal == 23 && @ndegree==1 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)/(3*z^2 - 2*sum3a*z + sum3b) + c elseif @fractal == 23 && @ndegree==2 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)/(4*z^3 - 3*sum4a*z^2 + 2*sum4b*z - sum4c) + c elseif @fractal == 23 && @ndegree==3 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)*(z-@nr5) \ /(5*z^4 - 4*sum5a*z^3 + 3*sum5b*z^2 - 2*sum5c*z + sum5d) + c elseif @fractal == 23 && @ndegree==4 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)*(z-@nr5)*(z-@nr6) \ /(6*z^5 - 5*sum6a*z^4 + 4*sum6b*z^3 - 3*sum6c*z^2 + 2*sum6d*z - sum6e) + c elseif @fractal == 24 z = z^@power1 + c elseif @fractal == 25 && @ndegree1==0 z = z - (z-@n2r1)*(z-@n2r2)/(2*z-s2um2) + c elseif @fractal == 25 && @ndegree1==1 z = z - (z-@n2r1)*(z-@n2r2)*(z-@n2r3)/(3*z^2 - 2*s2um3a*z + s2um3b) + c elseif @fractal == 25 && @ndegree1==2 z = z - (z-@n2r1)*(z-@n2r2)*(z-@n2r3)*(z-@n2r4)/(4*z^3 - 3*s2um4a*z^2 + 2*s2um4b*z - s2um4c) + c elseif @fractal == 25 && @ndegree1==3 z = z - (z-@n2r1)*(z-@n2r2)*(z-@n2r3)*(z-@n2r4)*(z-@n2r5) \ /(5*z^4 - 4*s2um5a*z^3 + 3*s2um5b*z^2 - 2*s2um5c*z + s2um5d) + c elseif @fractal == 25 && @ndegree1==4 z = z - (z-@n2r1)*(z-@n2r2)*(z-@n2r3)*(z-@n2r4)*(z-@n2r5)*(z-@n2r6) \ /(6*z^5 - 5*s2um6a*z^4 + 4*s2um6b*z^3 - 3*s2um6c*z^2 + 2*s2um6d*z - s2um6e) + c elseif @fractal == 26 z = z^@power + zold1 + c elseif @fractal == 27 z = zold1*z^@power + c elseif @fractal == 28 z = z^@power1 + zold1 + c elseif @fractal == 29 z = zold1*z^@power1 + c elseif @fractal == 30 z = @fn1(@power*@fn(z)) + c elseif @fractal == 31 F = @fn(z) z = @fn1((1+@power)*F)/@fn3(F) + c elseif @fractal == 32 z = @fn1(@power1*@fn(z)) + c elseif @fractal == 33 F = @fn(z) z = @fn1((1+@power1)*F)/@fn3(F) + c endif endif if (first==false) || (@cond==4) if @fractal1 == 0 z = z^@power + c elseif @fractal1 == 1 z = ((z^2+c-1)/(2*z+c-2))^2 elseif @fractal1 == 2 z = ((z^3+3*(c-1)*z+(c-1)*(c-2))/(3*z^2+3*(c-2)*z+(c-1)*(c-2)+1))^2 elseif @fractal1 == 3 z=@Fn(z)+c elseif @fractal1 == 4 z=1/@Fn(z)+c elseif @fractal1 == 5 z=z*@Fn(z)+c elseif @fractal1 == 6 z=(@Fn(z)-c)/z elseif @fractal1 == 7 z=z/(@Fn(z)-c) elseif @fractal1 == 8 z=z*@Fn(z)+z+c elseif @fractal1 == 9 z=@Fn(z)+z*z+c elseif @fractal1 == 10 z=z*(@Fn(z)+z)+c elseif @fractal1 == 11 z=c*@Fn(z) elseif @fractal1 == 12 z=@Fn(z)+z+c elseif @fractal1 == 13 z=c*@Fn(z)+z elseif @fractal1 == 14 z = c*z*(1-z) elseif @fractal1 == 15 z = z*(1-z) + c elseif @fractal1 == 16 z = @fn1(c*@fn(z)) elseif @fractal1 == 17 z = @fn1(z*@fn(c)) elseif @fractal1 == 18 if x >= 0 z = (z-1)*c else z = (z+1)*c endif elseif @fractal1 == 19 if x*imag(c)+real(c)*y >= 0 z = (z-1)*c else z = (z+1)*c endif elseif @fractal1 == 20 F = @fn(z) z = @fn1(c*F)/@fn1(F) elseif @fractal1 == 21 F = @fn(c) z = @fn1(z*F)/@fn1(F) elseif @fractal1 == 22 z = z^(i+1) + c elseif @fractal1 == 23 && @ndegree==0 z = z - (z-@nr1)*(z-@nr2)/(2*z-sum2) + c elseif @fractal1 == 23 && @ndegree==1 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)/(3*z^2 - 2*sum3a*z + sum3b) + c elseif @fractal1 == 23 && @ndegree==2 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)/(4*z^3 - 3*sum4a*z^2 + 2*sum4b*z - sum4c) + c elseif @fractal1 == 23 && @ndegree==3 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)*(z-@nr5) \ /(5*z^4 - 4*sum5a*z^3 + 3*sum5b*z^2 - 2*sum5c*z + sum5d) + c elseif @fractal1 == 23 && @ndegree==4 z = z - (z-@nr1)*(z-@nr2)*(z-@nr3)*(z-@nr4)*(z-@nr5)*(z-@nr6) \ /(6*z^5 - 5*sum6a*z^4 + 4*sum6b*z^3 - 3*sum6c*z^2 + 2*sum6d*z - sum6e) + c elseif @fractal1 == 24 z = z^@power1 + c elseif @fractal1 == 25 && @ndegree1==0 z = z - (z-@n2r1)*(z-@n2r2)/(2*z-s2um2) + c elseif @fractal1 == 25 && @ndegree1==1 z = z - (z-@n2r1)*(z-@n2r2)*(z-@n2r3)/(3*z^2 - 2*s2um3a*z + s2um3b) + c elseif @fractal1 == 25 && @ndegree1==2 z = z - (z-@n2r1)*(z-@n2r2)*(z-@n2r3)*(z-@n2r4)/(4*z^3 - 3*s2um4a*z^2 + 2*s2um4b*z - s2um4c) + c elseif @fractal1 == 25 && @ndegree1==3 z = z - (z-@n2r1)*(z-@n2r2)*(z-@n2r3)*(z-@n2r4)*(z-@n2r5) \ /(5*z^4 - 4*s2um5a*z^3 + 3*s2um5b*z^2 - 2*s2um5c*z + s2um5d) + c elseif @fractal1 == 25 && @ndegree1==4 z = z - (z-@n2r1)*(z-@n2r2)*(z-@n2r3)*(z-@n2r4)*(z-@n2r5)*(z-@n2r6) \ /(6*z^5 - 5*s2um6a*z^4 + 4*s2um6b*z^3 - 3*s2um6c*z^2 + 2*s2um6d*z - s2um6e) + c elseif @fractal1 == 26 z = z^@power + zold1 + c elseif @fractal1 == 27 z = zold1*z^@power + c elseif @fractal1 == 28 z = z^@power1 + zold1 + c elseif @fractal1 == 29 z = zold1*z^@power1 + c elseif @fractal1 == 30 z = @fn1(@power*@fn(z)) + c elseif @fractal1 == 31 F = @fn(z) z = @fn1((1+@power)*F)/@fn3(F) + c elseif @fractal1 == 32 z = @fn1(@power1*@fn(z)) + c elseif @fractal1 == 33 F = @fn(z) z = @fn1((1+@power1)*F)/@fn3(F) + c endif endif i = i + 1 until @cond != 3 || @alliter==false || i%(@usef1+@usef2)==0 if r m = |z| if @smallbail != 0 && |z-ztest| < @bailout1 if @smallbail < 2 || |z-1.0| < @bailout1 m1 = |z - ztest| endif endif endif if (@smooth>0) if (m>@bailout)&&((@smooth<9)||(@smooth>12)) if r r = false q = z z = v*ztest/cabs(ztest) zold = zolds i = oldi if @sigma == true zs = zsold endif if @product == true zp = zpold endif else r = true if @smooth>4 x = log(0.5*log(|z|)) x = (x-log(0.5*log(|q|)))/(x-log(log(v))) if (x<0) x = 0 elseif x>1 x = 1 endif z = x else z = (z-q)/(z-v*q/sqrt(m)) if @smooth==1 || @smooth == 3 z = z^@fudge else z = ((@fudge^z)-1)/(@fudge-1) endif endif if @smooth==7 || @smooth==8 || @smooth>14 z = z + flip(atan2(q)) endif if @smooth==3 || @smooth==4 || @smooth==6 || @smooth==8 \ || @smooth==14 || @smooth==16 z = j + z endif if @smooth<5 z = (real(z)+flip(@fudge1*imag(z)))/@fudge2 endif bail = false endif elseif (@smooth>8)&&(@smallbail>0)&&(m1<@bailout1) if r r = false q = z-ztest z = ztest+(v1*(z-ztest))/cabs(ztest-ztest1) zold = zolds i = oldi if @sigma == true zs = zsold endif if @product == true zp = zpold endif else r = true x = log(-0.5*log(|z-zprev|)) x = -@cfudge*((x+log(-0.5*log(|q|)))/(x+log(-0.5*log(@bailout1)))-1) if x>=0 x = -1e-100 elseif x<-1.0 x = -1.0 endif if @smooth==11 || @smooth==12 || @smooth==15 || @smooth==16 z = flip(atan2(q)) endif if @smooth==10 || @smooth==12 || @smooth==14 || @smooth==16 x = x + j endif z = x + flip(imag(z)) bail = false endif endif endif until r if @smallbail != 0 && m1 < @bailout1 if @smallbail < 2 || |z-1.0| < @bailout1 bail = false endif endif j = j + 1 bailout: bail && ((@test == 0 && m <= @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)) || \ (@test == 7 && (abs(sqr(real(z))/imag(z)) <= @bailout)) || \ (@test == 8 && (abs(sqr(imag(z))/real(z)) <= @bailout)) || \ (@test == 9 && (sqr(real(z))/imag(z) <= @bailout)) || \ (@test == 10 && (sqr(imag(z))/real(z) <= @bailout))) default: title = "Formula Wars" magn = 1.0 center = (-.5, 0) method = multipass periodicity = 0 helpfile = "MMF.html" param fractal caption = "Formula 1" enum = "Standard z^p+c" "Magnet1" "Magnet2" "Fn+c" "1/Fn+c" "z*Fn+c" \ "(Fn-c)/z" "z/(Fn-c)" "z*Fn+z+c" "Fn+z^2+c" "z*(Fn+z)+c" \ "c*Fn" "Fn+z+c" "c*Fn+z" "Lambda" "Breeder" \ "Cheb fn1(c*fn(z))" "Cheb1 fn1(z*fn(c))" "Barnsley 1" \ "Barnsley 2" "fn1(cfn(z))/fn1(fn(z))" "fn1(zfn(c))/fn1(fn(c))" \ "z^iter + c" "Nova" "z^p+c (#2)" "Nova (#2)" "Manowar" \ "zold*z^p+c" "Manowar (#2)" "zold*z^p+c (#2)" "Cheb1 power" \ "Cheb2 power" "Cheb1 power(#2)" "Cheb2 power(#2)" hint = "Some settings require convergence testing enabled, also \ sometimes a non-zero starting point is necessary for the \ Mandelbrot." default = 0 endparam param fractal1 caption = "Formula 2" enum = "Standard z^p+c" "Magnet1" "Magnet2" "Fn+c" "1/Fn+c" "z*Fn+c" \ "(Fn-c)/z" "z/(Fn-c)" "z*Fn+z+c" "Fn+z^2+c" "z*(Fn+z)+c" \ "c*Fn" "Fn+z+c" "c*Fn+z" "Lambda" "Breeder" \ "Cheb fn1(c*fn(z))" "Cheb1 fn1(z*fn(c))" "Barnsley 1" \ "Barnsley 2" "fn1(cfn(z))/fn1(fn(z))" "fn1(zfn(c))/fn1(fn(c))" \ "z^iter + c" "Nova" "z^p+c (#2)" "Nova (#2)" "Manowar" \ "zold*z^p+c" "Manowar (#2)" "zold*z^p+c (#2)" "Cheb1 power" \ "Cheb2 power" "Cheb1 power(#2)" "Cheb2 power(#2)" hint = "Some settings require convergence testing enabled, also \ sometimes a non-zero starting point is necessary for the \ Mandelbrot." default = 16 endparam param startseed caption = "Start/seed" default = (0,0) hint = "Perturbation of start Z if in Mandelbrot mode, the seed if \ in Julia mode." endparam param cond caption = "Condition" default = 3 enum = "Point distance" "z-zold" "Quadrant" "Iteration" "Use both" \ "real(z)>=imag(z)" "abs(real(z))>=abs(imag(z))" "zr>=zi (fixed)" \ "abs(zr)>=abs(zi) (fixed)" hint = "If using Point distance and cabs(z-Critical point)^2 is less than \ the Critical distance OR if using z-zold and cabs(z-zold)^2 is less \ than the Critical distance then Formula 1 is used otherwise \ Formula 2 is used." endparam param point caption = "Critical point" default = (0,0) hint = "When using the Point distance condition if the square of the distace \ of z from this point is less than the Critical distance parameter then \ Formula 1 is used, otherwise Formula 2 is used." endparam param dist caption = "Critical distance" default = 1.0 hint = "If the value calculated for z based on the current Condition is less \ than this then Formula 1 is used, otherwise Formula 2 is used." endparam param usef1 caption = "Formula 1 count" default = 2 min = 1 hint = "Sets the number of consecutive iterations for which to use Formula 1, \ only applies to Condition-Iteration. Note that the first iteration/s \ use Formula 1, then Formula 2 etc." endparam param usef2 caption = "Formula 2 count" default = 1 min = 1 hint = "Sets the number of consecutive iterations for which to use Formula 2, \ only applies to Condition-Iteration. Note that the first iteration/s \ use Formula 1, then Formula 2 etc." endparam param alliter caption = "All iterations" default = false hint = "When enabled and using Condition-Iteration then a whole pass of Formula 1 \ then Formula 2 is executed before testing for bailout. Using this with \ large totals of Formula 1 count + Formula 2 count will result in slow \ calculation times." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "abs(x*x/y)" \ "abs(y*y/x)" "x*x/y" "y*y/x" hint = "Modifies the divergent bailout test condition, some modes \ will require smaller bailout values to produce a good effect. \ 'x*x/y' and 'y*y/x' were added for MMFrac compatibility." endparam param bailout caption = "Bailout value" default = 65536.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the Mandelbrot set anymore." endparam param smallbail caption = "Convergence" enum = "disabled" "enabled" "Magnet (1,0)" default = 0 hint = "Enables or disables convergence testing, some fractal \ types or other settings may require convergence testing \ to be enabled to produce any image." endparam param bailout1 caption = "Small bailout" default = 1e-5 hint = "Bailout for detecting convergence." endparam param smooth caption = "Smooth colouring" default = 0 enum = "Off" "Smooth#1" "Smooth#2" "+Iter#1" "+Iter#2" \ "loglog" "loglog+Iter" \ "Frac+Atan" "Frac+Atan+Iter" \ "Hinrich (Conv)" "Hinrich+Iter (Conv)" \ "Hinrich+Atan (Conv)" "Hinrich+Atan+Iter(Conv)" \ "Hinrich (Both)" "Hinrich+Iter (Both)" \ "Hinrich+Atan (Both)" "Hinrich+Atan+Iter(Both)" hint = "Modifies the final z value so it's a smoothing \ value. Use for colourings that are based on \ final z or for ones that use a final z smoothing fraction. \ The new Hinrich versions work best, note that the Divergent \ Hinrich versions still have the old names - loglog or Frac+." endparam param cfudge caption = "Convergent fudge" default = 1.0 hint = "Scaling factor for when the convergence smoothing fraction \ doesn't go all the way from 0 to 1." endparam param fudge caption = "Smooth fudge" default = 10.0 hint = "Use this in combination with the Smooth colouring variations \ to get the colouring as smooth as possible. Typically use \ values 2 - 200, but sometimes very large values, fractions \ or negative values may help. Not needed for the loglog smoothing." endparam param fudge1 caption = "Smooth scale imag" default = 100.0 hint = "This only applies when using the Smooth colouring. Use \ it to scale up the imaginary component of the final z, this \ will improve results with some colourings. \ Not used for loglog smoothing." endparam param fudge2 caption = "Smooth divide" default = 1.0 hint = "This only applies when using the Smooth colouring. The final z \ value is divided by this value, eg. set it to Maximum Iterations. \ Not used for loglog smoothing." endparam param power caption = "Power" default = (2,0) hint = "Sets the power for the z^p+c formula type." endparam param ndegree caption = "Nova degree" default = 1 enum = "2" "3" "4" "5" "6" hint = "Sets the degree used for the Nova formula type and \ hence the number of roots used." endparam param nr1 caption = "Nova 1st root" default = (1,0) hint = "Modify for different Nova fractals, used for all \ values of Nova degree." endparam param nr2 caption = "Nova 2nd root" default = (-0.5,0.8660254) hint = "Modify for different Nova fractals, used for all \ values of Nova degree." endparam param nr3 caption = "Nova 3rd root" default = (-0.5,-0.8660254) hint = "Modify for different Nova fractals, used when \ Nova degree is 3 or more." endparam param nr4 caption = "Nova 4th root" default = (-1,0) hint = "Modify for different Nova fractals, used when \ Nova degree is 4 or more." endparam param nr5 caption = "Nova 5th root" default = (0.5,0.8660254) hint = "Modify for different Nova fractals, used when \ Nova degree is 5 or 6." endparam param nr6 caption = "Nova 6th root" default = (0.5,-0.8660254) hint = "Modify for different Nova fractals, used when \ Nova degree is 6." endparam param power1 caption = "Power (#2)" default = (3,0) hint = "Sets the power for the z^p+c (#2) formula type." endparam param ndegree1 caption = "Nova degree (#2)" default = 2 enum = "2" "3" "4" "5" "6" hint = "Sets the degree used for the Nova (#2) formula type and \ hence the number of roots used." endparam param n2r1 caption = "Nova (#2) 1st root" default = (2,0) hint = "Modify for different Nova fractals, used for all \ values of Nova degree (#2)." endparam param n2r2 caption = "Nova (#2) 2nd root" default = (-2,0) hint = "Modify for different Nova fractals, used for all \ values of Nova degree (#2)." endparam param n2r3 caption = "Nova (#2) 3rd root" default = (0,2) hint = "Modify for different Nova fractals, used when \ Nova degree (#2) is 3 or more." endparam param n2r4 caption = "Nova (#2) 4th root" default = (0,-2) hint = "Modify for different Nova fractals, used when \ Nova degree (#2) is 4 or more." endparam param n2r5 caption = "Nova (#2) 5th root" default = (1.5,1.5) hint = "Modify for different Nova fractals, used when \ Nova degree (#2) is 5 or 6." endparam param n2r6 caption = "Nova (#2) 6th root" default = (-1.5,-1.5) hint = "Modify for different Nova fractals, used when \ Nova degree (#2) is 6." endparam param ang caption = "Rotation (degrees)" default = 0.0 hint = "Rotational transformation applied at each \ iteration. Can be used in combination with \ the translations and general transformation \ matrix." endparam param xy caption = "Translation" default = (0,0) hint = "Translates (moves) the z value at each iteration." endparam param m caption = "Matrix col 0" default = (1,0) hint = "Column 0 of a generalised \ transformation matrix - use (1,0) \ for the identity matrix." endparam param n caption = "Matrix col 1" default = (0,1) hint = "Column 1 of a generalised \ transformation matrix - use (0,1) \ for the identity matrix." endparam param sigma caption = "Iterate the sum" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0+z1), z3=f(z0+z1+z2) etc. " endparam param product caption = "Iterate the product" default = false hint = "When enabled instead of z1=f(z0), z2=f(z1), z3=f(z2) etc. \ z1=f(z0), z2=f(z0*z1), z3=f(z0*z1*z2) etc. The process is \ fudged slightly if zn is zero at any time." endparam param selfrot caption = "Self-rotation" default = 0 enum = "Disabled" "Enabled" "Plus c" hint = "When enabled z is rotated by atan2(z) at the start of each iteration. \ Plus c does the same but also adds #pixel to the rotated value, it's \ only here as it produces some interesting results." endparam param usescale caption = "Current scale adjust" default = 1.0 hint = "Used for switching in combination with the Switch scale adjust. \ After switching you should really set this value back to 1.0." endparam param usecentre caption = "Current centre adjust" default = (0,0) hint = "Used for switching in combination with the Switch centre adjust. \ After switching you should really set this value back to (0,0)." endparam param mjmode caption = "Current mode" default = 0 enum = "Mandelbrot" "Julia" hint = "This parameter works in combination with the Switch to parameter \ and should not be altered directly." endparam param swscale caption = "Switch scale adjust" default = 1.0 hint = "Used for switching in combination with the Current scale adjust. \ Modify the value to zoom the switch preview. 01.0 will magnify the switch. Particularly \ useful for finding interesting small Julias." endparam param swcentre caption = "Switch centre adjust" default = (0,0) hint = "Used for switching in combination with the Current centre adjust. \ Modify the value to centre the switch preview. Particularly useful \ for finding interesting small Julias." endparam param swmode caption = "Switch to" default = 1 enum = "Mandelbrot" "Julia" hint = "Use this to specify which Fractal mode you wish UF's switch facility \ to switch to. You can use Switch to Mandelbrot to find a Mandelbrot \ for which zstart is close to the critical value (generally when the \ inside area is largest)." endparam func Fn caption = "Fn (all Fn types)" default = acos() hint = "Some settings will only produce convergence, \ or require a non-zero start value. \ Use 'acos' with the Chebyshev types for the \ standard Chebyshev polynomials." endfunc func Fn1 caption = "Fn1 (Chebyshevs)" default = cos() hint = "Some settings will only produce convergence, \ or require a non-zero start value. \ Use 'cos' with 'Cheb' and 'Cheb1' for the type 1 \ Chebyshev polynomials, use 'sin' with the \ 'fn1(a*fn(b))/fn1(fn(b))' types for the type 2 \ Chebyshev polynomials." endfunc func Fn2 caption = "Fn2 (done first)" default = ident() hint = "Try using Conj or Flip." endfunc func Fn3 caption = "Fn3 (Cheb2 (Power))" default = sin() hint = "Only used for the Cheb2 (Power) fractal type. This is \ of the form 'Fn1((power+1)*Fn(z))/Fn3(Fn(z)) + c'." endfunc switch: type = "MMFF-FormulaWars" startseed = #pixel fractal = fractal fractal1 = fractal1 cond = cond point = point dist = dist usef1 = usef1 usef2 = usef2 alliter = alliter test = test bailout = bailout smallbail = smallbail bailout1 = bailout1 smooth = smooth cfudge = cfudge fudge = fudge fudge1 = fudge1 fudge2 = fudge2 power = power ndegree = ndegree nr1 = nr1 nr2 = nr2 nr3 = nr3 nr4 = nr4 nr5 = nr5 nr6 = nr6 power1 = power1 ndegree1 = ndegree1 n2r1 = n2r1 n2r2 = n2r2 n2r3 = n2r3 n2r4 = n2r4 n2r5 = n2r5 n2r6 = n2r6 ang = ang xy = xy m = m n = n sigma = sigma product = product selfrot = selfrot usescale = swscale usecentre = swcentre mjmode = swmode swscale = usescale swcentre = usecentre swmode = mjmode Fn = Fn Fn1 = Fn1 Fn2 = Fn2 }