Move the orange dot to \pink{SOLUTION} on the number line.
init({
range: [[LOWER_BOUND - 0.3, UPPER_BOUND + 0.3], [-1, 1]],
scale: [108, 40]
});
style({arrows: ">"});
line([0, 0], [UPPER_BOUND + 0.25, 0]);
style({arrows: "->"});
line([0, 0], [LOWER_BOUND - 0.25, 0]);
style({arrows: ""});
for (var x = LOWER_BOUND; x <= UPPER_BOUND; x += 0.5) {
var markLength = (x % 1 === 0) ? 0.2 : 0.1;
line( [ x, -markLength ], [ x, markLength ] );
}
style({stroke: BLUE, strokeWidth: 3.5});
line([LOWER_BOUND, -0.2], [LOWER_BOUND, 0.2]);
label([LOWER_BOUND, -0.53], LOWER_BOUND, "center", {color: BLUE});
line([UPPER_BOUND, -0.2], [UPPER_BOUND, 0.2]);
label([UPPER_BOUND, -0.53], UPPER_BOUND, "center", {color: BLUE});
line([0, -0.2], [0, 0.2]);
label([0, -0.53], "0", "center", {color: BLUE});
addMouseLayer();
graph.movablePoint = addMovablePoint({ constraints: { constrainY: true }, snapX: 0.1 });
graph.movablePoint.onMove = function(x, y) {
return [min(max(LOWER_BOUND, x), UPPER_BOUND), y];
};
Move the orange dot to select your answer.
graph.movablePoint.coord[0]
if ( guess === 0 ) {
return "";
}
return abs( SOLUTION - guess ) < 0.001;
graph.movablePoint.setCoord( [ guess, 0 ] );
Because \pink{SOLUTION} is positive the orange dot will be to the right of 0.
Because \pink{SOLUTION} is negative the orange dot will be to the left of 0.
Separate the decimal from the whole number:
\pink{SOLUTION} = \purple{SOLUTION_WHOLE} + \purple{SOLUTION_DECIMAL}
Therefore, we know \pink{SOLUTION} lies between
\green{SOLUTION_WHOLE} and
\green{SOLUTION_WHOLE + (SOLUTION > 0 ? 1 : -1)} on the number line.
var x = SOLUTION > 0 ? SOLUTION_WHOLE : SOLUTION_WHOLE - 1;
rect(x, -0.3, 1, 0.6, {fill: GREEN, fillOpacity: 0.5, stroke: "none"});
style({stroke: BLUE, fill: "#6495ED", strokeWidth: 3.5, arrows: "->"});
line([0, 0], [SOLUTION, 0]);
graph.movablePoint.visibleShape.toFront();
The orange dot should be shifted to the position \pink{SOLUTION} right of 0.
label([SOLUTION, 0.53], SOLUTION, "center", { color: PINK });
graph.movablePoint.moveTo(SOLUTION, 0);
The highlighted number shows where \pink{SOLUTION} is on the number line.