0 1 5 randRange(2, 6) randRange(1, DENOMINATOR-1) LOWER_BOUND * DENOMINATOR UPPER_BOUND * DENOMINATOR NUMERATOR

Zet de \color{red}{\text{rode stip}} bij \color{red}{fraction(NUMERATOR, DENOMINATOR)} op de getallenlijn.

init({ range: [ [LOWER_SCALED - 0.2, UPPER_SCALED + 1], [-1, 1] ], scale: [80, 40] }); style({arrows: ">"}); line( [ LOWER_SCALED, 0 ], [ UPPER_SCALED + 0.25, 0 ] ); style({arrows: ""}); for ( var x = LOWER_SCALED; x <= UPPER_SCALED; x++ ) { line( [ x, -0.2 ], [ x, 0.2 ] ); } style({ stroke: BLUE, strokeWidth: 3.5 }); line( [ LOWER_SCALED, -0.2], [LOWER_SCALED, 0.2]); label( [ LOWER_SCALED, -0.53 ], LOWER_BOUND, "center", { color: BLUE }); line( [ UPPER_SCALED, -0.2], [UPPER_SCALED, 0.2]); label( [ UPPER_SCALED, -0.53 ], UPPER_BOUND, "center", { color: BLUE }); addMouseLayer(); this.movablePoint = addMovablePoint({ constraints: { constrainY: true }, snapX: 0.25 }); movablePoint.onMove = function( x, y ) { if (x < LOWER_SCALED || UPPER_SCALED < x) { return false; // don't allow the point to move past the bounds } jQuery("#solutionarea input").val( x ); };
Verplaats de rode stip.

Hierboven hebben op een getallenlijn het stuk van 0 tot 1 getekend.

Het stuk van 0 tot 1 is verdeeld in DENOMINATOR gelijke stukjes.

Elk stukje heeft daardoor een lengte vanfraction(1, DENOMINATOR)

style({ stroke: "#6495ED", fill: "#6495ED", strokeWidth: 3.5, arrows: "->" }); line( [ 0, 0 ], [ NUMERATOR, 0 ] ); movablePoint.visibleShape.toFront();

fraction(NUMERATOR, DENOMINATOR) betekent NUMERATOR keer een stukje van fraction(1, DENOMINATOR)

De rode stip moet daarom NUMERATOR stukjesplural(NUMERATOR) verschoven worden.

label( [ NUMERATOR, -0.83 ], fraction(NUMERATOR, DENOMINATOR), "center", { color: "#FF0000" }); movablePoint.moveTo( NUMERATOR, 0 );

De rode stip staat nu bij \color{red}{fraction(NUMERATOR, DENOMINATOR)} op de getallenlijn.