Skip to content

Creates colour-wheel graph of any specified complex function

Notifications You must be signed in to change notification settings

gouwsxander/ColourWheelGrapher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Colour Wheel Grapher

About and Dependencies

Graphs can be tremendously important in understanding mathematical functions, but issues arise when graphing complex functions. This is because complex functions have 2 dimensional inputs and 2 dimensional outputs, resulting in the need of 4 total dimensions.

To get around this, we can use colour wheel graphs (or domain colouring). This is a trick that uses colour to fill in the extra dimensions. The 2 dimensions required by the inputs are represented in the space of a picture. The 2 dimensions of our outputs are represented in colour. The argument of the output value gives us a pixel's hue, and its magnitude gives us its lightness. The saturation of all points is 100%. More information can be found in the references.

This program uses the Python Imaging Library, as well as a few libraries available in standard Python:

  • math to make certain constants and functions easily available.
  • cmath for dealing with complex numbers.
  • colorsys for converting between different colour models.

Some Results

z^5 - 1

z^5 - 1

Log(z)

Log(z)

Function 2

Function 2

This example was inspired by Wikipedia.

Future Development

Converting the magnitude of the output vector to a saturation requires an extra parameter. Currently, this values needs to be determined through trial and error for each function. In future, it would hopefully be calculated somehow - likely in a way to create as much contrast as possible in the output image.

References/Further Reading

Domain Colouring (Wikipedia)

About

Creates colour-wheel graph of any specified complex function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages