|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 3774 (0xebe)
Types: TextFile
Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
└─⟦129cab021⟧ »DATA«
└─⟦this⟧
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
└─⟦d65440be7⟧ »DATA«
└─⟦this⟧
with Elementary_Functions;
with Easy_X;
with Graphiques;
with Text_Io;
package body Fractales is
procedure Croissance (Chaine : in String; Nb_Iterations : in Integer) is
begin
null;
end Croissance;
procedure Affichage (Chaine : in String;
X_Min : in Integer;
Y_Min : in Integer;
Facteur : in Float) is
X_Utilisateur, Y_Utilisateur : Integer;
Delta_X : Integer := 100;
Delta_Y : Integer := 100;
Alpha : Float := 0.0;
Angle : constant := 60.0;
X : Float := 0.0;
Y : Float := 0.0;
Pi : constant := 3.1415;
begin
X_Utilisateur := Delta_X - Integer (Facteur * Float (X_Min));
Y_Utilisateur := Delta_Y - Integer (Facteur * Float (Y_Min));
for I in Chaine'Range loop
Text_Io.Put (Chaine (I));
if (Chaine (I) = 'A') then
X := X + 2.0 * Elementary_Functions.Cos (Alpha / 180.0 * Pi);
Y := Y + Elementary_Functions.Sin (Alpha / 180.0 * Pi);
end if;
if (Chaine (I) = '+') then
Alpha := Alpha + Angle;
end if;
if (Chaine (I) = '-') then
Alpha := Alpha - Angle;
end if;
Graphiques.Move (X_Utilisateur, Y_Utilisateur);
X_Utilisateur := Delta_X - Integer (Facteur * (X - Float (X_Min)));
Y_Utilisateur := Delta_Y - Integer (Facteur * (Y - Float (Y_Min)));
Graphiques.Draw (X_Utilisateur, Y_Utilisateur);
end loop;
end Affichage;
procedure Echelle (Chaine : in String;
X_Min : in out Integer;
Y_Min : in out Integer;
Facteur : in out Float) is
X_Utilisateur, Y_Utilisateur : Integer;
Delta_X, Delta_Y : Integer;
Alpha : Float := 0.0;
Angle : constant := 60.0;
X_Max : Integer := -200;
Y_Max : Integer := -200;
X : Float := 0.0;
Y : Float := 0.0;
Pi : constant := 3.1415;
begin
for I in Chaine'Range loop
Text_Io.Put (Chaine (I));
if (Chaine (I) = 'A') then
X := X + 2.0 * Elementary_Functions.Cos (Alpha / 180.0 * Pi);
Y := Y + Elementary_Functions.Sin (Alpha / 180.0 * Pi);
end if;
if (Chaine (I) = '+') then
Alpha := Alpha + Angle;
end if;
if (Chaine (I) = '-') then
Alpha := Alpha - Angle;
end if;
if (Integer (X) < X_Min) then
X_Min := Integer (X);
end if;
if (Integer (X) > X_Max) then
X_Max := Integer (X);
end if;
if (Integer (Y) < Y_Min) then
Y_Min := Integer (Y);
end if;
if (Integer (Y) > Y_Max) then
Y_Max := Integer (Y);
end if;
end loop;
Facteur := 500.0 / Float (Y_Max - Y_Min);
end Echelle;
procedure Dessin is
Display : String (1 .. 4) := "arum";
Chaine : String (1 .. 128) :=
"A-A++A-A-A-A++A-A++A-A++A-A-A-A++A-A++A-A++A-A-A-A++A-A++A-A++A-A-A-A++A-A++A-A++A-A-A-A++A-A++A-A++A-A-A-A++A-A";
Facteur : Float := 10.0;
X_Min : Integer := 200;
Y_Min : Integer := 200;
begin
Easy_X.Open (Display, "Fenetre", 0, 0, 1000, 1000);
loop
Text_Io.Put (Chaine);
Text_Io.New_Line;
Echelle (Chaine, X_Min, Y_Min, Facteur);
Affichage (Chaine, X_Min, Y_Min, Facteur);
Text_Io.New_Line;
end loop;
Easy_X.Close;
end Dessin;
end Fractales;