<<< A15. INTERPO2.83P

> >>

Rechte lijn y1=ax+b door twee punten; interpoleren, extrapoleren. Bijvoorbeeld:
de lijn door (2,3) en (10,6); extrapoleer x=100 geeft y=39,75
1. 2.
3. 4.
De lijn door de punten A en B heeft als vergelijking:


Het volledige programma (met
toelichting tussen aanhalingstekens)

ClrHome "OPENINGSSCHERM"
Disp "LINEAIR"
Disp "INTERPOLEREN"
Disp "VOLGENS Y=AX+B"
Disp "NA INVOER VAN 2"
Disp "PAAR (A,B) (C,D)"
Disp "EN GEGEVEN X"
Disp "OF Y."
Output(8,1,"---------[ENTER]")
Pause

Lbl 0 "
INVOER TWEE PUNTEN"
ClrHome
Disp "(A,B) (C,D)"
Prompt A,B,C,D
ClrHome
If A=C "
ALS A=C DAN VERTICAAL"
Then
Output(1,1,"VERT. LIJN:")
Output(2,1,"X=")
Output(2,3,A)
Pause : Goto 0
End

"
BEREKENING VERGELIJKING"
(D-B)/(C-A)
® R
B-RA
® S
Output(1,1,"VERGL Y=AX+B:")
Output(3,1,"A=")
Output(3,3,R)
Output(4,1,"B=")
Output(4,3,S)
Output(8,10,"[ENTER]")
Pause :ClrHome
Menu("INVOER COORD.","X",A,"Y",B)
Lbl A "INVOER X, UITVOER Y"
ClrHome
Output(1,1,round(A,2))
Output(1,5," ")
Output(1,6,round(C,2))
Output(1,10," ")
Output(2,1,round(B,2))
Output(2,5," ")
Output(2,6,round(D,2))
Output(2,10," ")
Output(1,11,"X")
Disp "":Disp "":Disp ""
Input "INVOER X:",X
(D-B)(X-A)/(C-A)+B
® Y
Disp "ANTW Y=",round(Y,4)
Output(1,11,round(X,2))
Output(2,11,round(Y,2))
Output(8,1,"ENTER=VOLGENDE")
Pause : Goto 0

Lbl B "
INVOER Y"
ClrHome
"
ALS B=D DAN HORIZONTAAL"
If B=D
Then
Disp "HOR. LIJN MET"
Disp "VERGL.:"
Output(3,1,"Y=")
Output(3,3,B)
Output(8,10,"[ENTER]")
Pause : Goto 0
End

"
UITVOER X"
Output(1,1,round(A,2))
Output(1,5," ")
Output(1,6,round(C,2))
Output(1,10," ")
Output(2,1,round(B,2))
Output(2,5," ")
Output(2,6,round(D,2))
Output(2,10," ")
Output(2,11,"Y")
Disp "":Disp "":Disp ""
Input "INVOER Y:",Y
(Y-B)(C-A)/(D-B)+A
® X
Output(1,11,round(X,2))
Output(2,11,round(Y,2))
Disp "ANTW. X=",X
Output(8,1,"ENTER=VOLGENDE")
Pause :Goto 0