|
DataMuseum.dkPresents historical artifacts from the history of: Jet Computer Jet80 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Jet Computer Jet80 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 1152 (0x480) Types: TextFile Names: »LINIE.PAS«
└─⟦092727b26⟧ Bits:30005927 Demoprogrammer til Pascal bog (Jet-80) └─ ⟦this⟧ »LINIE.PAS«
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»