uses
Graph, CRT;
const
k = 100;
var
D, R, i, state: integer;
y: Real;
begin
WriteLn('Vvedite');
WriteLn('"1" dlya grafika Y = SIN X');
WriteLn('"2" dlya grafika Y = COS X');
WriteLn('"3" dlya grafika Y = TG X');
D := Detect;
ReadLn(state);
InitGraph(D, R, '..\bgi');
SetBkColor(Black);
ClearDevice;
SetColor(White);
Line(3, 3, 3, 477);
Line(3, 240, 637, 240);
OutTextXY(5, 470, 'Y');
OutTextXY(630, 245, 'X');
SetColor(58);
for i := 1 to 637 do
begin
case state of
1:
y := sin(i / k);
2:
y := cos(i / k);
3:
y := sin(i / k) / cos(i / k);
else
begin
Write('Input INCORRECT');
ReadLn;
ReadLn;
halt;
end;
end;
y := -y * k;
y := y + 240;
putpixel(i + 3, round(y), 58);
end;
ReadLn;
ReadLn;
end.