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: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134:
| interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,math;
type TForm1 = class(TForm) Image1: TImage; Panel1: TPanel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; c51: TEdit; c52: TEdit; c42: TEdit; c41: TEdit; c32: TEdit; c31: TEdit; c22: TEdit; c21: TEdit; c12: TEdit; c11: TEdit; c02: TEdit; c01: TEdit; Edit13: TEdit; Button1: TButton; procedure Button1Click(Sender: TObject); procedure FormResize(Sender: TObject); private public end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); var c51i,c52i,c41i,c42i,c31i,c32i,c21i,c22i,c11i,c12i,c01i,c02i:integer; formel:string; rechteck:trect; i:integer; y,maxx,minx:real; x,maxx2,minx2:real; begin c51i:=strtoint(c51.text); formel:=inttostr(c51i)+'/'; label1.caption:=formel; c52i:=strtoint(c52.text); formel:=inttostr(c52i)+'-'; label2.caption:=formel; c41i:=strtoint(c41.text); formel:=inttostr(c41i)+'+'; label3.caption:=formel; c42i:=strtoint(c42.text); formel:=inttostr(c42i)+'*'; label4.caption:=formel; c31i:=strtoint(c31.text); formel:=inttostr(c31i)+'/'; label5.caption:=formel; c32i:=strtoint(c32.text); formel:=inttostr(c32i)+'/'; label6.caption:=formel; c21i:=strtoint(c21.text); formel:=inttostr(c21i)+'/'; label7.caption:=formel; c22i:=strtoint(c22.text); formel:=inttostr(c22i)+'/'; label8.caption:=formel; c11i:=strtoint(c11.text); formel:=inttostr(c11i)+'/'; label9.caption:=formel; c12i:=strtoint(c12.text); formel:=inttostr(c12i)+'/'; label10.caption:=formel; c01i:=strtoint(c01.text); formel:=inttostr(c01i)+'/'; label11.caption:=formel; c02i:=strtoint(c02.text); formel:=inttostr(c02i)+'/'; label12.caption:=formel; rechteck.Left:=0; rechteck.top:=0; rechteck.right:=image1.Width; rechteck.Bottom:=image1.Height; image1.Canvas.FillRect(rechteck); minx:=1e50; maxx:=-1e50; minx2:=1e50; maxx2:=-1e50; for i:=-300 to 300 do begin y:=(c51i/c52i)* power(i ,5)+(c41i/c42i)* power(i ,4)+(c31i/c32i)* power(i ,3)+(c21i/c22i)* power(i ,2)+(c11i/c12i)* i +(c01i/c02i); if y>maxx then maxx:=y; if y<minx then minx:=y; end; image1.Canvas.MoveTo(-300+3000,round((y*image1.Height/(maxx-minx))+image1.Height/2)); for i:=-300 to 300 do begin
y:=(c51i/c52i)* power(i ,5)+(c41i/c42i)* power(i ,4)+(c31i/c32i)* power(i ,3)+(c21i/c22i)* power(i ,2)+(c11i/c12i)* i +(c01i/c02i); image1.Canvas.LineTo(i+300,round((y*image1.Height/(maxx-minx))+image1.Height/2)); end; end;
procedure TForm1.FormResize(Sender: TObject); begin image1.Align:=alclient;
Button1Click(nil); image1.Repaint; end;
end. |