Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master with latest code #158

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 203 additions & 0 deletions hc/src/help2.src
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ SUMMARY OF FRACTAL TYPES
or stop at the edge. The 6th parameter is a random seed. You can slow
down the ants to see them better using the <P> screen Orbit Delay.

{=HT_ARTMATRIXCUBIC artmatrixcubic}
~Label=HF_ARTMATRIXCUBIC
Taken from the original Fortran code by Art Matrix 1997.
There are 4 varieties.
Two parameters: subtype and @special@ colour.

{=HT_BARNS barnsleyj1}
~Label=HF_BARNSJ1
z(0) = pixel;
Expand Down Expand Up @@ -119,6 +125,15 @@ SUMMARY OF FRACTAL TYPES
Three parameters: Filter Cycles, Seed Population, and Beta.

~OnlineFF
{=HT_BURNINGSHIP burningship}
~Label=HF_BURNINGSHIP
Classic Mandelbrot Derivative fractal.
z(0) = c = pixel;
real(tmp) = sqr(real(z(n))) - sqr(imag(z(n)))
imag(tmp) = abs(real(z(n)) * imag(z(n))) * -2.0
z(n+1) = tmp + c.
Three parameters: perturbations of z(0) and degree.

{=HT_CELLULAR cellular}
~Label=HF_CELLULAR
One-dimensional cellular automata or line automata. The type of CA
Expand All @@ -129,6 +144,15 @@ SUMMARY OF FRACTAL TYPES
For Type = 21, 31, 41, 51, 61, 22, 32, 42, 23, 33, 24, 25, 26, 27
Rule = 4, 7, 10, 13, 16, 6, 11, 16, 8, 15, 10, 12, 14, 16 digits

{=HT_CELTIC celtic}
~Label=HF_CELTIC
Mandelbrot Derivative fractal.
z(0) = c = pixel;
real(tmp) = abs(sqr(real(z(n))) - sqr(imag(z(n))))
imag(tmp) = real(z(n)) * imag(z(n)) * 2.0
z(n+1) = tmp + c.
Three parameters: perturbations of z(0) and degree.

{=HT_MARTIN chip}
~Label=HF_CHIP
Chip attractor from Michael Peters - orbit in two dimensions.
Expand Down Expand Up @@ -523,6 +547,15 @@ SUMMARY OF FRACTAL TYPES
z(n+1) = z(n)^2 + c.
Two parameters: real & imaginary perturbations of z(0).

{=HT_MANDELBAR mandelbar}
~Label=HF_MANDELBAR
Mandelbrot Derivative fractal. Also called Tricorn.
z(0) = c = pixel;
real(tmp) = sqr(real(z(n))) - sqr(imag(z(n)))
imag(tmp) = real(z(n)) * imag(z(n)) * -2.0
z(n+1) = tmp + c.
Three parameters: perturbations of z(0) and degree.

{=HT_FNORFN mandel(fn||fn)}
~Label=HF_MANDELFNFN
c = pixel;
Expand Down Expand Up @@ -701,6 +734,64 @@ SUMMARY OF FRACTAL TYPES
z(n+1) = ((p-1)*z(n)^p + 1)/(p*z(n)^(p - 1)).
One parameter: the polynomial degree p.

~OnlineFF
{=HT_NEWTONAPPLE newton_apple}
~Label=HF_NEWTONAPPLE
Based on the Newton formula for finding the roots of z^p - 1.
Standard colouring methods are used.
z(0) = pixel;
a = pixel * z^(n-1) * n - (z^(n-2) * (n - 1))) - z^(n-3) * (n - 2);
e = z^(n-3) * (n - 1) * (n - 2);
b = pixel * f1n * n * (n - 1) - e - f3n * (n - 2) * (n - 3);
z = z - a / b;
Parameters: real & imaginary perturbations of z(0), degree.

{=HT_NEWTONCROSS newton_cross}
~Label=HF_NEWTONCROSS
Based on the Newton formula for finding the roots of z^p - 1.
Standard colouring methods are used.
z(0) = pixel;
a = z^(n - 1) * (n - 1) + pixel * z^(n - 1) - 1.0;
b = z^(n - 3) * (N - 2) * (n - 1) + pixel * z^(n-2) * n * (n - 1);
z = z - a / b;
Parameters: real & imaginary perturbations of z(0), degree.

