|
10 PRINT "x1の値は?"
20 INPUT XI
30 PRINT "y1の値は?"
40 INPUT YI
50 PRINT "x2の値は?"
60 INPUT XII
70 PRINT "y2の値?"
80 INPUT YII
90 PRINT "x3の値?"
100 INPUT XIII
110 PRINT "y3の値?"
120 INPUT YIII
130 PRINT "x4の値は?"
140 INPUT XIV
150 PRINT "y4の値は?"
160 INPUT YIV
170 LET AYI=YI
180 LET AYII=YII
190 LET AYIII=YIII
200 LET AYIV=YIV
210 LET C=(AYII-AYI)/(XII-XI)
220 LET D=AYI-C*XI
230 LET B=(AYIII-(C*XIII+D))/XIII^2
240 LET A=(AYIV-(B*XIV^2+C*XIV+D))/XIV^3
250 LET TYI=A*XI^3+B*XI^2+C*XI+D
260 LET TYII=A*XII^3+B*XII^2+C*XII+D
270 LET TYIII=A*XIII^3+B*XIII^2+C*XIII+D
280 LET TYIV=A*XIV^3+B*XIV^2+C*XIV+D
290 LET AYI=YI/TYI*AYI
300 LET AYII=YII/TYII*AYII
310 LET AYIII=YIII/TYIII*AYIII
320 LET AYIV=YIV/TYIV*AYIV
330 IF YI=TYI AND YII=TYII AND YIII=TYIII AND YIV=TYIV THEN GOTO 340 ELSE GOTO 210
340 PRINT "aは",A
350 PRINT "bは",B
360 PRINT "cは",C
370 PRINT "dは",D
380 PRINT "xの値は?"
390 INPUT X
400 LET Y=A*X^3+B*X^2+C*X+D
410 PRINT "yは",Y
420 GOTO 380
430 END
|
|