This is a very math-intensive project that not necessarily math-intensive people will see. If you feel like understanding what is going on here, this is a strongly recommended read. If there's anything you're already familiar with, feel free to skip ahead! Note: This documentation is meant to introduce you to domain coloring and complex analysis, and not teach you to use the tool.
This plotter represents functions
Speaking in very general terms, functions are things that take an input and produce an output. While usual math leads you to think otherwise, a function can take and produce anything of any "type", so long the same input doesn't produce many outputs.
In mathematics, we can shorthand the sentence "the function
Usually, we work with real functions, this just being a function
Looking at the numbers help, but still isn't quite visual. We can do a better job at it by representing the value of
Rather than looking at two individual number lines, we'll make our lives easier and make them orthogonal to each other. Then, instead of having two points, we "merge" these points by drawing out lines perpendicular to our axes, and getting their intersection
Now, the points we chose are just some members of
And voilà! This is the plot of the parabola, the visual representation of this function
This strategy for plotting functions works fine for functions
Now, we have two inputs and one output. This would mean we need three orthogonal axes: x,y,g(x,y). This would make our function 3D
We call the number of axes we need to represent a set (like
This method is, however, limited. The set of the complex numbers (
A complex number
The imaginary unit has only one property:
To represent a complex number visually, a number line doesn't suffice. We need two axes, one for
Now, if we want to plot a complex function in a 2D screen, one will notice we're already out of dimensions. We have one trick up our sleeves though: color! If you've ever used an image editing software, you've likely come across an image of the color wheel. In this case, we're using the HSL wheel, which stands for Hue, Saturation and Light.
Simply, if you draw a line coming out of the circle's center, how long the line is will tell you the color's brightness (or light), and the angle it makes will decide it's color (or hue). This means that we can map a pair of numbers
Since the dimensionality of color and a complex number are the same, we can map one to another! There are many methods to do so, the one used in this plotter being disclosed here, but this means we can now plot functions
If we do this for every color in our screen with, for instance,
Notice how the very center is black: this is the root of our equation, when f(z) = 0. Keep track on how each color shows up exactly once, and our grid is perfectly straight - this means that no transformations were done, and this is a 1:1 map.
Now, in the reals,
Think of transformations as moving around the points that our identity function defines, and thus moving their colors with them. We can see this transformation bending and duplicating our grid, like two intersecting parabolas, which is expected! With all in this in mind, here's how this function looks like:
All checks out! The grid is being warped, and the colors are being repeated (notice how red shows up twice). There are many fun transformations to explore, and I incentivize you to try them out yourself! This the plotter's purpose, after all.












