!set n=$teller
!if $graad=0
    R=$teller
!else
    R=$graad
!endif        
plaatje=0
varlist=$empty
arglist=$empty
varcnt=0
afrondingsfactor=0
woordmax=40
bijles=1
complex=1
bewerking=common/number.proc

!if $R=1
    a=!randitem 1,2,3,4,5
    num=!randint 1,8
    lijst=!record $num of nivo/data2
!endif

!if $R=2
    a=!randitem 1/2,1,1/4
    b=!randitem 1,1/2*sqrt(2)
    num=!randint 9,20
    lijst=!record $num of nivo/data2
!endif

!if $R=3
    a=!randitem 1,2,3,4,5
    b=!randitem 1,2,3,4,5
    num=!randint 9,20
    lijst=!record $num of nivo/data2
!endif    

!if $R>3
    plaatje=0
    a=!randitem 1,2,3,4,5
    b=!randitem 1,2,3,4,5    
    num=!randint 21,52
    lijst=!record $num of nivo/data2
!endif

somtekst$n=!record 3 of lang/remarks.$taal
lijst=!replace internal @ by , in $lijst
opgave$n=!item 1 of $lijst
opgave$n=!texmath $(opgave$n)
modulus=!item 2 of $lijst
argument=!item 3 of $lijst
!if sqrt isin $modulus
    modulus=!exec maxima $modulus
!else
    modulus=!exec pari $modulus
!endif

GOED$n=$modulus,$argument
!for p in pi,cdot,sqrt
    P=\$p
    modulus=!replace internal $p by $P in $modulus
    argument=!replace internal $p by $P in $argument
!next p
modulus=!replace internal * by $ \cdot $ in $modulus
argument=!replace internal * by $ \cdot $ in $argument
goed$n=\left[ \begin{array}{l} modulus=$modulus \\ arg=$argument \end{array}
!if $plaatje=1
    xsize=200
    ysize=200
    x=!item 4 of $lijst
    y=!item 5 of $lijst
#    xmax=$[(abs($x)) + 2]
#    xmin=$[-1*$xmax]
#    ymax=$[(abs($y)) + 2]
#    ymin=$[-1*$ymax]
    xmin=-5
    ymin=-5
    xmax=5
    ymax=5

    plaatje$n=$xsize,$ysize\
    transparent white\
    xrange $xmin,$xmax\
    yrange $ymin,$ymax\
    hline 0,0,blue\
    vline 0,0,blue\
    dline 0,$y,$x,$y,green\
    dline $x,0,$x,$y,green\
    arrow 0,0,$x,0,7,green\
    arrow 0,0,0,$y,7,green\
    linewidth 2\
    arrow 0,0,$x,$y,7,red
!endif

!exit    
