ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
659 B

  1. 10 PRINT "LINEAR INTERPOLATION"
  2. 20 PRINT
  3. 29 REM - ENTER X- AND Y-COORDINATES OF TWO POINTS ON THE LINE
  4. 30 PRINT "X,Y OF FIRST POINT";
  5. 40 INPUT X1,Y1
  6. 50 PRINT "X,Y OF SECOND POINT";
  7. 60 INPUT X2,Y2
  8. 69 REM - ENTER X-COORDINATE OF POINT TO BE INTERPOLATED
  9. 70 PRINT "INTERPOLATE: X=";
  10. 80 INPUT X
  11. 89 REM - COMPUTE CORRESPONDING Y-COORDINATE
  12. 90 Y=Y1+(Y2-Y1)/(X2-X1)*(X-X1)
  13. 99 REM - ROUND OFF, PRINT
  14. 100 PRINT " Y = ";INT(Y*1000+.5)/1000
  15. 110 PRINT
  16. 120 PRINT "MORE POINTS ON THIS LINE (1=yes, 0=NO)";
  17. 130 INPUT Z
  18. 140 PRINT
  19. 150 IF Z=1 THEN 70
  20. 159 REM - INTERPOLATE ON ANOTHER LINE?
  21. 160 PRINT "NEW LINE (1=YES, 0=NO)";
  22. 170 INPUT Z
  23. 180 IF Z=1 THEN 20
  24. 190 END