ƒ : ℂ → ℂ


This website plots complex functions. Each point in the image has a color based on the value of a complex function at that point on the plane: the brighness of the point represents the absolute value, and the hue represents its argument. If you plot 1/z, you will see a very sharp bright point in the middle. That's the pole. You'll also see the colors cycle in the opposite order of the graph of z, because 1/z negates the argument of its input.

Sam Fingeret created the original complex plotter, and Pavel Panchekha built the website. Enjoy!

List of Functions

Functions marked with a * have minor errors introduced by the approximations that make calculation possible, and these minor errors may manifest themselves as phantom poles or zeros. For example, the implementation of the zeta function has poles that are extremely close to zeros that are supposed to cancel them. Functions marked with a are implemented but are extremely slow If you have better ways of calculating these functions, write!

List of Constants

Feedback and Bugs

Have comments, suggestions, or bug reports? Report them on GitHub.

Programmer's API

The site offers an API for programmers. The goal is to allow smartphones to plot complex functions. If you want to plot these functions on a full desktop computer, just download the source code.

The API consists of a single endpoint: send a GET request to http://complex.pavpanchekha.com/api, with any of the following parameters:

Parameter Description
fThe function to plot. If not specified, an error occurs. In general, I'd really like it if you kept the default image, if your application uses one, bundled somewhere within your application. Don't hit the server on startup.
w and hWidth and height. The default is 300 by 300 (just right for the iPhone screen).
l, b, t, r The real coordinate of the left, bottom, top, and right of the viewing window. The default is 2 and -2 as makes sense.

The actual parsing and generation of the image all happen server-side, so functions can be passed exactly as they normally would. If everything goes well, the status code should be 200 and the response content should be a PNG image. If something bad happens, the response code is 400 and the response body is empty. It's up to you to figure out what went wrong in that case.