Pauldelbrot
|
|
« Reply #4 on: October 06, 2012, 02:40:57 PM » |
|
I see -- thanks! The math behind the coloring techniques is explained in a scattering of various posts. The notable ones might be: - Multiwave - Best results are obtained by adding different gradients with different periods, plus a logmap, with componentwise addition in HSL space. Further, the addition used should behave as if zero and maximum saturation and luminance are minus and plus infinity, by having subtracting from low numbers and adding to high ones have decreasing effect as the limit is approached, rather than add-normally-and-clamp. One way that might be done is to use minus infinity to infinity floats under the hood, and when you need to convert to rgb first take the tan (gets you -pi/2 to pi/2), then divide by pi and add a half to get 0 to 1. The usual hue, with red, yellow, green, cyan, blue, and magenta equally spaced around the rim of the color wheel, is convenient to convert to RGB but may be suboptimal for best aesthetic results; red, orange, yellow, yellow-green, green, cyan, blue, magenta may work better, putting red and green opposite each other. Human color perception regards these as diametric opposites, as it does blue and yellow.
- Smoothed convergent iterations. A highly general scheme that works with complex-number mappings in nearly all cases (except superattractor basins) is: iterate until apparent convergence, then iterations until a disk around that attractor point first hit, plus 1 - ((log distance-from-point-to-attractor - log disk' radius) / (log disk radius - log disk' radius)), which should be zero at the outer edge of the integer-iteration band and one at the inner edge if disk' is the image of disk under one cycle of iterations (just enough to return to the same attractor point). To calculate disk', you can use the ratio of the distance from the final iterate to the attractor to the distance from the penultimate iterate to the attractor as a good approximation to disk'/disk. For Julia types, the attractors can be found in advance, including their periods and disk' radii; for Mandelbrot types you'll have to iterate twice: first looking for the attractor -- use periodicity detection, and when it's found, save the point, iterate until the point is close to the saved point, and thereby count out the period; then if distance to saved point isn't low enough, save point, iterate period times, check distance to saved point, etc. until close enough. Then save the attractor point and reiterate from scratch until disk radius from saved point (disk radius should be considerably larger than the threshold used before) and use the last two iterations to compute disk', then compute the smoothed iteration value.
- Mandelbrot internal angle. Similar to smoothed convergent iterations, just iterate until target disk is hit and calculate the angle PAP' where P and P' are the last two iterates and A is the saved attractor point. That's atan2(P'y-Ay,P'x-Ax) - atan2(Py-Ay,Px-Ax).
- Julia internal angle. Just use atan2(Py-Ay,Px-Ax), or use atan2(Py-Ay,Px-Ax) - atan2(Cy-Ay,Cx-Ax) where C is some chosen point inside the basin (e.g. a critical point that converges to the same attractor).
The Nova image above used convergent smoothed iterations with multiwave to generate a color, and additionally generated one more luminance-influencing wave using the Julia internal angle and a hue-influencing wave using atan2(Ax,Ay). Julia internal angle was calculated without the -atan2(Cy-Ay,Cx-Ax), or else it would have had no effect; with it, the Mandelbrot bulb portions get two repeats of the gradient and it's rotated differently for different bulbs. (Mandelbrot internal angle would have one repeat, so a dark side and a light side per bulb, and a fixed point of the gradient at the attachment point to the parent bulb, so, the same relative orientation of the gradient and the bulb's features for all of them.)
|