Skip to content

Instantly share code, notes, and snippets.

@kroovysteph
Created December 7, 2016 10:13
Show Gist options
  • Save kroovysteph/075659a6f44764bdae3197a9ed5081d2 to your computer and use it in GitHub Desktop.
Save kroovysteph/075659a6f44764bdae3197a9ed5081d2 to your computer and use it in GitHub Desktop.
g2.setColor(Color.RED);
ComplexNumber c = new ComplexNumber(-2.1, -1.1);
ComplexNumber z = new ComplexNumber(1, 0);
for (int y=0; y < this.getHeight(); y++) {
for (int x=0; x < this.getWidth(); x++) {
for (int n=0; n < 100; n++) {
for (int t = 0; t < max; t++) {
ComplexNumber z = z0;
z = z.times(z).plus(c);
if (!z.abs() > 2.0) {
g2.drawLine(x, y, x, y);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment