![]() |
Матрица статей Список статей Всячина Контакты | ||||||||||||
|
Кривая Госпера
program Gosp2;
uses CRT, Graph;
var
gd, gm: Integer;
procedure Draw(x, y, l, u : Real; t, q : Integer);
procedure Draw2(Var x, y: Real; l, u : Real; t, q : Integer);
begin
Draw(x, y, l, u, t, q);
x := x + l*cos(u);
y := y - l*sin(u)
end;
begin
if t > 0 then
begin
if q = 1 then
begin
x := x + l*cos(u);
y := y - l*sin(u);
u := u + pi;
end;
u := u - 2*pi/19;
l := l/sqrt(7);
Draw2(x, y, l, u, t-1, 0);
Draw2(x, y, l, u+pi/3, t-1, 1);
Draw2(x, y, l, u+pi, t-1, 1);
Draw2(x, y, l, u+2*pi/3, t-1, 0);
Draw2(x, y, l, u, t-1, 0);
Draw2(x, y, l, u, t-1, 0);
Draw2(x, y, l, u-pi/3, t-1, 1)
end
else
Line(Round(x), Round(y), Round(x + cos(u)*l), Round(y -sin(u)*l))
end;
begin
gd := Detect;
InitGraph(gd, gm, 'c:\bp\bgi');
Draw(100, 355, 400, 0, 4, 0);
ReadKey; {^}
CloseGraph
end.
Смотрите также: Ссылки: |