\START\ \COMMENT=Program file dated 08/06/95, 22:05 \NAME=Circum \FILE=CIRCUM.85P ClLCD Disp " Circum/Inscribed" Disp " Integration" Disp "" Disp "Do you want graphics" Menu(1,"Yes",YES,5,"No",NO) Lbl NO 0\->\G Disp "No Graphics" Goto nint Lbl YES Disp "Graphics On" 1\->\G Lbl nint Prompt xMin Prompt xMax Lbl Opts ClLCD Disp "Number of intervals:" Prompt N (xMax-xMin)/N\->\D 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" 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) 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) 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\