программа осей: program osi; uses crt; var i:integer; begin gotoxy(1,12); for i:=1 to 79 do begin write('-'); end; for i:=2 to 22 do begin gotoxy(40,i); writeln('!'); end; gotoxy(39,1); write('/!\y'); gotoxy(79,12); write('>'); gotoxy(79,13); write('x'); end.
program osi;
uses crt;
const
GREEN = 2;
BLUE = 1;
CYAN = 3;
WHITE = 7;
MAX_X = 120;
MAX_Y = 30;
PI = 3.1415926;
MX2 = MAX_X div 2;
MY2 = MAX_Y div 2;
procedure out(x,y: integer; s:char);
begin
if (x+MX2>-1) and (x+MX2<MAX_X+1) then
if (MAX_Y-(y+MY2)>0) and (MAX_Y-(y+MY2)<MAX_Y+1) then begin
gotoxy(x+MX2, MAX_Y-(y+MY2));
write(s);
end;
end;
{----------------------------------------------------------------}
{Основная программа}
var
i, y :integer;
begin
textcolor(WHITE);
for var x := -MX2 to MX2 do
out(x, 0, '-');
for y := -MY2 to MY2 do
out(0, y, '!');
out(-1, 14, '/');
out(1, 14, '\');
out(60, 0, '>');
{Рисуем прямую y = x}
textcolor(GREEN);
for var x:=-MY2 to MY2 do
out(x, x, '*');
{Рисуем график y=x^2}
textcolor(BLUE);
for var x := -MY2 to MY2 do begin
y:=x*x;
out(x, y, '*');
end;
{Рисуем график y=x*sin(30)}
textcolor(CYAN);
for var x := -MX2 to MX2 do begin
y := round(x * sin(PI / 6));
out(x, y, '*');
end;
read(i);
end.
Результат: