#list_of_things=['point','line','segment','circle','function','polygon','cone','ellipse','polynomial']
#toolbar=0 , 1 , 10 , 16 , 6
plaatje=0
n=$teller
debug=0
bewerking=nivo/bewerking3.proc
showToolBar=true
showMenuBar=true
framePossible=true
number_of_buttons=1
buttontext1=!record 4 of common/commonremarks.$taal  
width=640
height=480
points=2
vectors=1
R=$graad
!if $graad=0
    R=$teller
!endif

ggb=../nivo/grid2.ggb
list_of_things=[ 'vector','point' ];
toolbar= 7 | 40 , 6 , 0

!if $R=1
    keuze=!randitem 0,1,2
    #toolbar=34 | 10 | 0 | 6 | 40   
    appletcommand=$empty
    somtekst$n=!record 51 of lang/remarks.$taal
    # prefix my_ maakt dat geogebra2wims.js ze niet ook opstuurt
    # GEOGEBRA: lijn  => name @ slope @ constant                                                                                                          
    # GEOGEBRA: lijn  =>  name @ perp @ x=number
    x=!randitem 1,2,3,4,5,6,-1,-2,-3,-4,-5,-6
    y=!randitem 1,2,3,4,5,6,-1,-2,-3,-4,-5,-6
    a=!randitem 2,3,4,5,-1,-2,-3,-4,-5
    b=!randitem 1,-1,2,-2,3,-3,4,-4
    
    appletcommand=!append line document.applets[0].evalCommand("My_A = (0,0)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_B = ($x,$y)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_v = vector[My_A,My_B]"); to $appletcommand
    appletcommand=!append line document.applets[0].setVisible('My_A' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setVisible('My_B' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setColor('My_v',255,0,0); to $appletcommand
	
    !if $keuze=0
	opgave$n=$a \cdot \alpha
	gx=$[$a*$x]
	gy=$[$a*$y]
    !else
	!if $keuze=1
	    !if $b=1
		opgave$n=i \cdot \alpha
	    !else
		opgave$n=$b \cdot i\cdot \alpha 
	    !endif
	    gx=$[-1*$b*$y]
	    gy=$[$b*$x]
	!else
	    !if $a=-1
		opgave$n= - \overline \alpha
	    !else
		opgave$n=$a \cdot \overline \alpha
	    !endif
	    gx=$[$x+$a*$x]
	    gy=$[$y-$a*$y]
	!endif
    !endif
    GOED$n=$gx,$gy
    goed$n=\left( \begin{array}{c} $gx \\ $gy i \end{array} \right)
 !exit
!endif

!if $R=2
    appletcommand=$empty
    somtekst$n=!record 52 of lang/remarks.$taal
    xv=!shuffle 1,2,3,4,5,-1,-2,-3,-4,-5
    yv=!shuffle 1,2,3,4,5,-1,-2,-3,-4,-5
    x1=!item 1 of $xv
    y1=!item 2 of $yv
    x2=!item 3 of $xv
    y2=!item 4 of $yv
    appletcommand=!append line document.applets[0].evalCommand("My_A = (0,0)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_B = ($x1,$y1)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_C = ($x2,$y2)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_v = vector[My_A,My_B]"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_w = vector[My_A,My_C]"); to $appletcommand    
    appletcommand=!append line document.applets[0].setVisible('My_A' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setVisible('My_B' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setVisible('My_C' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setColor('My_v',255,0,0); to $appletcommand
    appletcommand=!append line document.applets[0].setColor('My_w',0,0,255); to $appletcommand

    keuze=!randitem 0,1
    keuze=1
    a=!randitem 1,2,3,4
    pm=!randitem  ,-
    mp=!randitem +,-
    !if $keuze=0
	!if $a=1
	    opgave$n=$pm \alpha $mp  \beta 
	!else
	    opgave$n=$pm \alpha $mp $a \cdot \beta 
	!endif
	gx=$[$pm 1*$x1 $mp 1*$a*($x2)]
	gy=$[$pm 1*$y1 $mp 1*$a*($y2)]
    !else    
	gx=$[($pm 1)*$x1 $mp 1*$a*($x2)]
	gy=$[($pm 1)*$y1 - 1*($mp 1)*$a*($y2)]
	!if $a=1
	    opgave$n=$pm \alpha $mp  \overline \beta
	!else
	    opgave$n=$pm \alpha $mp $a \cdot \overline \beta
	!endif
    !endif
    GOED$n=$gx,$gy
    goed$n=\left(\begin{array}{c}$gx \\ $gy i \end{array} \right)
 !exit
!endif

!if $R=3
    appletcommand=$empty
    somtekst$n=!record 52 of lang/remarks.$taal
    xv=!shuffle 1,2,3,4,5,-1,-2,-3,-4,-5
    yv=!shuffle 1,2,3,4,5,-1,-2,-3,-4,-5
    x1=!item 1 of $xv
    y1=!item 2 of $yv
    x2=!item 3 of $xv
    y2=!item 4 of $yv
    appletcommand=!append line document.applets[0].evalCommand("My_A = (0,0)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_B = ($x1,$y1)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_C = ($x2,$y2)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_v = vector[My_A,My_B]"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_w = vector[My_A,My_C]"); to $appletcommand    
    appletcommand=!append line document.applets[0].setVisible('My_A' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setVisible('My_B' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setVisible('My_C' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setColor('My_v',255,0,0); to $appletcommand
    appletcommand=!append line document.applets[0].setColor('My_w',0,0,255); to $appletcommand
    
    keuze=!randitem 0,1
    a=!randitem 1,2,3,4
    pm=!randitem +,-
    !if $keuze=0
	GOED$n=$[$x1 -1*$pm 1*$a*$y2],$[$y1+$pm 1*$a*$x2]
	!if $a=1
	    opgave$n= \alpha $pm i \cdot \beta
	!else
	    opgave$n= \alpha $pm $a\cdot i \cdot \beta
	!endif
    !else
	GOED$n=$[$a*$x1 + $y2],$[$a*$y1 - $x2]
	!if $a=1
	    opgave$n=\alpha -i\cdot \beta
	!else
	    opgave$n=$a\cdot \alpha -i\cdot \beta
	!endif
    !endif
    gx=!item 1 of $(GOED$n)
    gy=!item 2 of $(GOED$n)
    goed$n=\left(\begin{array}{c}$gx \\ $gy i \end{array} \right)
 !exit
!endif

!if $R>3
    keuze=!randitem 0,1
    appletcommand=$empty
    somtekst$n=!record 52 of lang/remarks.$taal
    xv=!shuffle 1,2,3,4,5,-1,-2,-3,-4,-5
    yv=!shuffle 1,2,3,4,5,-1,-2,-3,-4,-5
    x1=!item 1 of $xv
    y1=!item 2 of $yv
    x2=!item 3 of $xv
    y2=!item 4 of $yv
    appletcommand=!append line document.applets[0].evalCommand("My_A = (0,0)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_B = ($x1,$y1)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_C = ($x2,$y2)"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_v = vector[My_A,My_B]"); to $appletcommand
    appletcommand=!append line document.applets[0].evalCommand("My_w = vector[My_A,My_C]"); to $appletcommand    
    appletcommand=!append line document.applets[0].setVisible('My_A' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setVisible('My_B' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setVisible('My_C' , false ); to $appletcommand
    appletcommand=!append line document.applets[0].setColor('My_v',255,0,0); to $appletcommand
    appletcommand=!append line document.applets[0].setColor('My_w',0,0,255); to $appletcommand
    
    keuze=!randitem 0,1,2
    a=!randitem 1,2,3,4
    pm=!randitem +,-
    !if $keuze=0
	gx=$[$x1+$a*$y2]
	gy=$[$a*$x2+$y1]
	!if $a=1
	    opgave$n=\alpha + i\cdot \overline\beta
	!else
	    opgave$n=\alpha + $a \cdot i \cdot \overline\beta
	!endif
    !else
	!if $keuze=1
	    gx=$[$x1+$a*$y2]
	    gy=$[-1*$a*$x2-$y1]
	    !if $a=1
		opgave$n=\overline\alpha -i\cdot \beta
	    !else
		opgave$n=\overline\alpha - $a\cdot i\cdot \beta
	    !endif
	!else
	    gx=$[$a*$x1-$y2]
	    gy=$[$a*$y1-$x2]
	    !if $a=1
		opgave$n=\alpha -i\cdot \overline\beta
	    !else
		opgave$n=$a\cdot \alpha -i\cdot \overline\beta
	    !endif
	!endif
    !endif
    GOED$n=$gx,$gy
    goed$n=\left(\begin{array}{c}$gx \\ $gy i\end{array} \right)
 !exit
!endif


