Where is the blue dot on the number line?
var scale = 40 / SCALE;
init({
range: [[LOWER_BOUND - (30 / scale), UPPER_BOUND + (30 / scale)], [-1, 1]],
scale: [40 / SCALE, 40]
});
line([LOWER_BOUND - (25 / scale), 0], [UPPER_BOUND + (25 / scale), 0], { arrows: "->" });
line([UPPER_BOUND + (25 / scale), 0], [LOWER_BOUND - (25 / scale), 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 ], [4 / scale, 4/40] );
graph.questionLabel = label( [ NUMBER, -0.53 ], "{?}", "center", { color: BLUE });
Two tick marks are labeled.
The distance between the two labeled tick marks is 2 * SCALE.
Therefore, the space between each pair of tick marks is 2 * SCALE / 2 = SCALE
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 });