n=$teller
!if $graad=0
    R=$teller
!else
    R=$graad    
!endif
nivo_title=twee punten en een lijn
bewerking=bewerking3.proc
argument=y
varlist=x

LETTERS=A,B,C,D,E,F,G,H,L,K,P,M,R,S,Q,W
nummer=!randint 1,15
P=!item $nummer of $LETTERS
M=!item $[$nummer+1] of $LETTERS
d=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-1,2,3,4,5
keuze=!randitem 1,2
!if $R=1
    !if $keuze=1
	m=!randitem 2,3,4,5
    !else	
	m=!randitem -1,-2,-3,-4,-5
    !endif
    x1=!randitem -5,-4,-3,-2,2,3,4,5
    x2=$[$x1 + ($d)]
    y1=$[($m)*($x1)]
    y2=$[($m)*($x2)]
    GOED$n=$m*x
 !goto PLAATJE
!endif

!if $R=2
    !if $keuze=1
	m=!randitem 1/5,1/4,1/2,3/4,3/2,4/5
    !else
	m=!randitem -1/10,-1/5,-1/4,-1/2
    !endif	
    x1=!randitem 1,2,3,4,5,-1,-2,-3,-4,-5
    x2=$[$x1 + ($d)]
    y1=$[($m)*($x1)]
    y2=$[($m)*($x2)]
    GOED$n=$m*x
 !goto PLAATJE
!endif

!if $R=3
    m=!randitem 2,3,4,5
    q=!randitem 1,2,3,4,5
    x1=!randitem 1,2,3,4,5
    pm=!randitem +,-
    x2=$[$x1 $pm ($d)]
    y1=$[($m)*($x1) $pm ($q)]
    y2=$[($m)*($x2) $pm ($q)]
    GOED$n=$m*x $pm $q
!endif

!if $R>3
    pm=!randitem +,-
    x1=!randitem 1,2,3,4,5
    x2=$[$x1 $pm ($d)]
    !if $keuze=1
	m=!randitem 2,3,4,5
	q=!randitem 1/2,1/4,1/5,1/10,4/3
    !else
	m=!randitem 2,3,4,5,4/3,5/3,5/2,7/2,9/2,7/3,-2,-3,-4,-5,-4/3,-5/3,-5/2,-7/2,-9/2,-7/3
	q=!randitem 1,2,3,4,5,6,7,8,9,10
    !endif
    y1=$[($m)*($x1) $pm ($q)]
    y2=$[($m)*($x2) $pm ($q)]
    GOED$n=$m*x $pm $q
!endif

:PLAATJE
XRANGE=-10,10
YRANGE=-50,50
XSCHAAL=2
YSCHAAL=10
    
insdraw_animate=yes
ins_anim_frames=2
ins_anim_delay=0.8
ins_anim_loop=0
!readproc $authordir/ruitjespapier.proc

plaatje$n=$ruitjespapier\
linewidth 2\
curve green,$(GOED$n)\
linewidth s*20\
points red,$x1,$y1\
points red,$x2,$y2\
text black,$x1+s,$y1+s,giant,$P\
text black,$x2+s,$y2+s,giant,$M\
text black,8,-2,normal,x-as\
textup black,-0.5,40,normal,y-as

PUNT1=($x1:$y1)
PUNT2=($x2:$y2)

somtekst$n=Gegeven zijn de twee punten\
<ul>\
<li><font size=+1>$P</font> met <tt>x;y</tt>-co&ouml;rdinaten <font size=+1><tt>$PUNT1</tt></font><br>\
<li><font size=+1>$M</font> met <tt>x;y</tt>-co&ouml;rdinaten <font size=+1><tt>$PUNT2</tt></font><br>\
</ul>\
Er loopt door <font size=+1><tt>$P</tt></font> en <font size=+1><tt>$M</tt></font> &eacute;&eacute;n rechte lijn...<br>Bepaal met deze gegevens de vergelijking van deze lijn.
opgave$n= y= m\cdot x + q
hint=hier staat een hint
woordmax=10
