Output a plot of a function from ℂ to ℂ.
Hue of a pixel represents the argument and brightness represents the modulus.
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
Plotter.plot(z -> Complex.mul(z,Complex.cos(z)), 800, 800, -4, -4, 4, 4, 0b11);
Plotter.plot() returns an int raster with the image
In the main class there's a method to convert it into a BufferedImage
You need my complex numbers library to run this program: Complex Numbers Library