Ben Niehoff
Science Advisor
Gold Member
- 1,892
- 171
There is one thing that you should get straight, which you would know if you were more familiar with mathematics: The coordinate system used is almost entirely irrelevant.
I think you are focusing on the wrong part of the problem. It seems to me that you are just trying random modifications to your code, hoping that something will pop up that you like. I think you would be a lot better served if you were to step back and try to understand what you are actually doing, geometrically.
Forget coordinate systems. What is happening geometrically? You had the right idea in your analysis of the 2D Mandelbrot (i.e., you take a vector, rotate it through by its own angle, square its length, and then add another constant vector). But I didn't see any similar sort of analysis for the 3D case.
Now obviously, if you do exactly the same geometrical operations in 3D as you do in 2D, then you will just get a standard Mandelbrot set rotated around on its own axis. This is not what you want, of course. So now the question is, what needs to change, geometrically?
The best thing to do would be to first think about the symmetry you expect your final object to have. I would guess you're expecting to get something whose basic shape is a 3D cardioid with a sphere attached at one end...so, that kind of shape has rotational symmetry around one axis. If you let this axis be the vertical axis, then I guarantee, the standard spherical coordinate system will be the most convenient way to describe the shape. (By the way, the standard spherical system uses the "co-latitude", which is the angle measured down from the pole, rather than the latitude, which is the angle up from the equator...and believe me, the system is much simpler to use when you use the co-latitude).
The tricky thing now, is that you don't want perfect rotational symmetry, because that will just give you the 2D Mandelbrot rotated on its axis. Probably you want something with a discrete rotational symmetry group instead (i.e., something with 3-fold rotational symmetry, or n-fold, but not continuous rotational symmetry). This is not to hard to do, but most possibilities are going to give you the taffy-like texture that you are trying to avoid. You should think about why this taffy-like structure emerges, mathematically! (Hint: it has to do with continuity, and you can't make it go away just by choosing another coordinate system).
I'm not sure yet exactly how to make the taffy-like structure go away. I have a hunch it might involve elliptic functions (which are doubly-periodic in the complex plane). I do think you will have to get away from the "rotate, square, and add" paradigm altogether, because these operations all have continuities that will give you taffy-like structure.
Also, for reasons that I hope you have tried to learn about, you cannot define a consistent 3-dimensional algebra analogous to the complex numbers that is algebraically closed. You can only define such algebras in 2^N dimensions.
I think you are focusing on the wrong part of the problem. It seems to me that you are just trying random modifications to your code, hoping that something will pop up that you like. I think you would be a lot better served if you were to step back and try to understand what you are actually doing, geometrically.
Forget coordinate systems. What is happening geometrically? You had the right idea in your analysis of the 2D Mandelbrot (i.e., you take a vector, rotate it through by its own angle, square its length, and then add another constant vector). But I didn't see any similar sort of analysis for the 3D case.
Now obviously, if you do exactly the same geometrical operations in 3D as you do in 2D, then you will just get a standard Mandelbrot set rotated around on its own axis. This is not what you want, of course. So now the question is, what needs to change, geometrically?
The best thing to do would be to first think about the symmetry you expect your final object to have. I would guess you're expecting to get something whose basic shape is a 3D cardioid with a sphere attached at one end...so, that kind of shape has rotational symmetry around one axis. If you let this axis be the vertical axis, then I guarantee, the standard spherical coordinate system will be the most convenient way to describe the shape. (By the way, the standard spherical system uses the "co-latitude", which is the angle measured down from the pole, rather than the latitude, which is the angle up from the equator...and believe me, the system is much simpler to use when you use the co-latitude).
The tricky thing now, is that you don't want perfect rotational symmetry, because that will just give you the 2D Mandelbrot rotated on its axis. Probably you want something with a discrete rotational symmetry group instead (i.e., something with 3-fold rotational symmetry, or n-fold, but not continuous rotational symmetry). This is not to hard to do, but most possibilities are going to give you the taffy-like texture that you are trying to avoid. You should think about why this taffy-like structure emerges, mathematically! (Hint: it has to do with continuity, and you can't make it go away just by choosing another coordinate system).
I'm not sure yet exactly how to make the taffy-like structure go away. I have a hunch it might involve elliptic functions (which are doubly-periodic in the complex plane). I do think you will have to get away from the "rotate, square, and add" paradigm altogether, because these operations all have continuities that will give you taffy-like structure.
Also, for reasons that I hope you have tried to learn about, you cannot define a consistent 3-dimensional algebra analogous to the complex numbers that is algebraically closed. You can only define such algebras in 2^N dimensions.