!set n=$teller
bewerking=bewerking2.proc

!if $teller=1
    A=!randint 1,36
    graden=$[$A*15]
    GRADEN=$graden
    GOED$n=$[pi*$graden/180]
    !if $taal=nl
	somtekst$n=Gegeven de (eenheids) cirkel<br>\
	Klik op het punt P van de cirkel dat overeenkomt<br>\
	met een hoek in O van $graden<sup>o</sup><br><small>\
	(dus de hoek tussen:<br> het beginpunt, midden van de cirkel O en het punt P is $graden<sup>o</sup>)\
	<br>Let op:het punt P loopt linksom -dus tegen de wijzers van de klok in- over de cirkel</small> 
	antwoord$n=Het goede antwoord is de rode pijl in het plaatje<br>\
	jouw antwoord is getekend met een blauwe pijl
	nivo_title=De eenheidscirkel & graden <br>klik op de goede hoek
	!if $HINT=1
	    hint=Algemene Hint:<br>\
	    Een cirkel is 360<sup>o</sup><br>\
	    Zoals je kunt tellen is de schaalverdeling om de 15<sup>o</sup> aangebracht
	!endif
    !else
	somtekst$n=Given the (unit) circle<br>\
	Click on a point P on the unit circle that matches\
	an angle (in <b>O</b>) of $graden<sup>o</sup><br><small>\
	(thus the angle between:<br> the startpoint, center of the\
	 circle O and the point P is $graden<sup>o</sup>)\
	<br>Attention: point P "moves" counter-clockwise over the circle</small> 
	antwoord$n=The correct answer is the red arrow in the image<br>\
	your answer is drawn as a blue arrow
	nivo_title=The Unit circle & Degrees.<br>Click on the correct angle.
	!if $HINT=1
	    hint=hint:<br>\
	    A full circle is 360<sup>o</sup><br>\
	    As you can see there is a scale-division of 15<sup>o</sup>.<br>\
	    Just divide the angle by 15 , count and click
	!endif    
    !endif
!endif

!if $teller=2
    A=!randint 1,36
    graden=$[$A*15]
    GRADEN=$graden
    GOED$n=$[pi*$graden/180]
    omtrek=$[(round(100*pi*$graden/180))/100]
    totaleomtrek=6.28
    !if $taal=nl
	somtekst$n=Gegeven: een cirkel heeft een straal (= radius ) <em>r</em> van 1 meter.<br>\
	De cirkel heeft dus een totale omtrek van:<br>\
	2&times;&pi;&times;r  -->  2&times;&pi;&times;1 meter is ongeveer $totaleomtrek meter<p>\
	Een punt loopt linksom over de rand van de cirkel<br>\
	Na $omtrek meter staat het punt stil.<br>\
	Klik op de plaats waar dit punt stil komt te staan
	antwoord$n=De rode pijl wijst naar het punt <br>de gezochte hoek die hoort bij een<br>\
	lengte van $omtrek meter is dus $graden<sup>o</sup>
	nivo_title=De eenheidscirkel & graden <br>klik op de goede hoek
	!if $HINT=1
	    hint=Algemene Hint:<br>\
	    De formule voor de omtrek van een cirkel met straal/radius <em>r</em>\
	    &nbsp;was<br><font size=+1 color=$fontcolor1>Omtrek=2 &times; &pi; &times; <em>r</em></font><br>\
	    Als <em>r</em> 1 meter is, is de omtrek dus 2*&pi;*1=2*&pi; meter.<br><ul>\
	    <li>Loopt het punt nu &pi; meter (ca. 3.14 meter) rond heeft het<br> dus de <em>helft</em> van de cirkel afgelegd = 0.5 &times 360 = 180<sup>o</sup><br>\
	    <li>Loopt het punt nu 4*&pi; meter rond, <br>is dit dus 4*&pi;&divide;2&pi; = 4/2 = 2 maal de cirkel rond = 2 &times 360<sup>o</sup><br>\
	    maar omdat je dan weer gewoon op je beginpunt bent is de hoek dus weer 0<sup>o</sup>\
	    <li>Loopt het punt nu 200*&pi; meter rond , <br>is dit dus 200&pi;/2&pi; = 100 keer de cirkel rond = 100 &times; 360 is gewoon weer 0<sup>o</sup>\
	    </ul>
	!endif
    !else
	somtekst$n=Given: a circle with a radius <em>r</em> of 1 metre.<br>\
	The circle has a total circumference of:<br>\
	2&times;&pi;&times;r  -->  2&times;&pi;&times;1 metre is approximately $totaleomtrek metre<p>\
	A point "moves" counter-clockwise over the "edge" of this circle...<br>\
	After $omtrek metre it stops.<br>\
	Click on it's stopping position.
	antwoord$n=The correct answer is the red arrow in the image<br>.\
	<br>$omtrek metre over this circle is equal to $graden<sup>o</sup>
	nivo_title=The Unit circle & Degrees.<br>Click on the correct angle.
	!if $HINT=1
	    hint=Hint:<br>\
	    The "formula" for the circumference of a circle with radius <em>r</em>\
	    &nbsp;is<br><font size=+1 color=$fontcolor1>Circumference=2 &times; &pi; &times; <em>r</em></font><br>\
	    If <em>r</em> is 1 metre, the circumference becomes 2*&pi;*1=2*&pi; metre.<br><ul>\
	    <li>If our point moves &pi; metre (approx. 3.14 metre) over the edge of the circle<br> it is has moved  a <em>half circle</em> = 0.5 &times 360 = 180<sup>o</sup><br>\
	    <li>If it moves 4*&pi; metre, <br>this is 4*&pi;&divide;2&pi; = 4/2 = 2 times the whole circle = 2 &times 360<sup>o</sup><br>\
	    but then you will be again at your starting point; the angle could be called 0<sup>o</sup>\
	    <li>If it walks 200*&pi; metre acros this circle , <br>it's 200&pi;/2&pi; = 100 times the circle  = 100 &times; 360  and it's again "just" 0<sup>o</sup>\
	    </ul>
	!endif
    
    !endif
