# public Khan /khan-exercises

### Subversion checkout URL

You can clone with HTTPS or Subversion.

Fetching contributors…

Cannot retrieve contributors at this time

file 117 lines (99 sloc) 5.128 kb
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116         Decimals on the number line 1

0        1         0.1          randRange(1, 9)          TENTHS * MARK_INCREMENT          localeToFixed(SOLUTION, 1)

Move the orange dot to \pink{SOLN_TXT} on the number line.

init({                        range: [[LOWER_BOUND - 0.1, UPPER_BOUND + 0.4], [-1, 1]],                        scale: [350, 40]                    });                    style({arrows: ">"});                    line( [ 0, 0 ], [ UPPER_BOUND + 0.06, 0 ] );                    style({arrows: "->"});                    line( [ 0, 0 ], [ LOWER_BOUND - 0.06, 0 ] );                    style({arrows: ""});                    for ( var x = LOWER_BOUND; x <= UPPER_BOUND; x += MARK_INCREMENT ) {                        line( [ x, -0.2 ], [ x, 0.2 ] );                    }                    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 });                    addMouseLayer();                    graph.movablePoint = addMovablePoint({ constraints: { constrainY: true }, snapX: 0.025 });                    graph.movablePoint.onMove = function( x, y ) {                        return [ min( max( LOWER_BOUND, x ), UPPER_BOUND ), y ];                    };

graph.movablePoint.coord[0]

if ( guess === 0 ) {                        return "";                    }                    return abs( SOLUTION - guess ) < 0.001;

graph.movablePoint.setCoord( [ guess, 0 ] );

Above we've drawn the number line from LOWER_BOUND to UPPER_BOUND,                divided into 10 equal pieces.

The line is divided into 10 pieces, which means:

Piece of line = \purple{commafy(MARK_INCREMENT)}

\pink{SOLN_TXT} = \purple{commafy(MARK_INCREMENT)} \times \green{TENTHS}

Therefore, moving the orange dot \green{TENTHS}                    place will put it at the position \pink{SOLN_TXT}.

Therefore, moving the orange dot \green{TENTHS}                    places will put it at the position \pink{SOLN_TXT}.

var MI = MARK_INCREMENT;                            for ( var x = LOWER_BOUND + MI; x < UPPER_BOUND - MI/2; x += MI ) {                                label( [ LOWER_BOUND + x, -0.53 ], localeToFixed(x, 1) , "center");                            }

style({ stroke: "#6495ED", fill: "#6495ED", strokeWidth: 3.5, arrows: "->" });                        line( [ 0, 0 ], [ SOLUTION, 0 ] );                        graph.movablePoint.visibleShape.toFront();                        label([TENTHS/10, -0.53], SOLN_TXT, "center", { color: PINK });                        graph.movablePoint.moveTo(SOLUTION, 0);

The highlighted number shows where \pink{SOLN_TXT} is on the number line.

Something went wrong with that request. Please try again.