Move the \color{orange}{\text{orange dot}} to \color{orange}{SOLUTION} on the number line. The distance between adjacent tick marks is 0.5.
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 ? markLength = 0.2 : markLength = 0.1
line( [ x, -markLength ], [ x, markLength ] );
}
style({ stroke: GREEN, strokeWidth: 3.5 });
line( [ LOWER_BOUND, -0.2], [LOWER_BOUND, 0.2]);
label( [ LOWER_BOUND, -0.53 ], LOWER_BOUND, "center", { color: GREEN });
line( [ UPPER_BOUND, -0.2], [UPPER_BOUND, 0.2]);
label( [ UPPER_BOUND, -0.53 ], UPPER_BOUND, "center", { color: GREEN });
line( [ 0, -0.2], [0, 0.2]);
label( [ 0, -0.53 ], "0", "center", { color: GREEN });
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 \color{orange}{SOLUTION} is positive
negative the orange dot will be to the right
left of 0.
Separate the decimal from the whole number:
\color{orange}{SOLUTION} =
\color{blue}{SOLUTION_WHOLE} + \color{blue}{SOLUTION_DECIMAL}
Therefore, we know \color{orange}{SOLUTION} lies between
\color{orange}{SOLUTION_WHOLE} and
\color{orange}{SOLUTION_WHOLE + (SOLUTION > 0 ? 1 : -1)} on the number line.
style({ stroke: "#FFA500", strokeWidth: 3.5 });
line( [SOLUTION_WHOLE, -0.2], [SOLUTION_WHOLE, 0.2]);
line( [SOLUTION_WHOLE + (SOLUTION > 0 ? 1 : -1), -0.2], [SOLUTION_WHOLE + (SOLUTION > 0 ? 1 : -1), 0.2]);
style({ stroke: GREEN, fill: "#6495ED", strokeWidth: 3.5, arrows: "->" });
line( [ 0, 0 ], [ SOLUTION, 0 ] );
graph.movablePoint.visibleShape.toFront();
The orange dot should be shifted to the position \color{orange}{SOLUTION} right of 0.
label( [ SOLUTION, -0.53 ], SOLUTION, "center", { color: "#FFA500" });
graph.movablePoint.moveTo( SOLUTION, 0 );
The orange number shows where \color{orange}{SOLUTION} is on the number line.