|
|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1152 (0x480)
Types: TextFile
Names: »LINIE.PAS«
└─⟦08ea08c61⟧ Bits:30003924 PolyPascal programmer
└─⟦this⟧ »LINIE.PAS«
└─⟦09235ab48⟧ Bits:30003065 Demoprogrammer K-Z til Pascal bog
└─⟦this⟧ »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»