claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

Source code for the core formula definition:

```

/*
Experimental Magnet-Mandelbrot bulb triplex fractal.
Type 1: z_{n+1} = [(z_n^2 + c-1) / (2z_n + c-2)]^2
*/

MAGNETBULB(TRIPLEX, VEC, real) \
void Magnetbulb1Triplex(inout VEC w, in VEC c) \
{ \
TRIPLEX one = TRIPLEX(real(1), real(0), real(0)); \
TRIPLEX two = TRIPLEX(real(2), real(0), real(0)); \
TRIPLEX d = TRIPLEX(c.v[0], c.v[1], c.v[2]); \
TRIPLEX z = TRIPLEX(w.v[0], w.v[1], w.v[2]); \
z = sqr(div(add(sqr(z), sub(d, one)), add(add(z, z), sub(d, two)))); \
w.v[0] = z.x; \
w.v[1] = z.y; \
w.v[2] = z.z; \
w = add(w, c); \
}
MAGNETBULB(Triplexfx, Vec3fx, floatx)
MAGNETBULB(TriplexDual3f, Vec3Dual3f, dual3f)
MAGNETBULB
```

The rest of the framework is Too Big To Toot.

#undef #define #donotrun

Last updated 4 years ago