n=$teller
bewerking=bewerking8.proc
!if $graad=0
    R=$teller
!else
    R=$graad
!endif 
!if $printbaar=0
    white=white
!else
    white=magenta
!endif        

!if $taal=nl
    nivo_title=Onderzoek de ongelijkheid
!else
    nivo_title=Investigate the Inequality
!endif
letter1=x
letter2=y
letter3=!randitem f,k
letter4=!randitem g,l
letter5=!randitem h,m
A=!randitem A,B,C,D,E,F,G,H,P,Q,R,S,T
pm =!randitem +,-
!if $taal=nl
    kleuren=blue@blauwe,green@groene,orange@oranje,purple@paarse
    kleuren=!shuffle $kleuren
    k1=!item 1 of $kleuren	
    k2=!item 2 of $kleuren
    k1=!replace internal @ by , in $k1
    k2=!replace internal @ by , in $k2
    kleur1=!item 2 of $k1
    color1=!item 1 of $k1
    kleur2=!item 2 of $k2
    color2=!item 1 of $k2
    color3=red
    kleur3=rooie
!else
    kleuren=blue,green,orange,purple
    kleuren=!shuffle $kleuren
    kleur1=!item 1 of $kleuren
    color1=!item 1 of $kleuren
    kleur2=!item 2 of $kleuren
    color2=!item 2 of $kleuren
    color3=red
    kleur3=red
!endif

!if $R < 5
    teken=!randitem &lt;,&gt;
    !if $R=1 or $R=2
	m=!randitem 1,2,3,-1,-2,-3
	q=!randitem 1,2,3,4,5,6,7,8	
	r=!randitem 1,2,3,4,5,6,7,8	
	lijn1=$m*$letter1 + $q
	lijn2=$r
	X=!exec pari ($r-$q)/$m
	Y=$r
	!if $m > 0
	    !if $teken=&lt;
    		GOED$n= x<$X
		htmlgoed=x&lt;$X
	    !else
		GOED$n= x>$X
		htmlgoed=x&gt;$X
	    !endif 
	!else
	    !if $teken=&lt;
    		GOED$n= x>$X
		htmlgoed=x&gt;$X
	    !else
		GOED$n= x<$X
		htmlgoed=x&lt;$X
	    !endif 
	!endif
	goed$n=$X
    !endif
    !if $R=3 or $R=4
	m1=!randitem 1/2,1/3,2/3,1,2,3,-1,-2,-3,-1/2,-1/3,-2/3
	m2=!exec pari -1*$m1
	q=!randitem 1,2,3,4,5,6,7,8	
	r=!randitem 1,2,3,4,5,6,7,8	
	lijn1=$m1*$letter1 + $q
	lijn2=$m2*$letter1 + $r
	#snijpunt" m1*x+q=m2*x+r <=> x(m1-m2)=r-q <=>X=(r-q)/(m1-m2)
	#  Y=$m1*$X+$q 
    	X=!exec pari ($r-($q))/($m1 - ($m2))
	Y=!exec pari $m1*($X) + $q
	
	!if $m1 > 0
	    !if $teken=&lt;
    		GOED$n= x<$X
		htmlgoed=x&lt;$X
	    !else
		GOED$n= x>$X
		htmlgoed=x&gt;$X
	    !endif 
	!else
	    !if $teken=&lt;
    		GOED$n= x>$X
		htmlgoed=x&gt;$X
	    !else
	        GOED$n= x<$X
		htmlgoed=x&lt;$X
	    !endif 
	!endif
	goed$n=$X
    !endif
    L1=!htmlmath $letter3 (x) = $lijn1
    L2=!htmlmath $letter4 (x) = $lijn2
    somtekst$n=In the <em>x,y</em>-plane are two lines <font size=+1 color=$color1><em>$letter3</em></font>\
     , and <font size=+1 color=$color2><em>$letter4</em></font> with equasions<br>\
    <ul>\
    <li>the line $L1 <font color=$color1>(the $kleur1 line)</font>\
    <li>the line $L2 <font color=$color2>(the $kleur2 line)</font>\
    </ul>\
    Determine for what <em>x</em> the inequality <p align="center"><font size=+1><em> $letter3 $teken $letter4</em></font><br> is true</p>
    
    antwoord$n=$(somtekst$n)<p>The correct answer: <em>$htmlgoed</em> 
    !if $PLAATJE=1
	XSIZE=400
	YSIZE=300
	knipperen=1
	aantal_beeldjes=2
	plaatje$n=$XSIZE,$YSIZE\
	transparent $white\
	xrange -20,20\
	yrange -20,20\
	linewidth 1\
	vline 0,0,blue\
	hline 0,0,blue\
	linewidth 3\
	curve $color1,$lijn1\
	curve $color2,$lijn2\
	linewidth s*20\
	point $X,$Y,green\
	text black,$X,$Y,normal,point $A
    !endif
