10 PRINT "CURVILINEAR INTERPOLATION"
20 PRINT
28 REM - LIMIT X() AND Y() TO MAXIMUN NUMBER OF POINTS KNOWN ON ANY
29 REM - CURVE TO BE ENTERED
30 DIM X(50), Y(50)
40 PRINT "NUMBER OF KNOWN POINTS";
50 INPUT P
60 FOR I=1 TO P
69 REM - ENTER COORDINATES OF KNOWN POINTS ON CURVE
70 PRINT "X,Y OF POINT";I;
80 INPUT X(I),Y(I)
90 NEXT I
100 PRINT
109 REM - ENTER X-COORDINATE OF POINT TO BE ITERPOLATED
110 PRINT "INTERPOLATE: X=";
120 INPUT A
130 B=0
138 REM - COMPUTE CORRESPONDING Y-COORDINATES BY LAGRANGE METHOD OF
139 REM - INTERPOLATION
140 FOR J=1 TO P
150 T=1
160 FOR I=1 TO P
170 IF I=J THEN 190
180 T=T*(A-X(I))/(X(J)-X(I))
190 NEXT I
200 B=B+T*Y(J)
210 NEXT J
219 REM - PRINT RESULTS
220 PRINT "             y=";B
230 PRINT
239 REM - INTERPOLATE MORE POINTS ON SAME CURVE?
240 PRINT "MORE X ON THIS CURVE (1=YES, 0=NO)";
250 INPUT C
260 IF C=1 THEN 100
269 REM - RESTART OR END PROGRAM?
270 PRINT "MORE X ON ANOTHER CURVE (1=YES, 0=NO)";
280 INPUT C
290 IF C=1 THEN 20
300 END
