nivo_title=Klik op het plaatje dat bij de tabel past...
n=$teller
bewerking=bewerking5.proc
soort=!randitem 1,2
!if $soort=2
    U=Y,EINDWAARDE,EINDWAARDE,UITWAARDE,UIT,UITKOMST,UITVOER,RESULTAAT,OUTPUT,YWAARDE
    G=X,STARTWAARDE,BEGINWAARDE,INWAARDE,IN,BEGINWAARDE,INVOER,INPUT,INPUT,XWAARDE
    getal=!randitem 1,2,3,4,5,6,7,8,9
    argument=!item $getal of $U
    varlist=!item $getal of $G
    B=1/4,1/2,3/4,1/2,5/6,2/3,2,6/5,1/10,1/9,1/3
    BB=!shuffle $B
    a=!randitem 1,2,3,4	
    a1=$a
    pm=!randitem +,-
    a2=$[$a $pm 1]
    !for p=1 to 4
	b$p=!item $p of $BB
	pm=!randitem -, 
	b$p=$pm$(b$p)
    !next p
    !if $negatief=1
        pm=!randitem +,-
	mp=!randitem +,-
        functies=($b1)*x $pm $a1,\
	($b2)*x $pm $a1,\
	($b3)*x $mp $a2,\
	($b4)*x $mp $a2
        XRANGE=-10:10
        YRANGE=-10:10
	tics=xtics -10,1,10;ytics -10,1,10
    !else
        functies=($b4)*x + $a1,\
	($b1)*x + $a1,\
	($b2)*x + $a2,\
	($b3)*x + $a2
        XRANGE=-1:10
        YRANGE=-1:10
	tics=xtics 0,1,10;ytics 0,1,10
    !endif
!endif
!if $soort=1
    U=kosten,afstand,hoogte,h,hoogte,uitkomst
    G=tijd,tijd,t,t,tijd,getal
    getal=!randitem 1,2,3,4,5,6
    argument=!item $getal of $U
    varlist=!item $getal of $G
    a=!randitem 2,3,4	
    B=0.25,0.5,0.75,1.25,1.5,2
    BB=!shuffle $B
    a1=$a
    pm=!randitem +,-
    a2=$[$a $pm 1]
    !if $negatief=1
	!for p=1 to 4
    	    pm=!randitem -, 
    	    b=!item $p of $BB
	    b$p=$pm$b	
	!next p
        pm=!randitem +,-
	mp=!randitem +,-
        functies=$b1*x $pm $a1,\
	$b2*x $pm $a1,\
	$b3*x $mp $a2,\
	$b4*x $mp $a2
        XRANGE=-10:10
        YRANGE=-10:10
	tics=xtics -10,1,10;ytics -10,1,10
    !else
	!for p=1 to 4
	    b$p=!item $p of $BB
	!next p
        functies=$b4*x + $a1,\
	$b1*x + $a1,\
	$b2*x + $a2,\
	$b3*x + $a2
        XRANGE=-1:10
        YRANGE=-1:10
	tics=xtics 0,1,10;ytics 0,1,10
    !endif
!endif
ins_attr=ismap
functies=!shuffle $functies
!for p=1 to 4
    functie$p=!item $p of $functies
    insplot_set=border ; zeroaxis linetype 3 ; tmargin 1 ; rmargin 1 ; grid ; xlabel "$varlist" ; ylabel "$argument" ; $tics
    plaatje$p=[$XRANGE] [$YRANGE] $(functie$p) notitle
!next p

plotsettings$n=$insplot_set
w=!randint 1,4
GOED$n=$w
goede_plaatje$n=$(plaatje$w)

!if $negatief=1
    !for p=-10 to 10 step 4 
	F=!replace internal x by $p in $(functie$w)
	table_body$n=!append line <tr><td>$p</td><td>$[$F]</td> to $(table_body$n)
    !next
!else
    !for p=0 to 10  step 2
	F=!replace internal x by $p in $(functie$w)
	table_body$n=!append line <tr><td>$p</td><td>$[$F]</td> to $(table_body$n)
    !next
!endif

somtekst$n=<table border="1" cellpadding="5" width="100%">\
<td><font size="+1"><tt>$varlist</tt></font><br><small><em>horizontale-as</em></small></td>\
<td><font size="+1"><tt>$argument</tt></font><br><small><em>verticale-as</em></small></td>\
$(table_body$n)\
</table>
F=!exec pari printtex($(functie$w))
F=!replace internal x by \cdot\\$varlist in $F
opgave$n=$argument\\=\\$F

!if $HINT=1
    hint=Zoek in de tabel de gemakkelijkste punten, zoals bijvoorbeeld $varlist=0...(of $argument=0)<br>\
    kijk dan in de grafiek of de bijhorende waarde voor $argument (of $varlist) klopt...
!endif
