0010 USE UNIGRAPHICS
0020
0030 graphmode:=0
0040
0050 PROC firkant(l,g)
0060   a:=l*cos(g/180*pi); b:=l*sin(g/180*pi)
0070   draw(a,b)
0080   draw(-b,a)
0090   draw(-a,-b)
0100   draw(b,-a)
0110 ENDPROC firkant
0120
0130 PROC graf(REF f(),xmin,xmax,ymin,ymax) CLOSED
0140   window(xmin,xmax,ymin,ymax)
0150   pencolor(2)
0160   moveto(xmin,0)
0170   drawto(xmax,0)
0180   moveto(0,ymin)
0190   drawto(0,ymax)
0200   moveto(xmin,f(xmin))
0210   pencolor(2)
0220   FOR x:=xmin TO xmax STEP 0.05 DO drawto(x,f(x))
0230   pencolor(1)
0240 ENDPROC graf
0250
0260 FUNC f(x)
0270   RETURN x/(1+x*x)
0280 ENDFUNC f
0290
0300 FUNC g(x)
0310   RETURN (x*x-6*x)/(x*x+2*x+2)
0320 ENDFUNC g
0330
0340 PROC ramme(v,h,u,o)
0350   window(xmin,xmax,ymin,ymax)
0360   viewport(v,h,u,o)
0370   clear
0380   pencolor(2)
0381   moveto(xmin,ymin)
0390   drawto(xmax,ymin)
0400   drawto(xmax,ymax)
0410   drawto(xmin,ymax)
0420   drawto(xmin,ymin)
0430   pencolor(1)
0440   viewport(v+5,h-5,u+5,o-5)
0450 ENDPROC ramme
0460
0470 PROC roset
0480   window(0,1,0,1)
0490   moveto(0.5,0.5)
0500   FOR i:=0 TO 360 STEP 10 DO firkant(0.3,i)
0510 ENDPROC roset
0520
0560
0570 IF graphmode<2 THEN
0580   h:=1
0590 ELSE
0600   h:=2
0610 ENDIF
0620 graphicscreen(graphmode)
0630 clear
0640 xmin:=0; xmax:=1; ymin:=0; ymax:=1
0650 background(1);ramme(50,450,5*h,155*h);background(0)
0670 graf(f(),-9,9,-1,1)
0680 WAIT 4
0690
0700 viewport(0,width-1,0,height-1);clear
0710 background(3);ramme(50,450,5*h,155*h);background(0)
0730 graf(g(),-10,7,-2,12)
0740 WAIT 5
0750
0760 viewport(0,width-1,0,height-1);clear
0780 background(7);ramme(5,300,2*h,150*h);background(0)
0790 graf(g(),-10,7,-2,12)
0800 background(13);ramme(330,530,5*h,100*h);background(0)
0810 graf(f(),-7,7,-1,1)
0820 WAIT 5
0830
0840 viewport(0,width-1,0,height-1);clear
0860 background(11);ramme(5,290,5*h,150*h);background(0)
0870 pencolor(2)
0880 roset
0890 pencolor(1)
0900 WAIT 4
0910
0930 background(4);ramme(300,470,5*h,100*h);background(0)
0940 pencolor(1)
0950 roset
0960 pencolor(1)
0970 WAIT 3
0980
1000 background(9);ramme(480,620,5*h,80*h);background(0)
1010 pencolor(3)
1020 roset
1030 pencolor(1)
1040 WAIT 5
1050
1070 background(15);ramme(250,550,50*h,170*h);background(0)
1080 graf(g(),-10,7,-2,12)
1090 WAIT 5
1100
1110 background(13);ramme(20,310,15*h,120*h);background(0)
1120 graf(f(),-7,7,-0.7,0.7)
1130
1140 WHILE key$="" DO NULL
1150 textscreen
