n=$counter
!if $level=0
    R=$counter
!else
    R=$level
!endif
cols=10
rows=5
!if $rounding<10
    rounding=0
    !readproc $remarkdir/rounding.$taal
!endif
checkfile=$checkdir/coord.proc
question$n=!record 5 of lang/remarks.$taal
#@ Bepaal de co&ouml;rdinaten van de Top 
de_top=!record 6 of lang/remarks.$taal
#@ het toppunt is
exotext=!record 20 of lang/remarks.$taal
exotext=<small>$exotext</small>

#functie=(Cx -A)(x+B)= Cx^2 +xCB -xA -AB = Cx^2 +x(CB-A) -AB
#a= C
#b= CB-A
#c= AB

F=!randitem f,g,h,k,p,w
!if $R = 1
    A=!randitem 1,2,3,-1,-2,-3
    B=!randitem 1,2,3,-1,-2,-3
    C=!randitem 1,-1
!endif
!if $R = 2
    A=!randitem 4,5,6,7,8,-1,-2,-3
    B=!randitem 1,2,3,-4,-5,-6,-7,-8
    C=!randitem 1,-1
!endif
!if $R = 3
    A=!randitem -1,-2,-3,-4,-5,-6,-7,-8,1,2,3,4,5,6,7,8
    B=!randitem -1,-2,-3,-4,-5,-6,-7,-8,1,2,3,4,5,6,7,8
    C=!randitem -2,-3,-4,2,3,4
!endif
!if $R >3
    A=!randitem -1,-2,-3,-4,-5,-6,-7,-8,1,2,3,4,5,6,7,8
    B=!randitem -1,-2,-3,-4,-5,-6,-7,-8,1,2,3,4,5,6,7,8
    C=!randitem -1,-2,-3,-4,-5,-6,-7,-8,1,2,3,4,5,6,7,8
!endif
    
a=$C
b=$[$C*$B - $A]
c=$[$A*$B]
S=-1*($b)/(2*$a)
functie=(($C)*x - ($A))*(x + ($B))

tot=!exec pari F=$functie\
top=$S\
subst(F,x,top)\
printtex(F)\
printtex(top)\
printtex(subst(F,x,top))\
printtex(($C)*x - ($A))\
printtex((x + ($B)))

X=!line 2 of $tot
Y=!line 3 of $tot
Xtex=!line 5 of $tot
Ytex=!line 6 of $tot
L1=!line 7 of $tot
L2=!line 8 of $tot

texanswer$n=\left( $Xtex : $Ytex \right)
answer$n=$X,$Y
textanswer$n= $de_top  ($X:$Y)
keuze=!randitem 1,2
!if $keuze=1
    formula$n=!line 4 of $tot
    formula$n=y \,\, = $(formula$n)
!else
    formula$n=$F\left( x \right) =  \left( $L1 \right)\left( $L2 \right)
!endif

!if $image=1 or $teaching=1
    XSIZE=150
    YSIZE=150
    plaatje=\
    transparent white\
    xrange -10,10\
    yrange -100,100\
    vline 0,0,blue\
    hline 0,0,blue\
    linewidth 2\
    dvline $S,0,red\
    curve green,$functie\
    linewidth 6\
    point $(answer$n),red
    
    !if $printexo=1
	plot=0
	draw=1
	image$n=$plaatje
    !else    
	insdraw_size=150,150
	!insdraw $plaatje
	helptext=!record 11 of lang/remarks.$taal
	#@Hier</a> staat een klein grafiekje van de functie
	#helptext=<a href="javascript:showimage();">$helptext
	helptext=<a onmouseover="this.T_OPACITY=85;this.T_PADDING=10;this.T_WIDTH=$XSIZE;this.T_BORDERCOLOR='gold';this.T_BORDERWIDTH=1;return escape('<img src= $wims_ref_name?&session=$session&module=$module&cmd=getins&special_parm=insert-1.gif>')"><font color=blue>$helptext</font>
	#helptext=<a onmouseover="return escape('<img src= $wims_ref_name?&session=$session&module=$module&cmd=getins&special_parm=insert-1.gif>')"><font color=blue>$helptext</font>
    !endif
!endif
