n=$counter
checkfile=$checkdir/equation.proc
ss=!record 25 of lang/remarks.$taal
question$n=Gegeven zijn de onderstaande functie <em>f</em> en lijn <em>l</em><br>Bepaal de vergelijking van de raaklijn <em>m</em> aan <em>f</em> evenwijdig aan <em>l</em>. 
cols=15
rows=5
R=$level
!if $level=0
    R=$counter
!endif    
	
a=!randitem -5,-4,-2,-1,1,2,4,5
b=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
c=!randint -10,10
d=!randitem -5,-4,-3,-2,-1,1,2,3,4,5

x1=!exec pari (($d) - ($b))/(2*($a))
functie=!exec pari ($a)*x^2 + ($b)*x + ($c)
y1=!exec pari (($a)*($x1)^2 + ($b)*($x1) + ($c))
q=!exec pari (($y1)-($d)*($x1))
w=!randitem 8,9,10,11
!if $q>0
    e=$[(round($q))+$w]
!else
    e=$[(round($q))-$w]
!endif
lijn=($d)*x+($e)


tot=!exec pari printtex($functie)\
printtex($lijn)\
A=($d)*x+($q)\
printtex(A)\
printtex(2*($a)*x+($b))\
printtex($y1)\
printtex($x1)

answer$n=!line 3 of $tot
r4=!line 4 of $tot
y1=!line 6 of $tot
x1=!line 7 of $tot
r1=!line 5 of $tot
f=!line 1 of $tot
l=!line 2 of $tot

texanswer$n=\left[ \begin{array}{l} f'(x)\,=\,$r1 = $d \\ \rightarrow x=$x1  ; f($x1)=$y1 \\ \\ ($x1;$y1) ligt\, op\, f \,en \,op\, de\, raaklijn\\ y_m=$d\cdot x + b \\ $y1=$d \cdot $x1 +b \\ b=$q \\ m(x)=$r4 \end{array}
# alg form lijn y=mx+q
formula$n=\left[\begin{array}{l}f(x)=$f \\ l:y=$l \end{array}
!if x isin $(answer$n)
    varlist=x
!else
    varlist=nil
!endif
arglist=y,m(x),m:y

!if $image=1
    plot=1
    draw=0
    XSIZE=0.6
    YSIZE=0.6
    #; zeroaxis linetype 3
    image_settings$n=size 0.6,0.6; autoscale;noborder  ; tmargin 1 ; rmargin 1 
    #; grid xtics ytics mxtics mytics
    image$n=$functie notitle,$lijn notitle
!else
    !if $teaching=1
	exotext=!record 63 of $remarkdir/commonremarks.$taal
	#exotext=<a href="javascript:showimage();">$exotext
	#; zeroaxis linetype 3
	insplot_set=size 0.6,0.6; noborder  ; tmargin 1 ; rmargin 1
	# ; grid xtics ytics mxtics
	!insplot $functie notitle,$(answer$n) notitle
	exotext=<a onmouseover="return escape('<img src= $wims_ref_name?&session=$session&module=$module&cmd=getins&special_parm=insert-1.gif>')"><font color=blue>$exotext</font>
    !endif
!endif

!exit