{=HT_NEWTONFLOWER newton_flower}
~Label=HF_NEWTONFLOWER
Based on the Newton formula for finding the roots of z^p - 1.
Standard colouring methods are used.
z(0) = pixel;
a = z^(n - 1) * pixel + z^n - z;
b = z^(n - 1) * n + pixel * (z^(n - 2) * (n - 1)) - 1.0;
z = z - a / b;
Parameters: real & imaginary perturbations of z(0), degree.

{=HT_NEWTONPOLYGON newton_polygon}
~Label=HF_NEWTONPOLYGON
Based on the Newton formula for finding the roots of z^p - 1.
Standard colouring methods are used.
z(0) = pixel;
a = z^(n - 1) * pixel + fn + *z + pixel;
b = z^(n - 1) * n + 1.0 + pixel * (z^(n - 2) * (n - 1));
z = z - a / b;
Parameters: real & imaginary perturbations of z(0), degree.

{=HT_NEWTONVARIATION newt_variation}
~Label=HF_NEWTONVARIATION
Based on the Newton formula for finding the roots of z^p - 1.
Standard colouring methods are used.
z(0) = pixel;
z = ((z*z*z-z-1)/(3*z*z-1)-z)*pixel;
Parameters: real & imaginary perturbations of z(0).

{=HT_NEWTONNOVA nova}
~Label=HF_NEWTONNOVA
Based on the Newton formula for finding the roots of z^p - 1.
Standard colouring methods are used.
z(0) = pixel;
z = z - ((z*z^2 - 1) / (z^2 * 3)) + pixel;
Parameters: real & imaginary perturbations of z(0).

~OnlineFF
{=HT_PHOENIX phoenix}
~Label=HF_PHOENIX
Expand Down Expand Up @@ -780,6 +871,18 @@ SUMMARY OF FRACTAL TYPES
Four parameters: c, ci, cj, ck
c = (c1,ci,cj,ck)

{=HT_QUARTET nova}
~Label=HF_QUARTET
An iteresting suite of newton fractals.
z2=2; z=z*z*z*z+z2+c; z2=z1
z2=z; z=z*z*z*z+5*z2*c; z2=z1
t=0; z1=z; z=z*z*z-t*t*t+c; z=z1
t=0; z1=z; z=z*z*z*z-t*t*t*t+c; t=z1
z2=z; z=(z^4)+c; c=z2
z1=z; z=z*z*z*z-z2+c; z2 = z1
z1=z; z=z*z*z*z+z2/2+c;; z2=z1
Parameters: real & imaginary perturbations of z(0), degree and version.

{=HT_QUAT quat}
~Label=HF_QUAT
Quaternion Mandelbrot set.
Expand Down Expand Up @@ -824,6 +927,13 @@ SUMMARY OF FRACTAL TYPES
z(n+1) = fn(z(n))^2
One parameter: the function fn.

{=HT_TALIS talis}
~Label=HF_TALIS
Based on the Newton formula for finding the roots of z^p - 1.
z(0) = pixel;
z = (z^(n - 1) * z) / (m + z^(n - 1)) + pixel;
Parameters: real & imaginary perturbations of z(0), degree and m.

{=HT_TEST test}
~Label=HF_TEST
'test' point letting us (and you!) easily add fractal types via
Expand Down Expand Up @@ -2341,6 +2451,99 @@ author of "A Hypercomplex Calculus with Applications to Relativity"
See also {Quaternion} and { Quaternion and Hypercomplex Algebra }
;
;
~Topic=BURNINGSHIP, Label=HT_BURNINGSHIP
(type=burningship)

~Topic=MANDELBAR, Label=HT_MANDELBAR
(type=mandelbar)

~Topic=CELTIC, Label=HT_CELTIC
(type=celtic)

These fractals are derivatives of the classic Mandelbrot fractal with a twist.
Some parts use absolute values in the equations and give an amazing variety
of new fractals.
;
;
~Topic=NEWTONAPPLE, Label=HT_NEWTONAPPLE
(type=newton_apple)

~Topic=NEWTONCROSS, Label=HT_NEWTONCROSS
(type=newton_cross)

~Topic=NEWTONFLOWER, Label=HT_NEWTONFLOWER
(type=newton_flower)

~Topic=NEWTONPOLYGON, Label=HT_NEWTONPOLYGON
(type=newton_polygon)

~Topic=NEWTONVARIATION, Label=HT_NEWTONVARIATION
(type=newt_variation)

~Topic=NEWTONNOVA, Label=HT_NEWTONNOVA
(type=nova)

~Topic=QUARTET, Label=HT_QUARTET
(type=quartet)

~Topic=TALIS, Label=HT_TALIS
(type=talis)

