Найти тему
Sergey Leonidovich

Графика Pascal N-IDE

program draw_line;

uses
Crt, Math, Graph;

var
graphicsDriver, graphicsMode: Integer;
x1, y1, x2, y2, dx, dy: real;
u1, v1, u2, v2: real;
p, q, a: real;
b, d, c: real;
f, k, w, z, h, e: Real;

begin
while (1 = 1) do
begin
k := 6.2831;
clearDevice();
graphicsDriver := Detect;
InitGraph(graphicsDriver, graphicsMode, '');
x1 := getMaxX div 2;
y1 := getMaxY div 2;
u1 := x1;
v1 := y1;
a := 0.5;
c := 0;
setColor(Yellow);
p := 0.0001 * trunc(10000 * Random());
q := 0.0001 * trunc(10000 * Random());
b := 0.0001 * trunc(10000 * Random());
d := 0.0001 * trunc(10000 * Random());
h := 0.25 * trunc(12 * random() + 1);
while (c <= 100) do
begin
c := c + 0.01;
w := p * c + q;
z := b * c + d;
e := sin(w) + cos(z);
f := cosh(exp(h * e));
dx := cos(c * f);
dy := sin(c * f);
x2 := x1 + a * dx;
y2 := y1 + a * dy;
line(trunc(x1), trunc(y1), trunc(x2), trunc(y2));
x1 := x2;
y1 := y2;
u2 := u1 - a * dx;
v2 := v1 - a * dy;
line(trunc(u1), trunc(v1), trunc(u2), trunc(v2));
u1 := u2;
v1 := v2;
end;
end;
end.

Наука
7 млн интересуются