!endif
!if $R>4
    m1=!randitem 1,2,3
    m2=$[-1*$m1]
    q=!randitem 1,2,3,4,5	
    r=!randitem 1,2,3,4,55	
    lijn1=$m1*$letter1 + $q
    lijn2=$m2*$letter1 + $r
    #snijpunt" m1*x+q=m2*x+r <=> x(m1-m2)=r-q <=>X=(r-q)/(m1-m2)
    
	X1=!exec pari ($r-$q)/($m1 - ($m2))
	Y1=!exec pari $m1*$X1+$q
	#een horizontale lijn boven/onder X1:Y1    
	m3=!exec pari $Y1+10    
	lijn3=$m3
	#snijpunt met lijn1
	# m3=m1*x+q <=>x=(m3-q)/m1   
	X2=!exec pari ($m3 - $q)/$m1
	Y2=$m3
	#snijpunt met lijn2
	# m3=m2*x+r <=>x=(m3-r)/m2   
	X3=!exec pari ($m3-$r)/$m2
	Y3=$m3
    
    teken=&lt;
    GOED$n=$X3<x&&x<$X2
    goed$n=$X3,$X2
    htmlgoed=$X3&lt;x&lt;$X2
    L1=!htmlmath $letter3 (x) = $lijn1
    L2=!htmlmath $letter4 (x) = $lijn2
    L3=!htmlmath $letter5 (x) = $lijn3
    somtekst$n=In the <em>x,y</em>-plane are three lines <font size=+1 color=$color1><em>$letter3</em></font>\
     , <font size=+1 color=$color2><em>$letter4</em></font> and <font size=+1 color=$color3><em>$letter5</em></font> with equations<br>\
    <ul>\
    <li>the line $L1 <font color=$color1>(the $kleur1 line)</font>\
    <li>the line $L2 <font color=$color2>(the $kleur2 line)</font>\
    <li>the line $L3 <font color=$color3>(the $kleur3 line)</font>\
    </ul>\
    Determine for which <em>x</em> the folowing is true:<p align="center">\
    <font size=+1 color=$color3><em> $kleur3 lijn</font> &gt; <font size=+1 color=$color1>$kleur1 line</font>\
    <br>and<br>\
    <font size=+1 color=$color3> $kleur3 line</font> &gt;<font size=+1 color=$color2> $kleur2 line </em></font></p>\
    Or in other words <em>x</em> geldt:<p align="center"><font size=+1><em> $letter5 &gt; $letter3 <em>en</em> $letter5 &gt; $letter4 </em></font></p>
    
    antwoord$n=$(somtekst$n)<p>The correct answer:<em>$htmlgoed</em> 
    PLAATJE=1
	XSIZE=400
	YSIZE=400
	knipperen=1
	aantal_beeldjes=2
	plaatje$n=$XSIZE,$YSIZE\
	transparent $white\
	xrange -20,20\
	yrange -20,20\
	linewidth 1\
	vline 0,0,blue\
	hline 0,0,blue\
	linewidth 3\
	curve $color1,$lijn1\
	curve $color2,$lijn2\
	curve $color3,$lijn3\
	linewidth s*20\
	point $X1,$Y1,green\
	point $X2,$Y2,green\
	point $X3,$Y3,green
!endif



hint=
#<div align="left"><font color=$fontcolor2>algemene hint<ul>\
#<li>\
#<li>\
#<li>\
#<li>\
#<li>\
#<li>\
#<li>\
#<li>\
#</ul></div> 