unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Menus, ExtCtrls;
type
TForm1 =
class(TForm)
bild: TImage;
MainMenu1: TMainMenu;
Datei1: TMenuItem;
Bearbeiten1: TMenuItem;
Hilfe1: TMenuItem;
Sc1: TMenuItem;
Schnittpunkteberechnen1: TMenuItem;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Lschen1: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure Schnittpunkteberechnen1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
function f(x:real):real;
function g(z:real):real;
var
Form1: TForm1;
a,b,c,m,n,x,y:real;
xb,yb,xm,ym,k,ymax,xmax:word;
implementation
{$R *.dfm}
function f(x:real):real;
begin
f:=a*x*x+b*x+c*x
end;
function g(z:real):real;
begin
g:=m*z+n
end;
procedure loeschen;
begin
with form1.bild.canvas
do
begin
brush.color:=clwhite;
pen.color:=clwhite;
rectangle(0,0,form1.bild.width,form1.bild.height);
end;
end;
procedure koordinatensystem;
var i :integer;
begin
k:=30;
xm:=form1.bild.width
div 2;
ym:=form1.bild.height
div 2;
xmax:=form1.bild.width;
ymax:=form1.bild.height;
with form1.bild.canvas
do
begin
moveto (8,ym); lineto (xmax-8,ym);
moveto (xm,8); lineto (xm,ymax-8);
font.
name:='
Arial';
font.size:=8;
xb:=xm-8*k;
for i:=-8
to 8
do
begin
moveto (xb,ym); lineto (xb,ym+3);
textout (xb-3,ym+8,inttostr(i));
xb:=xb+k;
end;
yb:=ym+8*k;
for i:=-8
to 8
do
begin
moveto (xm,yb);lineto (xm+3,yb);
if i<>0
then textout (xm+8,yb-8,inttostr(i));
yb:=yb-k;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
koordinatensystem;
x:=-10;
repeat
y:=f(x);
xb:=round(xm+x*k);
yb:=round(ym-y*k);
bild.canvas.pixels[xb,yb]:=clblack;
x:=x+0.001;
until x>10
end;
procedure TForm1.Schnittpunkteberechnen1Click(Sender: TObject);
begin
a:=strtofloat(edit1.text);
b:=strtofloat(edit2.text);
c:=strtofloat(edit3.text);
m:=strtofloat(edit4.text);
n:=strtofloat(edit5.text);
end;
end.