Код
Program Project1;
Uses Graph;
procedure InitGr;
var
gd, gm: SmallInt;
begin
gd:=0;
gm:=0;
InitGraph(gd, gm, '');
end;
function f(a,phi,L:real):real;
begin
Result:=a*cos(phi)+L;
end;
procedure Draw(x,y:integer;ang:real); //Угол в градусах
const
countpixels = 360;
expand = 100;
var
a,phi,L:real;
i:integer;
begin
//x=r*cos(phi);
//y=r*sin(phi);
a:=2;
L:=1;
SetColor(15);
phi:=0;
MoveTo(round(f(a,phi,L)*cos(phi+2*pi/360*ang)*expand)+x,round(f(a,phi,L)*sin(phi+2*pi/360*ang)*expand+y));
for i:=1 to countpixels do
begin
phi:=2*pi/countpixels*i;
LineTo(round(f(a,phi,L)*cos(phi+2*pi/360*ang)*expand)+x,round(f(a,phi,L)*sin(phi+2*pi/360*ang)*expand+y));
end;
end;
begin
InitGr;
Draw(100,200,50);
CloseGraph;
end.
Uses Graph;
procedure InitGr;
var
gd, gm: SmallInt;
begin
gd:=0;
gm:=0;
InitGraph(gd, gm, '');
end;
function f(a,phi,L:real):real;
begin
Result:=a*cos(phi)+L;
end;
procedure Draw(x,y:integer;ang:real); //Угол в градусах
const
countpixels = 360;
expand = 100;
var
a,phi,L:real;
i:integer;
begin
//x=r*cos(phi);
//y=r*sin(phi);
a:=2;
L:=1;
SetColor(15);
phi:=0;
MoveTo(round(f(a,phi,L)*cos(phi+2*pi/360*ang)*expand)+x,round(f(a,phi,L)*sin(phi+2*pi/360*ang)*expand+y));
for i:=1 to countpixels do
begin
phi:=2*pi/countpixels*i;
LineTo(round(f(a,phi,L)*cos(phi+2*pi/360*ang)*expand)+x,round(f(a,phi,L)*sin(phi+2*pi/360*ang)*expand+y));
end;
end;
begin
InitGr;
Draw(100,200,50);
CloseGraph;
end.
Draw(100,200,50); - рисует кривую с началом координат в точке (100;200) и поворотом на 50 градусов по часовой стрелке.