DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦f0391e69f⟧ Ada Source

    Length: 10240 (0x2800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Test_Eays_X, seg_03567d

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with Easy_X;
with Elementary_Functions;
with Text_Io;


use Easy_X;


procedure Test_Eays_X (Term : in String) is
    package Io is new Text_Io.Integer_Io (Integer);
    use Arithmetic;
    X, Y : Easy_X.Coordinate;
    Z : Dimension;


    procedure Carre (Px, Py : in Easy_X.Coordinate; Cote : Dimension) is
    begin
        Easy_X.Move_To (Px, Py);
        Easy_X.Line_To (Px + Cote, Py);
        Easy_X.Line_To (Px + Cote, Py + Cote);
        Easy_X.Line_To (Px, Py + Cote);
        Easy_X.Line_To (Px, Py);
    end Carre;

    procedure Draw_Ellipse (Ox : in Easy_X.Coordinate;
                            Oy : in Easy_X.Coordinate;
                            Base : in Dimension;
                            Hauteur : in Dimension) is

        X : Easy_X.Coordinate;
        Y : Easy_X.Coordinate;
        Pas : Integer;

    begin
        X := Ox;
        Y := Oy;
        Pas := 0;
        Move_To (X + Base, Y);
        for I in 1 .. 90 loop
            Pas := Pas + 4;
            Y := Easy_X.Coordinate
                    (Float (Oy) - Float (Hauteur) *
                                     (Elementary_Functions.Sin
                                         (Float (Pas) * 3.14116 / 180.0)));

            X := Easy_X.Coordinate
                    (Float (Ox) + Float (Base) *
                                     (Elementary_Functions.Cos
                                         (Float (Pas) * 3.14116 / 180.0)));

            Line_To (X, Y);
        end loop;
        Move_To (Ox, Oy);
    end Draw_Ellipse;





    procedure Draw_Circle (Ox : in Easy_X.Coordinate;
                           Oy : in Easy_X.Coordinate;
                           Rayon : in Dimension) is

        X : Easy_X.Coordinate;
        Y : Easy_X.Coordinate;
        Pas : Integer;

    begin
        X := Ox;
        Y := Oy;
        Pas := 0;
        Move_To (X + Rayon, Y);
        for I in 1 .. 90 loop
            Pas := Pas + 4;
            Y := Easy_X.Coordinate
                    (Float (Oy) - Float (Rayon) *
                                     (Elementary_Functions.Sin
                                         (Float (Pas) * 3.14116 / 180.0)));

            X := Easy_X.Coordinate
                    (Float (Ox) + Float (Rayon) *
                                     (Elementary_Functions.Cos
                                         (Float (Pas) * 3.14116 / 180.0)));

            Line_To (X, Y);
        end loop;
        Move_To (Ox, Oy);
    end Draw_Circle;



    procedure Draw_Regular_Polygon (Ox : in Easy_X.Coordinate;
                                    Oy : in Easy_X.Coordinate;
                                    Segment : in Integer;
                                    Rayon : in Dimension) is

        X : Easy_X.Coordinate;
        Y : Easy_X.Coordinate;
        Pas : Integer;

    begin
        X := Ox;
        Y := Oy;
        Pas := 0;
        Move_To (X + Rayon, Y);
        for I in 1 .. Segment loop
            Pas := Pas + 360 / Segment;

            Y := Easy_X.Coordinate
                    (Float (Oy) - Float (Rayon) *
                                     (Elementary_Functions.Sin
                                         (Float (Pas) * 3.14116 / 180.0)));

            X := Easy_X.Coordinate
                    (Float (Ox) + Float (Rayon) *
                                     (Elementary_Functions.Cos
                                         (Float (Pas) * 3.14116 / 180.0)));

            Line_To (X, Y);
        end loop;
        Move_To (Ox, Oy);
    end Draw_Regular_Polygon;

    procedure Draw_Circle_Segment (Ox : in Easy_X.Coordinate;
                                   Oy : in Easy_X.Coordinate;
                                   Segment : in Integer;
                                   Rayon : in Dimension;
                                   Angle : in Integer) is
        X : Easy_X.Coordinate;
        Y : Easy_X.Coordinate;
        Pas : Integer;
    begin
        Pas := Angle;
        X := Easy_X.Coordinate
                (Float (Ox) + Float (Rayon) *
                                 (Elementary_Functions.Cos
                                     (Float (Pas) * 3.14116 / 180.0)));

        Y := Easy_X.Coordinate
                (Float (Oy) - Float (Rayon) *
                                 (Elementary_Functions.Sin
                                     (Float (Pas) * 3.14116 / 180.0)));
        Move_To (X, Y);
        for I in 1 .. Segment / 4 loop
            Y := Easy_X.Coordinate
                    (Float (Oy) - Float (Rayon) *
                                     (Elementary_Functions.Sin
                                         (Float (Pas) * 3.14116 / 180.0)));

            X := Easy_X.Coordinate
                    (Float (Ox) + Float (Rayon) *
                                     (Elementary_Functions.Cos
                                         (Float (Pas) * 3.14116 / 180.0)));

            Line_To (X, Y);
            Pas := Pas + 4;

        end loop;
        Move_To (Ox, Oy);
    end Draw_Circle_Segment;

    procedure Top_Cercle (Ox : in Easy_X.Coordinate;
                          Oy : in Easy_X.Coordinate;
                          Segment : in Integer;
                          Rayon : in Dimension) is

        X : Easy_X.Coordinate;
        Y : Easy_X.Coordinate;
        Pas : Integer := 0;

    begin
        X := Ox;
        Y := Oy;  
        Move_To (X + Rayon, Y);
        for I in 1 .. Segment loop


            Y := Easy_X.Coordinate
                    (Float (Oy) - Float (Rayon) *
                                     (Elementary_Functions.Sin
                                         (Float (Pas) * 3.14116 / 180.0)));

            X := Easy_X.Coordinate
                    (Float (Ox) + Float (Rayon) *
                                     (Elementary_Functions.Cos
                                         (Float (Pas) * 3.14116 / 180.0)));

            Move_To (X, Y);
            Draw_Regular_Polygon (X, Y, I + 2, 150);
            Pas := Pas + 360 / Segment;

        end loop;
        Move_To (Ox, Oy);
    end Top_Cercle;



begin

    Easy_X.Open (Term, "My_X_Window", 0, 0, 1000, 1000);
    Set_Font (Small_Font);  
    Draw_Ellipse (500, 500, 400, 200);
    Draw_Circle_Segment (500, 500, 90, 200, 0);
    Draw_Circle_Segment (500, 500, 45, 100, 90);  
    Draw_Circle_Segment (500, 500, 180, 50, 180);
    -- Top_Cercle (500, 500, 8, 250);
    while (Next_Event /= Button_Down) loop
        X := X;


    end loop;

    Close;


end Test_Eays_X;

E3 Meta Data

    nblk1=9
    nid=4
    hdr6=10
        [0x00] rec0=28 rec1=00 rec2=01 rec3=01e
        [0x01] rec0=22 rec1=00 rec2=03 rec3=01e
        [0x02] rec0=1e rec1=00 rec2=09 rec3=012
        [0x03] rec0=19 rec1=00 rec2=06 rec3=054
        [0x04] rec0=18 rec1=00 rec2=05 rec3=05c
        [0x05] rec0=0d rec1=00 rec2=02 rec3=018
        [0x06] rec0=23 rec1=00 rec2=07 rec3=06e
        [0x07] rec0=11 rec1=00 rec2=08 rec3=001
        [0x08] rec0=63 rec1=76 rec2=80 rec3=003
    tail 0x21529745684a084595b98 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 00 00 34 80 10 73 79 5f 58 2e 43 6f 6f 72 64  ┆   4  sy_X.Coord┆