PROJECT TRIGONOMETRI (DELPHI 7)
Posted in DELPHI 7
..............TRIGONOMETRI (image 617,329)...................................
Function Absis (x:double):integer;
begin
result:= round (x+300);
end;
Function ordinat (y:double):integer;
begin
result:= round (165-y);
end;
procedure TForm1.Button1Click(Sender: TObject); //KORDINAT
begin
with image1.Canvas do
begin
Pen.Width:=3;
Pen.Color:=clblue;
Font.Color:=clblue;
Font.Name:='Time New Roman';
Font.Size:=12;
MoveTo(Absis(-250),Ordinat(0)); //sumbu x
LineTo(Absis(250),Ordinat(0));
Font.Color:=clred;
TextOut(Absis(240),Ordinat(20),'x');
MoveTo(Absis(0),Ordinat(145)); //sumbuy
LineTo(Absis(0),Ordinat(-145));
Font.Color:=clred;
TextOut(Absis(4),Ordinat(148),'y');
TextOut(Absis(5),Ordinat(-5),'O');
Font.Size:=12;
Font.Style:=[fsBold]; //bold
TextOut(Absis(80),Ordinat(-5),'180');
TextOut(Absis(200),Ordinat(-5),'360');
TextOut(Absis(-125),Ordinat(-5),'-180');
TextOut(Absis(-200),Ordinat(-5),'-360');
TextOut(Absis(5),Ordinat(85),'1');
TextOut(Absis(4),Ordinat(-60),'-1');
end;
end;
procedure TForm1.Button3Click(Sender: TObject); //SIN
var i:real;
begin
with image1.Canvas do
begin
Font.Color:=clgreen;
Font.Size:=12;
i:=-200;
while i<=200 do
begin
Pixels[Absis(i),Ordinat(70*Sin(i*2*3.14/200))]:=clgreen;
i:=i+0.03;
TextOut(Absis(185),Ordinat(-40),'y = sin x');
end;
end;
end;
procedure TForm1.Button4Click(Sender: TObject); //COS
var i:real;
begin
with image1.Canvas do
begin
Font.Color:=clBlue;
Font.Size:=12;
i:=-200;
while i<=200 do
begin
Pixels[Absis(i),Ordinat(70*Cos(i*2*3.14/200))]:=clred;
i:=i+0.03;
TextOut(Absis(200),Ordinat(70),'y = cos x');
end;
end;
end;
end.
Function Absis (x:double):integer;
begin
result:= round (x+300);
end;
Function ordinat (y:double):integer;
begin
result:= round (165-y);
end;
procedure TForm1.Button1Click(Sender: TObject); //KORDINAT
begin
with image1.Canvas do
begin
Pen.Width:=3;
Pen.Color:=clblue;
Font.Color:=clblue;
Font.Name:='Time New Roman';
Font.Size:=12;
MoveTo(Absis(-250),Ordinat(0)); //sumbu x
LineTo(Absis(250),Ordinat(0));
Font.Color:=clred;
TextOut(Absis(240),Ordinat(20),'x');
MoveTo(Absis(0),Ordinat(145)); //sumbuy
LineTo(Absis(0),Ordinat(-145));
Font.Color:=clred;
TextOut(Absis(4),Ordinat(148),'y');
TextOut(Absis(5),Ordinat(-5),'O');
Font.Size:=12;
Font.Style:=[fsBold]; //bold
TextOut(Absis(80),Ordinat(-5),'180');
TextOut(Absis(200),Ordinat(-5),'360');
TextOut(Absis(-125),Ordinat(-5),'-180');
TextOut(Absis(-200),Ordinat(-5),'-360');
TextOut(Absis(5),Ordinat(85),'1');
TextOut(Absis(4),Ordinat(-60),'-1');
end;
end;
procedure TForm1.Button3Click(Sender: TObject); //SIN
var i:real;
begin
with image1.Canvas do
begin
Font.Color:=clgreen;
Font.Size:=12;
i:=-200;
while i<=200 do
begin
Pixels[Absis(i),Ordinat(70*Sin(i*2*3.14/200))]:=clgreen;
i:=i+0.03;
TextOut(Absis(185),Ordinat(-40),'y = sin x');
end;
end;
end;
procedure TForm1.Button4Click(Sender: TObject); //COS
var i:real;
begin
with image1.Canvas do
begin
Font.Color:=clBlue;
Font.Size:=12;
i:=-200;
while i<=200 do
begin
Pixels[Absis(i),Ordinat(70*Cos(i*2*3.14/200))]:=clred;
i:=i+0.03;
TextOut(Absis(200),Ordinat(70),'y = cos x');
end;
end;
end;
end.
0 comments: