#list_of_things=['point','line','segment','circle','function','polygon','cone','ellipse','polynomial']
#customToolBar=0 , 1 , 10 , 16 , 6
mathview=0
math=0
questiontype=4
n=$counter
debug=0
inputs=0
checkfile=exos/checkfile3.proc
showToolBar=true
showMenuBar=false
framePossible=false
width=640
height=480
wordmax=300
points=2
vectors=1
math=0
R=$level
!if $level=0
    R=$counter
!endif
var1=$empty
# var1 bevat gedeelte van goede plaatje...
ggb=ggb/grid2.ggb
list_of_things=[ 'vector','point' ];
customToolBar=" 7 | 40 | 6 | 0 | 41 | 42 "
textanswer$n=!record 74 of lang/remarks.$taal
!if $R=1
    keuze=!randitem 0,1,2
    #customToolBar=34 | 10 | 0 | 6 | 40   
    appletcommand=$empty
    question$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',0,0,255); to $appletcommand
	
    !if $keuze=0
	formula$n=$a \cdot \alpha
	gx=$[$a*$x]
	gy=$[$a*$y]
    !else
	!if $keuze=1
	    !if $b=1
		formula$n=i \cdot \alpha
	    !else
		formula$n=$b \cdot i\cdot \alpha 
	    !endif
	    gx=$[-1*$b*$y]
	    gy=$[$b*$x]
	!else
	    !if $a=-1
		formula$n= - \overline \alpha
	    !else
		formula$n=$a \cdot \overline \alpha
	    !endif
	    gx=$[$x+$a*$x]
	    gy=$[$y-$a*$y]
	!endif
    !endif
    answer$n=$gx,$gy
    texanswer$n=\left( \begin{array}{c} $gx \\ $gy i \end{array} \right)
    !if $showanswer=1
	var1=300,300\
	transparant white\
	xrange $[-1.2*(abs($gx))],$[1.2*(abs($gx))]\
	yrange $[-1.2*(abs($gy))],$[1.2*(abs($gy))]\
	linewidth 1\
	hline 0,0,blue\
	vline 0,0,blue\
	linewidth 2\
	arrow 0,0,$x,$y,10,blue\
	arrow 0,0,$gx,$gy,10,green
    
    !endif
 !exit
!endif

!if $R=2
    appletcommand=$empty
    question$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',0,0,255); to $appletcommand
    appletcommand=!append line document.applets[0].setColor('My_w',0,0,0); to $appletcommand

    keuze=!randitem 0,1
    keuze=1
    a=!randitem 1,2,3,4
    pm=!randitem  ,-
    mp=!randitem +,-
    !if $keuze=0
	!if $a=1
	    formula$n=$pm \alpha $mp  \beta 
	!else
	    formula$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
	    formula$n=$pm \alpha $mp  \overline \beta
	!else
	    formula$n=$pm \alpha $mp $a \cdot \overline \beta
	!endif
    !endif
    answer$n=$gx,$gy
    texanswer$n=\left(\begin{array}{c}$gx \\ $gy i \end{array} \right)
    !if $showanswer=1
	var1=300,300\
	transparant white\
	xrange $[-1.2*(abs($gx))],$[1.2*(abs($gx))]\
	yrange $[-1.2*(abs($gy))],$[1.2*(abs($gy))]\
	linewidth 1\
	hline 0,0,blue\
	vline 0,0,blue\
	linewidth 2\
	arrow 0,0,$x1,$y1,10,blue\
	arrow 0,0,$x2,$y2,10,black\
	arrow 0,0,$gx,$gy,10,green
    
    !endif
 !exit
!endif

!if $R=3
    appletcommand=$empty
    question$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',0,0,255); to $appletcommand
    appletcommand=!append line document.applets[0].setColor('My_w',0,0,0); to $appletcommand
    
    keuze=!randitem 0,1
    a=!randitem 1,2,3,4
    pm=!randitem +,-
    !if $keuze=0
	answer$n=$[$x1 -1*$pm 1*$a*$y2],$[$y1+$pm 1*$a*$x2]
	!if $a=1
	    formula$n= \alpha $pm i \cdot \beta
	!else
	    formula$n= \alpha $pm $a\cdot i \cdot \beta
	!endif
    !else
	answer$n=$[$a*$x1 + $y2],$[$a*$y1 - $x2]
	!if $a=1
	    formula$n=\alpha -i\cdot \beta
	!else
	    formula$n=$a\cdot \alpha -i\cdot \beta
	!endif
    !endif
    gx=!item 1 of $(answer$n)
    gy=!item 2 of $(answer$n)
    texanswer$n=\left(\begin{array}{c}$gx \\ $gy i \end{array} \right)

    !if $showanswer=1
	var1=300,300\
	transparant white\
	xrange $[-1.2*(abs($gx))],$[1.2*(abs($gx))]\
	yrange $[-1.2*(abs($gy))],$[1.2*(abs($gy))]\
	linewidth 1\
	hline 0,0,blue\
	vline 0,0,blue\
	linewidth 2\
	arrow 0,0,$x1,$y1,10,blue\
	arrow 0,0,$x2,$y2,10,black\
	arrow 0,0,$gx,$gy,10,green
    
    !endif
 !exit
!endif

!if $R>3
    question$n=!record 52 of lang/remarks.$taal
    keuze=!randitem 0,1
    appletcommand=$empty
    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',0,0,255); to $appletcommand
    appletcommand=!append line document.applets[0].setColor('My_w',0,0,0); 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
	    formula$n=\alpha + i\cdot \overline\beta
	!else
	    formula$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
		formula$n=\overline\alpha -i\cdot \beta
	    !else
		formula$n=\overline\alpha - $a\cdot i\cdot \beta
	    !endif
	!else
	    gx=$[$a*$x1-$y2]
	    gy=$[$a*$y1-$x2]
	    !if $a=1
		formula$n=\alpha -i\cdot \overline\beta
	    !else
		formula$n=$a\cdot \alpha -i\cdot \overline\beta
	    !endif
	!endif
    !endif
    answer$n=$gx,$gy
    texanswer$n=\left(\begin{array}{c}$gx \\ $gy i\end{array} \right)
    !if $showanswer=1
	var1=300,300\
	transparant white\
	xrange $[-1.2*(abs($gx))],$[1.2*(abs($gx))]\
	yrange $[-1.2*(abs($gy))],$[1.2*(abs($gy))]\
	linewidth 1\
	hline 0,0,blue\
	vline 0,0,blue\
	linewidth 2\
	arrow 0,0,$x1,$y1,10,blue\
	arrow 0,0,$x2,$y2,10,black\
	arrow 0,0,$gx,$gy,10,green
	
    !endif
 !exit
!endif


