Код
Procedure InitG;assembler;
asm
mov ax,13h
int 10h
mov ax,0a000h
mov es,ax
end;
Procedure Pixel(X,Y : Word; C : Byte);
begin
y := y * 320;
y := Y + X;
asm
mov si,y
mov bl,c
mov es:[si],bl
end;
end;
Procedure WK;assembler;
asm
mov ah,0
int 16h
xor ax,ax
end;
Procedure Spir;
Var
x,y,a,t : Integer;
begin
a := 25;
For t :=1 to 1000 do
begin
x := round((a * cos(t))/t);
x := round(x * 3);
y := round((a * sin(t))/t);
y := round(y * 3);
Pixel(x+100,y+100,15);
end;
end;
Procedure Epizicloid;
Var
x,y,a,b,fi : Integer;
Begin
a := 9; {radius vnutr okrushnosti}
b := 27; {radius vnesn okrushnosti}
{
Types graphics zavisit ot sootnoshenija m = A/B
if M > 0 and round then If m = then kardioida
}
For Fi := 1 to 50 do
begin
x := round((a + b) * cos(fi) - a * cos ((a + b) * fi / a));
x := round(x * 0.5);
y := round((a + b) * sin(fi) - a * sin ((a + b) * fi / a));
y := round(y * 0.5);
Pixel(x+70,y+50,4);
end;
end;
Procedure Gipozicloids;
Var
x,y,b,a,fi : Integer;
Begin
a := 9;
b := 27;
For Fi := 1 to 50 do
begin
x := round((b - a) * cos(fi) + a * cos((b - a) * fi / a));
y := round((b - a) * sin(fi) - a * sin((b - a) * fi / a));
Pixel(x+200,y+50,3);
end;
end;
{Razvertka Evolventa}
Procedure Raz_Evol;
Var
a, x,y,fi : Integer;
begin
a := 2; {radius}
For Fi := 0 to 10 do
begin
x := round (a * cos(fi) + a * fi * sin(fi));
x := round (x * 1);{Mashtabirovanie}
y := round (a * sin(fi) - a * fi * cos(fi));
y := round (y * 1);
Pixel(x+200,y+90,14);
end;
end;
BEGIN
InitG;
Spir;
Epizicloid;
Gipozicloids;
Raz_Evol;
WK;
END.
asm
mov ax,13h
int 10h
mov ax,0a000h
mov es,ax
end;
Procedure Pixel(X,Y : Word; C : Byte);
begin
y := y * 320;
y := Y + X;
asm
mov si,y
mov bl,c
mov es:[si],bl
end;
end;
Procedure WK;assembler;
asm
mov ah,0
int 16h
xor ax,ax
end;
Procedure Spir;
Var
x,y,a,t : Integer;
begin
a := 25;
For t :=1 to 1000 do
begin
x := round((a * cos(t))/t);
x := round(x * 3);
y := round((a * sin(t))/t);
y := round(y * 3);
Pixel(x+100,y+100,15);
end;
end;
Procedure Epizicloid;
Var
x,y,a,b,fi : Integer;
Begin
a := 9; {radius vnutr okrushnosti}
b := 27; {radius vnesn okrushnosti}
{
Types graphics zavisit ot sootnoshenija m = A/B
if M > 0 and round then If m = then kardioida
}
For Fi := 1 to 50 do
begin
x := round((a + b) * cos(fi) - a * cos ((a + b) * fi / a));
x := round(x * 0.5);
y := round((a + b) * sin(fi) - a * sin ((a + b) * fi / a));
y := round(y * 0.5);
Pixel(x+70,y+50,4);
end;
end;
Procedure Gipozicloids;
Var
x,y,b,a,fi : Integer;
Begin
a := 9;
b := 27;
For Fi := 1 to 50 do
begin
x := round((b - a) * cos(fi) + a * cos((b - a) * fi / a));
y := round((b - a) * sin(fi) - a * sin((b - a) * fi / a));
Pixel(x+200,y+50,3);
end;
end;
{Razvertka Evolventa}
Procedure Raz_Evol;
Var
a, x,y,fi : Integer;
begin
a := 2; {radius}
For Fi := 0 to 10 do
begin
x := round (a * cos(fi) + a * fi * sin(fi));
x := round (x * 1);{Mashtabirovanie}
y := round (a * sin(fi) - a * fi * cos(fi));
y := round (y * 1);
Pixel(x+200,y+90,14);
end;
end;
BEGIN
InitG;
Spir;
Epizicloid;
Gipozicloids;
Raz_Evol;
WK;
END.