# Barry Martin Fractals

Barry Martin fractals are common, easy to create fractals. They consist simply of two iterated X and Y equations, much like other common fractals. Three constants, A, B, and C are used to create the fractal. The two equations are :

xn = yn-1 - sqrt(abs(b * xn-1 - c)) * sign(xn-1)
yn = a - xn-1

Please note that three special functions are used in the first equation. The first is SQRT. This is, of course, the square root. Most computer languages reference this as SQRT. Next comes the ABS function. This is absolute value; the ABS contraction is also very common in computer languages and mathematics. Lastly is the SIGN function. Some languages don't have this command, so it'll have to be programmed in manually. Turbo Pascal, which was used to generate these images, doesn't have this function, so I programmed it.
The SIGN function's job is to return a value of 1 if the xn-1 value is positive, and to return a value of -1 if the value is negative. In Turbo Pascal, you can do this by making the following function :

```function sign(num:real) : integer;
begin
if abs(num)=num then sign := 1 else sign := -1;
end;
```

This same function, in C++, for example, would look like this...
```int sign(float num) {
if (abs(num) == num) return 1 else return -1;
}
```

That's all you'll need to make these fractals. Just repeat these equations in a loop, plot the points, and these images will be generated. Almost any configuration of A, B, and C can be used. Nearly all values will produce large, detailed fractals.

The Turbo Pascal program used to generate these images is available for download. The ZIP file contains the source code, and a DOS-compiled executable file. You'll need 1 MB of video RAM to run this.
Also, this program is available for the Texas Instruments TI-92 graphing calculator.