1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123:
| unit UNT_AM_Options;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Buttons, jpeg;
type TFRM_Options = class(TForm) GRB_Koordinaten: TGroupBox; GRB_Iteration: TGroupBox; GRB_Fluchtgrenze: TGroupBox; GRB_Teil: TGroupBox; SHP_Y_Achse: TShape; SHP_X_Achse: TShape; EDT_ymax: TEdit; EDT_ymin: TEdit; EDT_xmax: TEdit; EDT_xmin: TEdit; EDT_kmax: TEdit; EDT_rmax: TEdit; EDT_creal: TEdit; EDT_cimag: TEdit; BTN_Reset: TBitBtn; BTN_Loeschen: TBitBtn; LBL_ymax: TLabel; LBL_xmin: TLabel; LBL_xmax: TLabel; LBL_ymin: TLabel; Label1: TLabel; LBL_real: TLabel; LBL_imag: TLabel; BTN_OK: TBitBtn; BTN_Abbrechen: TBitBtn; procedure BTN_ResetClick(Sender: TObject); procedure BTN_LoeschenClick(Sender: TObject); procedure BTN_AbbrechenClick(Sender: TObject); procedure BTN_OKClick(Sender: TObject); private public end;
var FRM_Options: TFRM_Options;
implementation
uses UNT_AM_Main;
{$R *.dfm}
var x_bild,y_bild,kmax,k,rmax,xo,xu,yl,yr : integer; x,xalt,y,dx,dy,creal,cimag : real; xmax,xmin,ymax,ymin : real; md : boolean;
procedure iteration(x_bild,y_bild: integer); begin x := xmin + x_bild*dx; y := ymax - y_bild*dy; creal := (x_bild) *dx+xmin; cimag := (400-y_bild) *dy+ymin; k := 0; repeat xalt := x; x := sqr(x) - sqr(y) + creal; y := 2*xalt*y + cimag; inc(k); until (sqr(x)+sqr(y)>rmax) or (k>kmax); if k >= kmax then k:=0; FRM_Main.canvas.pixels[x_bild+1,y_bild+1] := 16000000div(k+1); end;
procedure TFRM_Options.BTN_ResetClick(Sender: TObject); begin EDT_xmax.Text := '2'; EDT_xmin.Text := '-2'; EDT_ymax.Text := '1'; EDT_ymin.Text := '-1'; EDT_kmax.Text := '10'; EDT_rmax.Text := '100'; EDT_creal.Text := '-0,74543'; EDT_cimag.Text := '0,11301'; end;
procedure TFRM_Options.BTN_LoeschenClick(Sender: TObject); begin EDT_xmax.clear; EDT_xmin.clear; EDT_ymax.clear; EDT_ymin.clear; EDT_kmax.clear; EDT_rmax.clear; EDT_creal.clear; EDT_cimag.clear; end;
procedure TFRM_Options.BTN_AbbrechenClick(Sender: TObject); begin FRM_Options.Close; end;
procedure TFRM_Options.BTN_OKClick(Sender: TObject); begin xmax := strtofloat(EDT_xmax.text); xmin := strtofloat(EDT_xmin.text); ymax := strtofloat(EDT_ymax.text); ymin := strtofloat(EDT_ymin.text); kmax := strtoint(EDT_kmax.text); rmax := strtoint(EDT_rmax.Text); creal := strtofloat(EDT_creal.text); cimag := strtofloat(EDT_cimag.text); dx := (xmax-xmin)/600; dy := (ymax-ymin)/400; for x_bild := 0 to 600 do for y_bild := 0 to 400 do iteration (x_bild,y_bild); end;
end. |