< -->
Program Gr1;
{$E-,N+}
Uses Graph, CRT;
{$L C:\PROGRA~2\BP70\BIN\EGAVGA.OBJ}
Procedure EGAVGA; External;
type
PAr = ^TAr;
TAr = array [0..60000] of Char;
const
Sx : Extended = 300;
Sy : Extended = 2;
Xb : Extended = -1;
Xe : Extended = 1;
Yb : Extended = -1;
Ye : Extended = 90;
dx : Extended = 0.0001;
var
D, R, e : Integer;
P : ^TAr;
PP : Pointer;
i : LongInt;
x, y : Extended;
Function f(x : Extended) : Extended;
begin
f := Exp(sqrt(3*x+17)*Ln(sqr(sin(Pi/3)/cos(Pi/3))));
end;
begin
P := @EGAVGA;
PP := @EGAVGA;
D := Detect;
if RegisterBGIdriver(PP) < 0 then
begin
Writeln('Ошибка регистрации драйвера: ',
GraphErrorMsg(GraphResult));
Halt(1);
end;
InitGraph(D, R, '');
e := GraphResult;
if e <> grOk then
begin
WriteLn('Произошла ошибка графики!!!');
WriteLn(GraphErrorMsg(e));
end;
SetBkColor(DarkGray);
SetColor(Yellow);
SetFillStyle(2, LightGreen);
Bar3D(100, 200, 300, 400, 70, TopOn);
SetFillStyle(4, Green);
FloodFill(1, 1, Yellow);
SetFillStyle(5, Red);
FloodFill(120, 190, Yellow);
SetFillStyle(7, Blue);
FloodFill(320, 350, Yellow);
ReadKey;
SetBkColor(Black);
ClearDevice;
x := Xb;
While x<=Xe do
begin
y := f(x);
PutPixel(320+Round(Sx*x), 240-Round(Sy*y), Yellow);
x := x + dx;
end;
ReadKey;
CloseGraph;
end.
Назад