n=$counter
mathviewpanel=$module_title :x=:y=:and:or:sqrt()
checkfile=exos/checkfile1.proc
questiontype=0
plot=1
draw=0
math=0
question$n=!record 19 of lang/remarks.$taal
#@ Bepaal <b>alle</b> asymptoten van de onderstaande functie
ex1=!record 3 of lang/remarks.$taal
#@ Zie </a> voor de schrijfwijze de help pagina's
ex2=!record 24 of lang/remarks.$taal
helptext=<a onmouseover="this.T_WIDTH='100';this.T_HEIGHT='100';this.T_BORDERCOLOR='gold';this.T_BORDERWIDTH='1'; return escape('$ex2')">$ex1
vertikaal=!record 4 of lang/remarks.$taal
#@ De vertikale asymptoot is: de lijn
vertikalen=!record 5 of lang/remarks.$taal
#@ De vertikale asymptoten zijn de lijnen
!if $teaching=1 and $image=0
    exotext=!record 6 of lang/remarks.$taal    
    #@ Hier</a> staat een klein grafiekje van de functie
    #exotext=<a href="javascript:showimage();">$exotext
    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>
!else
    exotext=$empty
!endif

texanswer$n=$empty
n=$counter
prefix=size 0.6,0.6;grid ; xlabel "<x-axis>";ylabel"<y-axis>" ;border
!if $level=0
    R=$counter
!else
    R=$level
!endif   


!if $R=1
    a=!randitem -15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
    b=!randitem 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
    plotfunction=$a/(x-$b)
    formula$n=f(x)\,=\,\frac{$a}{\left(x - $b\right)}
    as1=$b
    as2=0
    answer$n=$as1@vertikaal,$as2@horizontaal
    texanswer$n= x=$as1 \wedge  y=$as2
    textanswer$n=$vertikaal <em> x=$as1</em><br> &and; $horizontaal <em>y=$as2</em>
    !if $image=1
	xrange=-20:20
	ymin=-20
	ymax=20
	yrange=$ymin:$ymax
	image_settings$n=$prefix ; arrow 1 from $as1,$ymin to $as1,$ymax nohead lt 4
	image$n=[$xrange] [$yrange] $plotfunction notitle lt 1 , $as2 notitle lt 4     
    !else
	!if $teaching=1
	    xrange=-20:20
	    ymin=-20
	    ymax=20
	    yrange=$ymin:$ymax
	    insplot_set=$prefix ; arrow 1 from $as1,$ymin to $as1,$ymax nohead lt 4
	    !insplot [$xrange] [$yrange] $plotfunction notitle lt 1 , $as2 notitle lt 4     
	!endif
    !endif
 !exit
!endif
!if $R=2	
    keuze=!randitem 1,2
    !if $keuze=1
	##algemene vergelijking hyperbool:##f(x)=a/(x*(x-b)*(x-c))
	##verticale asymptoot:x=b of x=c of x=0
	a=!randitem -15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,2,3,4,5,6,7,8,9,10,11,12,13,14,15
        b=!randitem 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
        c=!randitem 2,3,4,5,6,7,8,9,10,11,12,13,14,15
        d=!randitem 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
    !else
        a=!randitem 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
        b=!randitem 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
        c=!randitem 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
        d=!randitem 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
    !endif
    plotfunction=($a*x+$b)/($c*x-$d)
    formula$n=f(x)\,=\,\frac{$a\cdot x +$b}{$c \cdot x - $d}
    tot=!exec pari $a/$c \
    $d/$c
    as1=!line 1 of $tot
    as2=!line 2 of $tot
    answer$n=$as1@horizontaal,$as2@vertikaal
    texanswer$n= x=$as2 \wedge  y=$as1
    textanswer$n=$vertikaal x=$as1 &and; $horizontaal y=$as2
    !if $image=1
	ymin=-20
	ymax=20
	xrange=-20:20
	yrange=$ymin : $ymax
	image_settings$n=$prefix ; arrow 1 from $as2,$ymin to $as2,$ymax nohead lt 4
	image$n=[$xrange] [$yrange] $plotfunction notitle lt 1 , $as1 notitle lt 4	
    !else
	!if $teaching=1
	    ymin=-20
	    ymax=20
	    xrange=-20:20
	    yrange=$ymin : $ymax
	    insplot_set=$prefix ; arrow 1 from $as2,$ymin to $as2,$ymax nohead lt 4
	    !insplot [$xrange] [$yrange] $plotfunction notitle lt 1 , $as1 notitle lt 4	
	!endif
    !endif
 !exit
