# Khan/khan-exercises

### Subversion checkout URL

You can clone with
or
.
Fetching contributors…

Cannot retrieve contributors at this time

79 lines (74 sloc) 4.35 kB
 Number line 3
randRange( -15, 15 ) randRange( -2, 2 ) randRangeExclude( max(MIDPOINT-5, MIDPOINT-5-DISTANCE),min(MIDPOINT+5, MIDPOINT+5-DISTANCE), [ 0, MIDPOINT - DISTANCE ] )

What number is plural( abs( DISTANCE ), "position") to the leftright of the orange dot? The distance between tick marks is 1.

What number does the orange dot represent? The distance between tick marks is 1.

init({ range: [ [ MIDPOINT-6, MIDPOINT+6 ], [ -1, 1 ] ] }); line( [ MIDPOINT-5, 0 ], [ MIDPOINT+5, 0 ] ); for ( var x = MIDPOINT-5; x <= MIDPOINT+5; x++ ) { line( [ x, -0.2 ], [ x, 0.2 ] ); } style({ stroke: "#6495ED", strokeWidth: 3.5 }); line( [ MIDPOINT, -0.2], [MIDPOINT, 0.2]); label( [ MIDPOINT, -0.53 ], MIDPOINT, "center", { color: "#6495ED" }); style({ stroke: "#FFA500", fill: "#FFA500" }); graph.orangeDot = circle( [ NUMBER, 0 ], 0.10 );
NUMBER+DISTANCE

We know where MIDPOINT is on this number line because it is labeled.

Numbers to the left are less than MIDPOINT, while numbers to the right are greater than MIDPOINT.

We need to find the number represented by the blue dot, which is plural( abs( DISTANCE ), "position") to the leftright of the orange dot.

style({ stroke: "#6495ED", fill: "#6495ED" }); graph.blueDot = circle( [ NUMBER+DISTANCE, 0 ], 0.10 );

Starting from MIDPOINT, we move abs( NUMBER-MIDPOINT+DISTANCE ) to the leftright to reach the blueorange dot.

var color = "#6495ED"; if ( DISTANCE === 0 ) { color = "#FFA500"; } style({ stroke: color, fill: color, strokeWidth: 3.5, arrows: "->" }); line( [ MIDPOINT, 0 ], [ NUMBER+DISTANCE, 0 ] ); graph.blueDot.toFront(); graph.orangeDot.toFront();

Thus, the blueorange dot represents the number NUMBER+DISTANCE.

var color = "#6495ED"; if ( DISTANCE === 0 ) { color = "#FFA500"; } label( [ NUMBER+DISTANCE, -0.53 ], NUMBER+DISTANCE, "center", { color: color });
Something went wrong with that request. Please try again.