# hyperbolisch
questiontype=0
n=$counter
helptext=$empty
#inputs=1
cols=15
rows=4
checkfile=exos/checkfile2.proc
!if $level=0
    R=$counter
!else
    R=$level
!endif    

# answer$n:                                                                                                                                
# -1 : to the left                                                                                                                         
# 1 : to the right                                                                                                                         
# -2 : to the down                                                                                                                         
# 3 : to the up                                                                                                                            
# answer$n=-1,3,+2,7 meaning 3 to the left and 7 up

question$n=!record 47 of lang/remarks.$taal
#@Welke verschuiving moet je op de grafiek van <b>f</b> toepassen,<br>om de grafiek van <b>g</b> te krijgen
exotext=!record 48 of lang/remarks.$taal
#@<font color=blue>Hoe</font></a> vul ik het antwoord in?
sometext=!record 49 of lang/remarks.$taal
exotext=<p><a onmouseover="return escape('$sometext')">$exotext</a>
f=1/x

!if $R=1
    pm=!randitem -1,1
    a=!randint 1,10
    a=$[$pm*$a]
    b=!randint 1,9
    keuze=!randitem 1,0
    !if $keuze=0
	g=$a+1/(x + $b)
	G=$a + \frac{1}{x + $b}
	!if $pm=1
	    answer$n=+2,$a,-1,$b
	    rr=!record 59 of lang/remarks.$taal
	    #@De asymptoten zijn x=-$b en y=$a.<br>De verschuiving is dan $b naar links en $a omhoog.
	!else
	    answer$n=-2,$[-1*$a],-1,$b
	    rr=!record 60 of lang/remarks.$taal
	    #@De asymptoten zijn x=-$b en y=$a.<br>De verschuiving is dan $b naar links en $[-1*$a] omlaag.
	!endif
    !else
	g=$a+1/(x - $b)
	G=$a + \frac{1}{x - $b}
	!if $pm=1
	    answer$n=+2,$a,+1,$b
	    rr=!record 61 of lang/remarks.$taal
	    #@De asymptoten zijn x=$b en y=$a.<br>De verschuiving is dan $b naar rechts en $a omhoog.
	!else
	    answer$n=-2,$[-1*$a],+1,$b
	    rr=!record 62 of lang/remarks.$taal
	    #@De asymptoten zijn x=$b en y=$a.<br>De verschuiving is dan $b naar rechts en $[-1*$a] omlaag.
	!endif
    !endif
    textanswer$n=$rr
    texanswer$n= g(x)=$G
    formula$n=\left[ \begin{array}{l} f(x)=\frac{1}{x} \\ \\ g(x)= $G
    !if $image=1
	!goto IMAGE
    !endif
 !exit
!endif

!if $R>1
    pm=!randitem -1,1
    a=!randint 2,10
    a=$[$pm*$a]
    b=!randint 1,9
    keuze=!randitem 1,0
    !if $keuze=0
	!if $pm=1
	    g=($a*x+$[$a*$b + 1])/(x + $b)
	    G=\frac{$a\cdot x + $[$a*$b +1]}{x + $b}
	    answer$n=+2,$a,-1,$b
	    texanswer$n=g(x)=$G=\frac{$a(x+$b)+1}{x+$b}=\frac{$a(x+$b)}{x+$b}+\frac{1}{x+$b}=$a+\frac{1}{x+$b}
	    rr=!record 63 of lang/remarks.$taal
	    #@De verschuiving is dan $b naar links en $a omhoog.
	!else
	    g=($a*x-$[-1*$a*$b - 1])/(x + $b)
	    G=\frac{$a \cdot x - $[-1*$a*$b -1]}{x + $b}
	    answer$n=-2,$[-1*$a],-1,$b
	    texanswer$n=g(x)=$G=\frac{$a(x+$b)+1}{x+$b}=\frac{$a(x+$b)}{x+$b}+\frac{1}{x+$b}=$a+\frac{1}{x+$b}
	    rr=!record 64 of lang/remarks.$taal
	    #@De verschuiving is dan $b naar links en $[-1*$a] omlaag.
	!endif
    !else
	!if $pm=-1
	    g=($a*x + $[-1*$a*$b +1])/(x - $b)
	    answer$n=-2,$[-1*$a],+1,$b
	    G=\frac{$a \cdot x + $[-1*$a*$b +1]}{x - $b}
	    texanswer$n=g(x)=$G=\frac{$a(x-$b)+1}{x-$b}=\frac{$a(x-$b)}{x-$b}+\frac{1}{x-$b}=$a+\frac{1}{x-$b}
	    rr=!record 65 of lang/remarks.$taal
	    #@De verschuiving is dan $b naar rechts en $[-1*$a] omlaag.
	!else
	    g=($a*x + $[-1*$a*$b +1])/(x - $b)
	    G=\frac{$a \cdot x $[-1*$a*$b +1]}{x - $b}
	    answer$n=+2,$a,+1,$b
	    texanswer$n=g(x)=$G=\frac{$a(x-$b)+1}{x-$b}=\frac{$a(x-$b)}{x-$b}+\frac{1}{x-$b}=$a+\frac{1}{x-$b}
	    rr=!record 66 of lang/remarks.$taal
	    #@De verschuiving is dan $b naar rechts en $a omhoog.
	!endif
    !endif
    textanswer$n=$rr
    formula$n=\left[ \begin{array}{l} f(x)=\frac{1}{x} \\ \\ g(x)= $G \end{array}
    !if $image=1
	!goto IMAGE
    !endif
 !exit
!endif

:IMAGE
helptext=!record 41 of lang/remarks.$taal
insplot_set=size 0.6,0.6 ;nogrid ;autoscale ;xlabel "<x-axis>";ylabel"<y-axis>" ;border 
!insplot  [-10:10] [-20:20] $f notitle, $g notitle 
helptext=<a onmouseover="return escape('<img src=$wims_ref_name?&session=$session&module=$module&cmd=getins&special_parm=insert-1.gif>')">$helptext