!endif

!if $teller=3
    #A=!randint 1,36
    A=!randitem 1/4,1/8,1/2,3/8,1/12,1/6,1/24,5/24,7/24,9/24,10/24,11/24,13/24,15/24,1/3,5/12,7/12,9/12,11/12
    GRADEN=$[$A*180]
    GOED$n=$[pi*$A]
    omtrek=!nospace &pi; &sdot; $A
    !if $taal=nl
	somtekst$n=Gegeven:<br>\
	Een punt loopt linksom over de rand van de eenheidscirkel (radius=1)<br>\
	Na $omtrek staat het punt stil.<br>\
	Klik op de plaats waar dit punt stil komt te staan
	antwoord$n=De rode pijl wijst naar het punt <br>de gezochte hoek die hoort bij een<br>\
	lengte van $omtrek is dus $GRADEN<sup>o</sup>
	nivo_title=De eenheidscirkel & graden <br>klik op de goede hoek
	!if $HINT=1
	    hint=Algemene Hint:<br>\
	    De formule voor de omtrek van een cirkel met straal/radius <em>r</em>\
	    &nbsp;was<p><font size=+1 color=$fontcolor1>Omtrek=2 &times; &pi; &times; <em>r</em></font></p>\
	    De radius <em>r=1</em>, de omtrek dus 2&times;&pi;&times;r. <br>\
	    (2&pi;r  -->  voor de eenheidcirkel is de omtrek dus 2&pi;&times;1 = 2&pi;)<br><ul>\
	    <li>Loopt het punt over een afstand &pi; rond heeft het dus de <em>helft</em> van de cirkel (de hele eenheids-cirkel was 2&pi;) afgelegd = 0.5 &times 360 = 180<sup>o</sup><br>\
	    <li>Loopt het punt over een afstand &pi;/2 rond, is dit dus 1/4 cirkel ofwel 90<sup>o</sup>
	    <li>Loopt het punt over een afstand &pi;/4 rond, is dit dus 1/8 cirkel ofwel 45<sup>o</sup>\
	    </ul>
	!endif
    !else
	somtekst$n=Given:<br>\
	A point moves counter-clockwise over the edge of the unit circle (radius=1)<br>\
	After $omtrek the point stops.<br>\
	Click on the stopping point...
	antwoord$n=The correct answer is the red arrow in the image.<br>\
	<br>The angle that matches a "length" of $omtrek is $GRADEN<sup>o</sup>
	nivo_title=The Unit Circle & Degrees.<br>Click on the correct angle.
	!if $HINT=1
	    hint=Hint:<br>\
	    The "formula" for the circumference of a circle with radius <em>r</em>\
	    &nbsp;is<br><font size=+1 color=$fontcolor1>Circumference=2 &times; &pi; &times; <em>r</em></font><br>\
	    De radius <em>r=1</em> of the unit circle makes a circumference of 2&times;&pi;&times;1= 2&pi; <br>\
	    <ul>\
	    <li>if this point walks &pi; it has passed 0.5&times;2&times;&pi; is  <em>half</em> the circle (the unit circle being 2&pi;) = 0.5 &times 360 = 180<sup>o</sup><br>\
	    <li>similar: walking &pi;/2 means 1/4 circle or 90<sup>o</sup>
	    <li>or walking &pi;/4 means 1/8 circle or 45<sup>o</sup>\
	    </ul>
	!endif
    !endif\
    
