\START\ \COMMENT=Program file dated 08/06/95, 22:05 \NAME=Integ \FILE=Integ.85p ClLCD Disp "Integration Package" Disp "" Disp "Choose your method" Disp "of integration" Menu(1,"Riem",riem, 2,"Circ",circ, 3,"Trap",trap) Lbl riem 1\->\meth Goto grch Lbl circ 2\->\meth Goto grch Lbl trap 3\->\meth Lbl grch ClLCD Disp "Do you want graphics" Menu(1,"Yes",YES,5,"No",NO) Lbl YES 1\->\G Disp "Graphics On" Goto nint Lbl NO 0\->\G Disp "No Graphics" Lbl nint ClLCD Prompt xMin Prompt xMax Lbl Opts ClLCD Disp "Number of intervals:" Prompt N (xMax-xMin)/N\->\D If meth==1 Then Disp "Left or Right hand" Menu(1,"Left",LEFT,5,"Right",RIGHT) Lbl RIGHT D\->\LR Disp "Right" Goto ChkG Lbl LEFT 0\->\LR Disp "Left" End If meth==2 Then Disp "Circum- or Inscribed" Menu(1,"Circum",Circ,5,"Inscr",Inscr) Lbl Inscr 1\->\CI Disp "Inscribed" Goto ChkG Lbl Circ 0\->\CI Disp "Circumscribed" End Lbl ChkG If G==0 Goto NoG ClDrw If G==1 Then FnOff FnOn 1 fMax(y1,x,xMin,xMax)\->\V evalF(y1,x,V)\->\yMax fMin(y1,x,xMin,xMax)\->\V evalF(y1,x,V)\->\yMin (yMax-yMin)/62\->\H yMax+H\->\yMax yMin-H\->\yMin If yMin>0 0\->\yMin If yMax<0 0\->\yMax DrawF y1 StPic functgr 2\->\G FnOff End Lbl NoG 0\->\RSum xMin\->\X If G==2 RcPic functgr For(I,1,N,1) If meth==1 Then X+LR\->\x y1\->\Y If G==0 Goto AddOn Line(X,0,X,Y) Line(X,Y,X+D,Y) Line(X+D,0,X+D,Y) End If meth==2 Then evalF(y1,x,X)\->\YL evalF(y1,x,X+D)\->\YR YL\->\Y If CI==0 and YR>Y YR\->\Y If CI==1 and YR\Y If G==0 Goto AddOn Line(X,0,X,Y) Line(X,Y,X+D,Y) Line(X+D,0,X+D,Y) End If meth==3 Then evalF(y1,x,X)\->\YL evalF(y1,x,X+D)\->\YR (YL+YR)/2 \->\ Y If G==0 Goto AddOn Line(X,0,X,YL) Line(X,YL,X+D,YR) Line(X+D,0,X+D,YR) End Lbl AddOn RSum+Y\->\RSum X+D\->\X End If G\<>\0 Pause RSum*D\->\RSum Disp "Sum=",RSum Menu(1,"Again",Opts,5,"Quit",Quit) Lbl Quit \STOP\