Fractal graphics. Sheep and leaves (picture, evaluation, code)

zhaozj2021-02-16  50

The graph of the procedures realized by the procedure:

Such types of leaves are often seen on the back of the school. Every time you take your face, you will be empty and touched by it ...

In the Eastern District of the school, I can also see this figure on the grassland, although it is in the geological university, and when the geology is one, it will think that these Turnson's fossils, once How beautiful is it. But I went floating over time ...

Because I love it, I will be moved, will be immersive; the fractal, but in their own space, the "order" containing its beauty is ... A beauty, if you can make it re-swaying, how do you Will you don't work?

This is the code (algorithm refers to the book on fractal), but I hope that one day I can write a complete, including the algorithm; because I think they are like being held in the castle, I have to rescue myself. The one :) :) :):

Using system.drawing; using system.componentmodel; using system.windows.form; using system.data ;. using system.data ;. USING SYSTEM.DATA;

A summary description of Namespace Barnsley {///

///form1. /// public class form1: system.windows.Forms.form {/// // The designer variable is required. /// private system.componentmodel.container component = null; private pen greenpen = new pen (color.green, 0); private random randnum = new random (unchecked (int) DateTime.now.ticks)) ;

Public Form1 () {// // Windows Form Designer Support for // InitializeComponent ();

// // Todo: Add any constructor code after INITIALIZEComponent call //}

///

/// Clean all the resources being used. /// Protected Override Void Dispose (Bool Disposing) {if (disponents! = Null) {components.dispose ();}} Base.Dispose (4);

#Region Windows Form Designer Generated Code ///

/// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// private () {/// Form1 // this.autoscalebasesize = new system.drawing.size (6, 14); this.backcolor = system.drawing.systemcolors.Info; this. Clientsize = new system.drawing.size (488, 365); this.name = "form1"; this.text = "齿 叶"; this.WindowsTate = system.windows.forms.formwindowsTate.Maximized;} #ENDREGION

///

/// The primary entry point of the application. /// [stathread] static void main () {Application.run (new form1 ());}

Protected Override Void Onpaint (Painteventargs E) {Barnsley (E); Base.onpaint (E);} Private Void Barnsley (Painteventargs E) {Graphics DC = E.Graphics;

INT ITN = 500000, i = 0; double x = 0, y = 0, TEMPX = 0, CURP = 0; double [] a = {0.0, 0.85, 0.2, -0.15}; double [] b = {0.0, 0.04, -0.26, 0.28}; double [] c = {0.0, -0.04, 0.23, 0.26}; double [] d = {0.16, 0.85, 0.22, 0.24}; double [] E = {0.0, 0.0, 0.0 , 0.0}; double [] f = {0.0, 80.0, 80.0, 20.0}; double [] p = {0.01, 0.85, 0.07, 0.07};

Curp = randnum.nextdouble ();

While (i p [0] && curp <(p [0] p [1])) {x = a [1] * x b [1 ] * Y e [1]; y = C [1] * Tempx D [1] * y f [1];} else if (CURP> (P [0] P [1]) && curp < P [0] P [1] P [2])) {x = a [2] * x b [2] * Y E [2]; y = C [2] * Tempx D [2 ] * Y f [2];} else {x = a [3] * x b [3] * Y E [3]; y = C [3] * Tempx D [3] * Y f [3];} DC.Drawellipse (Greenpen, 400 (int) x, 540- (int) y, 1, 1); curp = randnum.nextdouble (); i ;}}}}}

Below is two differential graphics :):

Graphics 1:

Double [] a = {0.0, -0.85, 0.2, -0.15}; double [] b = {0.0, 0.04, -0.26, 0.28}; double [] c = {0.0, -0.04, 0.23, 0.26}; double [] D = {0.16, 0.85, 0.22, 0.24}; double [] E = {0.0, 0.0, 0.0, 0.0}; double [] f = {0.0, 80.0, 80.0, 20.0}; double [] p = { 0.01, 0.85, 0.07, 0.07};

Graphics 2:

Double [] a = {0.0, -0.95, 0.2, -0.15};

Double [] b = {0.0, 0.04, -0.26, 0.28}; double [] c = {0.0, -0.04, 0.23, 0.26}; double [] d = {0.16, 0.85, 0.22, 0.24}; double [] E = {0.0, 0.0, 0.0, 0.0}; double [] f = {0.0, 80.0, 80.0, 20.0}; double [] p = {0.01, 0.85, 0.07, 0.07};

转载请注明原文地址:https://www.9cbs.com/read-25440.html

New Post(0)