!endif
!if $teller>3
    A=!randint 1,36
    graden=$[$A*15]
    GRADEN=$graden
    GOED$n=$[pi*$graden/180]
    omtrek=!exec pari $graden/180
    omtrek=!nospace &pi; &sdot; $omtrek
    !if $taal=nl
	somtekst$n=Gegeven:<br>\
	Een punt loopt linksom over de rand van de eenheidscirkel<br>\
	Na $omtrek staat het punt stil.<br>\
	Klik op de plaats waar dit punt stil komt te staan
	antwoord$n=De rode pijl wijst naar het punt <br>de gezochte hoek die hoort bij een<br>\
	lengte van $omtrek  is dus $graden<sup>o</sup>
	nivo_title=De eenheidscirkel & graden <br>klik op de goede hoek
	!if $HINT=1
	    hint=Algemene Hint:<br>\
	    De formule voor de omtrek van een cirkel met straal/radius <em>r</em>\
	    &nbsp;was<p><font size=+1 color=$fontcolor1>Omtrek=2 &times; &pi; &times; <em>r</em></font></p>\
	    De radius <em>r=1</em>, de omtrek dus 2&times;&pi;&times;r. <br>\
	    (2&pi;r  -->  voor de eenheidcirkel is de omtrek dus 2&pi;&times;1 = 2&pi;)<br><ul>\
	    <li>Loopt het punt over een afstand &pi; rond heeft het dus de<br> <em>helft</em> van de cirkel (de hele eenheids-cirkel was 2&pi;) afgelegd = 0.5 &times 360 = 180<sup>o</sup><br>\
	    <li>Loopt het punt over een afstand &pi;/2 rond, is dit dus 1/4 cirkel ofwel 90<sup>o</sup>
	    <li>Loopt het punt over een afstand &pi;/4 rond, is dit dus 1/8 cirkel ofwel 45<sup>o</sup>\
	    </ul>
	!endif
    !else
	somtekst$n=Given:<br>\
	A point moves counter-clockwise over the edge of the unit circle (radius=1)<br>\
	After $omtrek the point stops.<br>\
	Click on the stopping point...
	antwoord$n=The correct answer is the red arrow in the image.<br>\
	The angle that matches a "length" of $omtrek is $graden<sup>o</sup>
	nivo_title=The Unit circle & Degrees.<br>Click on the correct angle.
	!if $HINT=1
	    hint=Hint:<br>\
	    The "formula" for the circumference of a circle with radius <em>r</em>\
	    &nbsp;is<br><font size=+1 color=$fontcolor1>Circumference=2 &times; &pi; &times; <em>r</em></font><br>\
	    De radius <em>r=1</em> of the unit circle makes a circumference of 2&times;&pi;&times;1= 2&pi; <br>\
	    <ul>\
	    <li>if this point walks &pi; it has passed 0.5&times;2&times;&pi; is  <em>half</em> the circle (the unit circle being 2&pi;) = 0.5 &times 360 = 180<sup>o</sup><br>\
	    <li>similar: walking &pi;/2 means 1/4 circle or 90<sup>o</sup>
	    <li>or walking &pi;/4 means 1/8 circle or 45<sup>o</sup>\
	    </ul>
	!endif
    !endif
!endif



XSIZE=400
YSIZE=400
!for q=0 to 360 step 15
    x=$[cos($q*pi/180)]
    y=$[sin($q*pi/180)]
    SCALE=!append line segment $x,$y,$[0.9*$x],$[0.9*$y],blue to $SCALE
!next q
!for q=0 to 360 step 45
    x=$[cos($q*pi/180)]
    y=$[sin($q*pi/180)]
    SCALE=!append line segment $x,$y,$[0.7*$x],$[0.7*$y],red to $SCALE
!next q
Xmin=-1.4
Xmax=1.4
Ymax=$Xmax
Ymin=$Xmin
XRANGE=$[$Xmax+$Ymax]
YRANGE=$XRANGE

voorbeeldplaatje=$XSIZE,$YSIZE\
xrange $Xmin,$Xmax\
yrange $Ymin,$Ymax\
transparent white\
linewidth 2\
vline 0,0,blue\
hline 0,0,blue\
linewidth 1\
vline -1,0,blue\
vline 1,0,blue\
hline 0,-1,blue\
hline 0,1,blue\
fellipse 0,0,2,2,white\
linewidth 3\
$SCALE \
linewidth 3\
segment 0,0,1,0,black\
text black,1,0,normal,Start\
text black,-0.05,-0.03,huge,O\
linewidth 10\
point 1,0,red

!exit