|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFractal
Buddhabrot
public class Buddhabrot
This class supports the 2011-2012 ICS3U Final Exam. As an alternative fractal algorithm to the Mandelbrot class, this class similarly extends Fractal. No palette object is required as the grayscale colors are determined from the recorded data itself.
Field Summary |
---|
Fields inherited from class Fractal |
---|
bailout, bottomBound, centreX, centreY, delta, dimension, domain, filename, invert, iteration, iterations, leftBound, MAX_ITERATE, palette, paletteName, point, range, rightBound, TARGET, topBound, xCenter, xMax, xMin, yCenter, yMax, yMin |
Constructor Summary | |
---|---|
Buddhabrot(java.lang.String xC,
java.lang.String yC,
java.lang.String delta,
java.lang.String bailout,
java.lang.String samples,
java.lang.String filename)
The Buddhabrot constructor accepts parameters similar to the Mandelbrot class constructor. |
Method Summary | |
---|---|
protected void |
draw(java.awt.Graphics g)
This method overrides Fractal's draw method to render the Buddhabrot image. |
protected void |
findMaxHitCount()
This method is called by iterateSamples after the iterate method has entirely populated the 2D hitCounts array. |
protected boolean |
iterate(ComplexNumber c,
boolean recordIt)
Called by iterateSamples for each c. |
protected void |
iterateSamples()
This method runs through a loop from 0 to samples. |
Methods inherited from class Fractal |
---|
getDimension, getFilename, getMaxIterations, isPartOfSet, iteration, mapColumnToReal, mapImaginaryToRow, mapRealToColumn, mapRowToImaginary, setDimension, setEscapeTime, zoom |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Buddhabrot(java.lang.String xC, java.lang.String yC, java.lang.String delta, java.lang.String bailout, java.lang.String samples, java.lang.String filename)
xC
- the real value of the centeryC
- the imaginary value of the centerdelta
- the half width of the region of the Argand Plane centered at
xC+yCibailout
- the maximum allowed exposure before concluding the c value did
not escapesamples
- the number of random c values to testfilename
- the name of the file for the purpose of saving the imageMethod Detail |
---|
protected void draw(java.awt.Graphics g)
draw
in class Fractal
g
- the Graphic2D reference to the bufferedImage passed to it by
Plot's getImage methodprotected void iterateSamples()
protected boolean iterate(ComplexNumber c, boolean recordIt)
protected int mapRealToColumn(double x) protected int mapImaginaryToRow(double y)be called to determine the pixel location corresponding to z.
c
- the ComplexNumber to sampledrecordIt
- whether or not hits are to be record in the hitCounts arrayprotected void findMaxHitCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |