The blue dot is at what value on the number line?
init({
range: [[LOWER_BOUND - SCALE * 0.75, UPPER_BOUND + SCALE * 0.75], [-1, 1]],
scale: [40 / SCALE, 40]
});
line([START + 1, 0], [STOP, 0], { arrows: "->" });
line([STOP - 1, 0], [START, 0], { arrows: "->" });
for (var x = LOWER_BOUND; x <= UPPER_BOUND; x += SCALE) {
line([x, -0.2], [x, 0.2 ]);
}
label([MIDPOINT - SCALE, -0.53], ("" + (MIDPOINT - SCALE)).replace(/-/, "\\llap{-}"), "center");
label([MIDPOINT + SCALE, -0.53], ("" + (MIDPOINT + SCALE)).replace(/-/, "\\llap{-}"), "center");
style({ stroke: BLUE, fill: BLUE });
graph.blueDot = ellipse([NUMBER, 0], [SCALE * 0.1, 0.1]);
graph.questionLabel = label([NUMBER, -0.53], "{?}", "center", { color: BLUE });
Label the other tick marks on the number line.
for (var x = LOWER_BOUND; x <= UPPER_BOUND; x += SCALE) {
if (x !== MIDPOINT - SCALE && x !== MIDPOINT + SCALE && x !== NUMBER) {
label([x, -0.53], ("" + x).replace(/-/, "\\llap{-}"), "center");
}
}
The blue dot represents the number NUMBER
.
graph.questionLabel.remove();
label([NUMBER, -0.53], ("" + NUMBER).replace(/-/, "\\llap{-}"), "center", { color: BLUE });