The Newton method is a numerical method of solving for
the roots of real or complex valued polynomial equations.
An initial guess is made at a root and then the method is
iterated, producing new values that (hopefully) converge
to a root of the equation.

The traditional Newton fractal is similar to a Julia set
in that the pixel values are used as the initial values
(or guesses). A typical equation that is used to produce
a traditional Newton fractal is:

Z^3 - 1 = 0

On the other hand, what I call the Newton Mset method
solves for the roots of an equation in which the pixel
value appears in the equation. For example, in this
equation the pixel value is denoted as C:

Z^3 + C*Z^2 - Z + C = 0

Because C has a different value for every pixel, the
method actually solves a different equation for every
pixel. Now the question is what to use for the initial
guess for each solution. The answer is to use one of
the "critical points." These are the values of Z for
which the second derivative vanishes and can be found
by setting the second derivative of the equation to
zero and solving for Z. In the example equation
above:

The function: f(Z) = Z^3 + C*Z^2 - Z + C
The first derivative: f'(Z) = 3*Z^2 + 2*C*Z - 1
The second derivative: f''(Z) = 6*Z + 2*C
Therefore, setting 6*Z + 2*C = 0 we have Z = -C/3

The variable Z is initialized to -C/3 prior to the
iteration loop. From there, everything proceeds as
usual using the general Newton Method formula:

Z[n+1] = Z[n] - f(Z[n]) / f'(Z[n])

A root is assumed to be found when Z[n] and Z[n+1] are
very close together.

In the Newton Mset fractals that I will be posting the
colors of the pixels have nothing to do with which
root a pixel converged to, unlike the more traditional
coloring method.
;
;
~Topic=ARTMATRIXCUBIC, Label=HT_ARTMATRIXCUBIC
(type=artmatrixcubic)
;
;
;
~Topic=Cellular Automata, Label=HT_CELLULAR
(type=cellular)

Expand Down
6 changes: 6 additions & 0 deletions libid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ add_library(libid
3d.cpp include/3d.h
line3d.cpp include/line3d.h
plot3d.cpp include/plot3d.h
pert_engine.cpp include/pert_engine.h
pert_function.cpp
perturbation.cpp
include/point.h
complex.cpp include/complex.h
tierazon_functions.cpp include/tierazon.h

boundary_trace.cpp include/boundary_trace.h
calc_frac_init.cpp include/calc_frac_init.h
Expand Down
12 changes: 9 additions & 3 deletions libid/calcfrac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

// routines in this module
static void perform_worklist();
static int potential(double, long);
int potential(double, long); // no longer static as it is called by perturbation

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this declaration from calcfrac.cpp to calcfrac.h and delete the comment

static void decomposition();
static void setsymmetry(symmetry_type sym, bool uselist);
static bool xsym_split(int xaxis_row, bool xaxis_between);
Expand Down Expand Up @@ -1194,14 +1194,20 @@ static void perform_worklist()
boundary_trace();
break;
case 'g':
solid_guess();
if (g_calc_status != calc_status_value::COMPLETED) // horrible cludge preventing crash when

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark the comment with TODO so we can find it as a cleanup item later.

Always use {} to surround statements in control blocks (e.g. if, while, etc.) like this:

if (g_calc_status != calc_status_value::COMPLETED)
{
    solid_guess();
}

// coming back from perturbation and math = bignum/bigflt in fractalb.cpp
solid_guess();
break;
case 'd':
diffusion_scan();
break;
case 'o':
sticky_orbits();
break;
case 'p':
if (bit_set (g_cur_fractal_specific->flags, fractal_flags::PERTURB)) // we already finished perturbation, so let's get outa here
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{} with control statements

break;
default:
one_or_two_pass();
}
Expand Down Expand Up @@ -2518,7 +2524,7 @@ static void decomposition()
// controlling the level and slope of the continuous potential
// surface. Returns color.
//
static int potential(double mag, long iterations)
int potential(double mag, long iterations) // no longer static as it is called by perturbation

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete the comment

{
float f_mag;
float f_tmp;
Expand Down
2 changes: 1 addition & 1 deletion libid/cmdfiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2791,7 +2791,7 @@ static cmdarg_flags cmd_parm_file(const Command &cmd)

static cmdarg_flags cmd_passes(const Command &cmd)
{
if (std::strchr("123gbtsdo", cmd.char_val[0]) == nullptr)
if (std::strchr("123gbtsdop", cmd.char_val[0]) == nullptr)
{
return cmd.bad_arg();
}
Expand Down
Loading
Loading