Skip to content

MrCamoga/Complex-Plane-Grapher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Complex Plane Plotter

Output a plot of a function from ℂ to ℂ.

Hue of a pixel represents the argument and brightness represents the modulus.

How to use it

int[] pixels = Plotter.plot(f, width, height, x start, y start, x end, y end, coloring)

  • f must be a lambda expression with the function you want to plot (i.e. z -> Complex.ln(z))

  • width, height: dimensions of the output image

  • x start/end: real interval of the function

  • y start/end: imaginary interval

  • coloring: You can combine the two with | operator.

    • 0b01 / Plotter.CONTOURLINES: draw contour lines at integer powers of 2
    • 0b10 / Plotter.ARGLINES: draw white lines at regular arguments intervals

Plain image

Contour lines

Argument lines

Both

Example of usage:

Plotter.plot(z -> Complex.mul(z,Complex.cos(z)), 800, 800, -4, -4, 4, 4, 0b11); 

 

Output:

Plotter.plot() returns an int raster with the image

In the main class there's a method to convert it into a BufferedImage

Dependencies

You need my complex numbers library to run this program: Complex Numbers Library

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages