NewtonPolynomial { ; ; Version of Newton fractal. ; init: z = pixel loop: zold = z z = @a * (@c1 * z ^ @power1 + @c2 * z ^ @power2 + @c3 * z ^ @power3 + @c4 * z ^ @power4 + @r) / (@power1 * @c1 * z ^ (@power1 - 1) + @power2 * @c2 * z ^ (@power2 - 1) + @power3 * @c3 * z ^ (@power3 - 1) + @power4 * @c4 * z ^ (@power4 - 1)) bailout: |z - zold| >= @bailout default: title = "Newton Polynomial" maxiter = 100 param a default = (7,0) endparam param power1 default = (8, 0) endparam param c1 default = (1, 0) hint = "Coefficient for power1 term." endparam param power2 default = (4, 0) endparam param c2 default = (15, 0) hint = "Coefficient for power2 term." endparam param power3 default = (3, 0) endparam param c3 default = (0, 0) hint = "Coefficient for power3 term." endparam param power4 default = (2, 0) endparam param c4 default = (0, 0) hint = "Coefficient for power4 term." endparam param r caption = "Root" default = (-1,0) hint = "Specifies the root of the equation that is solved. Use larger \ numbers for slower convergence." endparam param bailout caption = "Bailout value" default = 0.03 min = 0 \$IFDEF VER40 exponential = true \$ENDIF hint = "This parameter defines how soon a convergent orbit bails out while \ iterating. Smaller values give more precise results but usually \ require more iterations." endparam } NewtonFunctions { ; ; Version of Newton fractal. ; init: z = pixel loop: zold = z deriv = 0 + 0i zcur = @r if @c1 != 0 + 0i zcur = zcur + (@power1 - 1) * @c1 * z ^ @power1 deriv = deriv + @power1 * @c1 * z ^ (@power1 - 1) endif if @cSin != 0 + 0i zcur = zcur + @cSin * sin(z) ^ @powerSin deriv = deriv + @powerSin * @cSin * sin(z) ^ (@powerSin - 1) * cos(z) endif if @cCos != 0 + 0i zcur = zcur + @cCos * cos(z) ^ @powerCos deriv = deriv + @powerCos * @cCos * cos(z) ^ (@powerCos - 1) * sin(z) endif if @cTan != 0 + 0i zcur = zcur + @cTan * tan(z) ^ @powerTan deriv = deriv + @powerTan * @cTan * tan(z) ^ (@powerTan - 1) * (1 + tan(z) ^ 2) endif if @cSinh != 0 + 0i zcur = zcur + @cSinh * sinh(z) ^ @powerSinh deriv = deriv + @powerSinh * @cSinh * (sinh(z) ^ (@powerSinh - 1)) * cosh(z) endif if @cCosh != 0 + 0i zcur = zcur + @cCosh * (cosh(z) ^ @powerCosh) deriv = deriv + @powerCosh * @cCosh * (cosh(z) ^ (@powerCosh - 1)) * sinh(z) endif if @cTanh != 0 + 0i zcur = zcur + @cTanh * tanh(z) ^ @powerTanh deriv = deriv + @powerTanh * @cTanh * tanh(z) ^ (@powerTanh - 1) * (1 - tanh(z) ^ 2) endif if @cLog != 0 + 0i zcur = zcur + @cLog * log(z) ^ @powerLog deriv = deriv + @powerLog * @cLog * log(z) ^ (@powerLog - 1) / z endif if @cExp != 0 + 0i f = @cExp * exp(z * @powerExp) zcur = zcur + f deriv = deriv + @powerExp * f endif z = @a * zcur / deriv bailout: |z - zold| >= @bailout default: title = "Newton Functions" maxiter = 100 param a default = (1,0) endparam param power1 default = (3, 0) endparam param c1 default = (1, 0) hint = "Coefficient for z term." endparam param powerSin default = (1, 0) endparam param cSin default = (0, 0) hint = "Coefficient for sin(z) term." endparam param powerCos default = (1, 0) endparam param cCos default = (0, 0) hint = "Coefficient for cos(z) term." endparam param powerTan default = (1, 0) endparam param cTan default = (0, 0) hint = "Coefficient for tan(z) term." endparam param powerSinh default = (1, 0) endparam param cSinh default = (0, 0) hint = "Coefficient for sinh(z) term." endparam param powerCosh default = (1, 0) endparam param cCosh default = (0, 0) hint = "Coefficient for cosh(z) term." endparam param powerTanh default = (1, 0) endparam param cTanh default = (0, 0) hint = "Coefficient for tanh(z) term." endparam param powerLog default = (1, 0) endparam param cLog default = (0, 0) hint = "Coefficient for log(z) term." endparam param powerExp default = (1, 0) endparam param cExp default = (0, 0) hint = "Coefficient for exp(z) term." endparam param r caption = "Root" default = (1,0) hint = "Specifies the root of the equation that is solved. Use larger \ numbers for slower convergence." endparam param bailout caption = "Bailout value" default = 0.00001 min = 0 \$IFDEF VER40 exponential = true \$ENDIF hint = "This parameter defines how soon a convergent orbit bails out while \ iterating. Smaller values give more precise results but usually \ require more iterations." endparam }