Bahá
Wisps
The splitpow
implementation below is almost an ordinary implementation of a complex-valued power function. Using the more ordinary definition P.real
would be equal to P.imag
(corresponding to the real component of the exponent) and Q.real
would be equal to Q.imag
(corresponding to the imaginary component of the exponent). Breaking this equivalence simply because it is possible creates something that doesn't quite make sense in a strictly mathematical sense, but creates fascinating strange attractor patterns in the generated point clouds. For a standard Mandelbrot the former are equal to two and the latter are equal to zero.
complex splitpow(complex z, complex P, complex Q)
{
auto norm = sqrt(z.real*z.real + z.imag*z.imag);
auto arg = atan2(z.imag, z.real);
auto lnorm = log(norm);
auto abs = pow(norm, P.real) * exp(-Q.real*arg);
auto theta = P.imag*arg + Q.imag*lnorm;
auto im = sin(theta)*abs;
auto re = cos(theta)*abs;
return {re,im};
}
The implementation should make it obvious (provided you speak code) how the operation is actually a specific kind of mixing the absolute value and argument of z
in proportion to the chosen exponents.