/// <summary> /// Draws the Sierpinski Carpet. /// </summary> /// <param name="g">The graphics surface.</param> /// <param name="fp">The form.</param> public override void Draw(Graphics g, FFractalPainter fp) { RectangleF rectangle = new RectangleF(fp.distanceFromCorner, fp.distanceFromCorner, fp.bitmapSize - 2 * fp.distanceFromCorner, fp.bitmapSize - 2 * fp.distanceFromCorner); DrawSierpinskiCarpet(g, fp.firstColour, fp.secondColour, RecursionDepth, rectangle); }
/// <summary> /// Draws the Sierpinski Triangle. /// </summary> /// <param name="g">The graphics surface.</param> /// <param name="fp">The form.</param> public override void Draw(Graphics g, FFractalPainter fp) { DrawSierpinskiTriangle(g, fp.firstColour, fp.secondColour, RecursionDepth, new PointF(fp.bitmapSize / 2, fp.distanceFromCorner), new PointF(fp.distanceFromCorner, fp.bitmapSize - fp.distanceFromCorner), new PointF(fp.bitmapSize - fp.distanceFromCorner, fp.bitmapSize - fp.distanceFromCorner)); }
/// <summary> /// Draws the Pythagorean Tree Fractal. /// </summary> public override void Draw(Graphics g, FFractalPainter fp) { // Drawing the base line. Pen pen = new Pen(fp.firstColour, 3); PointF root = new PointF(fp.bitmapSize / 2, fp.bitmapSize - fp.distanceFromCorner); PointF beginBranch = new PointF(fp.bitmapSize / 2, fp.bitmapSize - fp.distanceFromCorner - fp.bitmapSize / 4); g.DrawLine(pen, root, beginBranch); // Draws the branches of the tree. DrawPythagoreanTree(g, fp.firstColour, fp.secondColour, RecursionDepth - 1, beginBranch, (int)((fp.bitmapSize / 4) * Coefficient), 0); }
/// <summary> /// Draws the Cantor Set Fractal. /// </summary> public override void Draw(Graphics g, FFractalPainter fp) { DrawCantorSet(g, fp.firstColour, fp.secondColour, fp.cantorRectangleWidth, RecursionDepth, new Point(fp.distanceFromCorner, fp.distanceFromCorner), fp.bitmapSize - 2 * fp.distanceFromCorner); }
/// <summary> /// Draws the Koch Curve. /// </summary> /// <param name="g">The graphics surface.</param> /// <param name="fp">The form.</param> public override void Draw(Graphics g, FFractalPainter fp) { DrawKochCurve(g, fp.firstColour, fp.secondColour, RecursionDepth - 1, fp.distanceFromCorner, fp.bitmapSize / 2, 0, (fp.bitmapSize - 2 * fp.distanceFromCorner) / 3); }
/// <summary> /// Drawing the Fractal. /// </summary> public abstract void Draw(Graphics g, FFractalPainter fp);