Trigonometrie Turbo Pascal
aus Paswiki Turbo Pascal, der freien Wissensdatenbank
Beschreibung
Dies ist ein Programm, das sich mit Trigonometrie im rw. Dreieck beschäftigt.
Programm
uses crt,dos,graph;
var ab,bc,ca:integer;gd,gm:integer;
hyp,wink1,wink2,wink3,xa,ya,xa1,ya1:real;
s:string;
procedure einheitskreis;
begin
cleardevice;
outtextxy(100,20,'Einheitskreis:');
outtextxy(100,30,'ÜÜÜÜÜÜÜÜÜÜÜÜÜÜ');
outtextxy(30,60,'Der Radius betraegt 1, d. h. die Hypothenuse ist immer 1.');
outtextxy(30,80,'==> cos(winkel)=Ankathete bzw. sin(winkel)=Gegenkathete.');
directvideo:=false;
gotoxy(10,8);
write('==> Der sin/cos des Winkels ',s,' kann "abgelesen" werden.');
line(250,125,250,375);
line(125,250,375,250);
circle(250,250,100);
xa:=100*cos( 2*pi * wink3/360);
ya:=100*sin( 2*pi * wink3/360);
moveto(250,250);
setcolor(4);
lineto(250+round(xa),250);
lineto(250+round(xa),250-round(ya));
lineto(250,250);
readln;
end;
procedure hallo;
begin
gd:=detect;
initgraph(gd,gm,' ');
outtextxy(50,5, 'Dies ist ein Programm zur Verdeutlichung');
outtextxy(50,20,'der Trigonometrie im rechtwinklingen Dreiecks');
outtextxy(50,30,'ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ');
end;
begin
hallo;
ab:=20;
bc:=16;
ca:=19;
textcolor(15);
line(100,350,100+10*ab,350);outtextxy(120+10*ab,350,'B');
line(100+10*ab,350,100+10*ab,350-10*bc);outtextxy(100+10*ab,320-10*bc,'C');
line(100+10*ab,350-10*bc,100,350);outtextxy(80,350,'A');
outtextxy(50,100,'Geben Sie nun die Laengen der Seiten ein :');
outtextxy(500,100,'Kathete 1 (AB) = ?');
directvideo:=false;gotoxy(65,10);readln(ab);
outtextxy(500,200,'Kathete 2 (BC) = ?');
directvideo:=false;gotoxy(65,16);readln(bc);
cleardevice;
hallo;
directvideo:=false;
line(100,350,100+10*ab,350);outtextxy(120+10*ab,350,'B');
line(100+10*ab,350,100+10*ab,350-10*bc);outtextxy(100+10*ab,320-10*bc,'C');
line(100+10*ab,350-10*bc,100,350);outtextxy(80,350,'A');
hyp:=sqrt(ab*ab+bc*bc);
gotoxy(20,6);write('Die Hypothenuse ist ',hyp:5:2);
(wink1):=360/(2*pi)*arctan(ab/bc);
(wink2):=360/(2*pi)*arctan(bc/ab);
writeln;
writeln;
writeln('Der Winkel BCA ist ca. ',wink1:3:2);
writeln;
writeln('Der Winkel CAB ist ca. ',wink2:3:2);
readln;
str(wink1:3:2,s);
wink3:=wink1; s:='BCA = '+ s;
einheitskreis;
readln;
str(wink2:3:2,s);
wink3:=wink2; s:='CAB = '+s;
einheitskreis;
closegraph;
end.
--Gastarbeiter 22:03, 21. Feb 2006 (CET)