!endif
!if $R=3
    ##algemene vergelijking hyperbool:##f(x)=a/(x*(x-b)*(x-c))
    ##verticale asymptoot:x=b of x=c of x=0
    a=!randitem 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
    b=!randitem 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
    c=!randitem 2,3,4,5,6,7,8,9,10,11,12,13,14,15
    d=!randitem 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
    
    plotfunction=($a*x^2+$b)/($c*x^2-$d)
    formula$n=f(x)\,=\,\frac{$a\cdot x^2 +$b}{$c \cdot x^2 - $d}
    as1=sqrt($d/$c)
    as2=-1*sqrt($d/$c)
    as3=!exec pari A=($a/$c)
    !if . isin $[$as1]
	D=!exec pari $d/$c
	as1=sqrt($D)
	as2=-1*sqrt($D)
    !else
	as1=$[$as1]
	as2=$[-1*$as2]
    !endif	        
    answer$n=$as1@vertikaal,$as2@vertikaal,$as3@horizontaal
    texanswer$n= x=$as1 \wedge  x=$as2 \wedge  y=$as3
    texanswer$n=!replace internal sqrt by \sqrt in $(texanswer$n)
    textanswer$n=$vertikalen x=$as1 &and; x=$as2 <br>$horizontaal y=$as3
    !if $image=1
	ymin=-20
	ymax=20
	xrange=-20:20
	yrange=$ymin : $ymax
	image_settings$n=$prefix  ; arrow 1 from $as1,$ymin to $as1,$ymax nohead lt 4; arrow 2 from $as2,$ymin to $as2,$ymax nohead lt 4
	image$n=[$xrange] [$yrange] $plotfunction notitle lt 1 , $as3 notitle lt 4	
    !else
	!if $teaching=1
	    ymin=-20
	    ymax=20
	    xrange=-20:20
	    yrange=$ymin : $ymax
	    insplot_set=$prefix  ; arrow 1 from $as1,$ymin to $as1,$ymax nohead lt 4; arrow 2 from $as2,$ymin to $as2,$ymax nohead lt 4
    	    !insplot [$xrange] [$yrange] $plotfunction notitle lt 1 , $as3 notitle lt 4	
	!endif
    !endif
 !exit    
!endif
!if $R>3
    ##algemene vergelijking hyperbool:##f(x)=a/(x*(x-b)*(x-c))
    ##verticale asymptoot:x=b of x=c of x=0
    a=!randitem -4,-3,-2,-1,1,2,3,4
    b=!randitem 1,2,3,4,5,6
    c=!randitem 1,2,3,4,5,6
    g=!randitem 0.5,1.5,2,2.5,3
    f=!exec pari (x+$b)*(x-$c) 
    plotfunction=$a*$g^(1/($f))
    formula$n=f(x)\,=\,$a\cdot $g^n \,\,met\,\,  n=\frac{1}{$f}  
    as1=$[-1*$b]
    as2=$c
    as3=$a
    answer$n=$as1@vertikaal,$as2@vertikaal,$as3@horizontaal
    textanswer$n=$vertikalen x=$as1 $en x=$as2<br>$horizontaal <em>y=$as3</em> 
    texanswer$n= x=$as1 \wedge  x=$as2 \wedge  y=$as3
    xrange=-8,8
    yrange=-10,10
    !if $image=1
	ymin=-10
	ymax=10
	xrange=-8:8
	yrange=$ymin : $ymax
	image_settings$n=$prefix  ; arrow 1 from $as1,$ymin to $as1,$ymax nohead lt 4; arrow 2 from $as2,$ymin to $as2,$ymax nohead lt 4
	image$n=[$xrange] [$yrange] $plotfunction notitle lt 1 , $as3 notitle lt 4	
    !else
	!if $teaching=1
	    ymin=-10
	    ymax=10
	    xrange=-8:8
	    yrange=$ymin : $ymax
	    insplot_set=$prefix  ; arrow 1 from $as1,$ymin to $as1,$ymax nohead lt 4; arrow 2 from $as2,$ymin to $as2,$ymax nohead lt 4
	    !insplot [$xrange] [$yrange] $plotfunction notitle lt 1 , $as3 notitle lt 4	
	!endif
    !endif    
!endif
