DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC700 "Piccolo"

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

See our Wiki for more about RegneCentralen RC700 "Piccolo"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦2a7b125e4⟧ TextFile

    Length: 1152 (0x480)
    Types: TextFile
    Names: »LINIE.PAS«

Derivation

└─⟦09235ab48⟧ Bits:30003065 Demoprogrammer K-Z til Pascal bog
    └─ ⟦this⟧ »LINIE.PAS« 

TextFile

PROGRAM linie;

  VAR
    x1, y1, x2, y2 : REAL;
  
  PROCEDURE ret(x1, y1, x2, y2 : REAL);
  
    VAR
      a, b : REAL;
    
    BEGIN (* ret *)
      IF (x1 = x2) AND (y1 = y2) 
        THEN WRITELN('De to punkter er sammenfaldende')
      ELSE IF (x1 = x2)
        THEN WRITELN('Ligningen for linien er x = ', x1 : 6 : 2)
      ELSE IF (y1 = y2)
        THEN WRITELN('Ligningen for linien er y = ', y1 : 6 : 2)
      ELSE
        BEGIN
          a := (y2 - y1) / (x2 - x1);
          b := y1 - a * x1;
          BEGIN
            WRITE('Ligningen for linien er y = ', a : 6 : 2, 'x ');
            IF b > 0
              THEN WRITELN('+ ', b : 6 : 2)
              ELSE WRITELN(b : 6 : 2);
          END;
        END;
    END; (* ret *)
  
  BEGIN (* linie *)
    WRITE(CLRHOM);
    WRITE('Tast 1. punkts 1. koordinat: '); READLN(x1);
    WRITE('Tast 1. punkts 2. koordinat: '); READLN(y1);
    WRITE('Tast 2. punkts 1. koordinat: '); READLN(x2);
    WRITE('Tast 2. punkts 2. koordinat: '); READLN(y2);
    ret(x1, y1, x2, y2);
  END. (* linie *)
«eof»