Magnitude Expression 

Magnitude Expression Properties PageThe Fractal Science Kit fractal generator Magnitude Expression page is used to set the Magnitude distance metric and defines how to compute the magnitude of a point. See also: When you set the Magnitude (distance metric) property on the Mandelbrot / Julia / Newton properties page to Magnitude Expression, the Magnitude Expression properties page is activated (made visible) in the page hierarchy on the left and you can select it to view the page.
The Magnitude Expression section defines how to compute the magnitude of a point. Example: magnitude = z.x^2 + z.y^2 This setting sums the squares of the z.x and z.y coordinates and assigns the result to the variable magnitude. This is identical to the default Magnitude setting. A positive real value is required. If magnitude is complex, the imaginary component of magnitude is ignored. If magnitude is negative, the absolute value of magnitude is used instead. Builtin Variables:
The variable magnitude is used to return the magnitude of the point z. All of the remaining variables are readonly. z is the current orbit point. c is the pixel value for Mandelbrot fractals and the Julia Constant for Julia fractals. dwell is the current dwell value. On the 1^{st} iteration, dwell=0, on the 2^{nd} iteration, dwell=1, and so on. pixel is the point on the complex plane associated with the orbit. zprev1 and zprev2 are the previous 2 values of z in the current orbit. In addition to zprev1 and zprev2, you can access the entire set of orbit points using the Orbit Functions. Example: if (Orbit.Count() < 4) { This example sets the magnitude to the AbsSqr of the CircumCenter of the last 3 orbit points. Because this is executed inside the fractal iteration, it will have a significant impact on performance so try to avoid expensive processing. Finally, if you use the Magnitude Expression with convergent fractals, you should return a magnitude relative to the previous orbit point not relative to the origin as in the previous examples. Example dz = z  zprev1 This is the default magnitude used for convergent fractals. First, dz is assigned the relative difference of the orbit point z from the previous orbit point zprev1. Then dz is used in the magnitude calculation. This is typical for convergent fractals. 
Copyright © 20042019 Ross Hilbert 