When creating conformal images, how do you change the basis of the input lattice such that spirals result in the transformed image?

89 Views Asked by At

I am trying to emulate the results shown in the Wikipedia page on Conformal Images in an attempt to better visualize complex functions (and stare at some trippy images, man). The script I wrote (source) maps an input image to the complex plane and passes it through some arbitrary complex-valued function and writes the result to a file.

Well, I wish it worked that way. It actually works backwards and generates a blank image, then runs its coordinates as complex valued tuples through a function and grabs the result from the infinitely tiled input image. This method means that you don't have to restrict the function's range or domain, but it also means that if you put a function in that what you see is actually its inverse (to put it shortly: rather than asking "where does this pixel get pushed?" my algorithm asks "what pixel got pushed here?").

Anyways, given all of that, I want to try and take the map of $e^z$ spiral out from the center as opposed to stagnating in boring circles. The Wikipedia page on Conformal Images says that you can do this with a change of basis, but so far any basis change I have tried has just resulted in a skewed output. What sort of basis change do I need to perform to make these images spiral?

Here are some output images:

Map of z to ln(z) Map of z to 1/z Map of z to e^z