# spiegel om de x-as
checkfile=exos/checkfile1.proc
n=$counter
!if $level=0
    R=$counter
!else
    R=$level
!endif
var1=0
questiontype=0
plot=0
draw=0
math=1
arglist=g(x),y
!if $level=0
    R=$counter
!else
    R=$level
!endif    

question$n=!record 68 of lang/remarks.$taal
#@De grafiek van <b>f</b> wordt gespiegeld in de <em>x-as</em><br>Geef het functievoorschrift van het spiegelbeeld<br><small> noem de functie <b>g</b></small>
exotext=!record 48 of lang/remarks.$taal
#@<font color=blue>Hoe</font></a> vul ik het antwoord in?
sometext=!record 69 of lang/remarks.$taal
#@geef je antwoord in de vorm:<br><textarea cols=20 rows=2>g(x)=sqrt(x-7) of y=-x^5+3x</textarea><br>
!if $image=1
    helptext=!record 41 of lang/remarks.$taal
!else
    helptext=$empty
!endif


exotext=<p><a onmouseover="return escape('$sometext')">$exotext</a>
!if $R=1
    a=!randint 2,9
    b=!randint 2,9
    c=!randitem 3,4,5,6
    pm=!randitem +,-
    mp=!randitem +,-
    
    functies=$a*x^2 $pm $b*x\
    sqrt(x $pm $b) \
    $c*sqrt(x $pm $b) \
    sqrt(x $pm $b) \
    sqrt(-x $pm $b) \
    sqrt($c*x $pm $b) \
    $c*sqrt($a*x $pm $b) \
    sqrt(x) \
    $a*log(x $pm $b)\
    (x $pm $a)^$c  $mp $b\
    (x $pm $a)^$c  $mp $b\
    $a^x\
    $a^x $pm $b
        
    functie=!randline $functies
    formula$n=!texmath f(x)=$functie
    tot=!exec maxima  -1*($functie);
    answer$n=!line 1 of $tot
    texanswer$n=!texmath g(x)=$(answer$n)
!endif

!if $R>1
    a=!randint 2,9
    b=!randint 2,9
    c=!randitem 2,3,4,5,6
    pm=!randitem +,-
    mp=!randitem +,-
    functies=$a*x^3 $pm $b*x^2  $mp $c*x\
    $a*x^4 $pm $b*x^3  $mp $c\
    $a*x^5 $pm $b*x^3  $mp $c\
    sqrt(x^2 $pm $b) \
    sqrt(x^2 $pm $b*x)\
    $a*log(x^2 $pm $b)
    
    functie=!randline $functies
    formula$n=!texmath f(x)=$functie
    tot=!exec maxima  subst(-x,x,$functie);
    answer$n=!line 1 of $tot
    tot=!exec maxima  -1*($functie);
    answer$n=!line 1 of $tot
    texanswer$n=!texmath g(x)=$(answer$n)
    !if $image=1
	!goto IMAGE
    !else
	!exit
    !endif
!endif



:IMAGE
insplot_set=size 0.6,0.6 ;nogrid ;autoscale ;xlabel "<x-axis>";ylabel"<y-axis>" ;border
!insplot  $functie notitle, $(answer$n) notitle
helptext=<a onmouseover="return escape('<img src=$wims_ref_name?&session=$session&module=$module&cmd=getins&special_parm=insert-1.gif>')">$helptext
