# Khan/khan-exercises

Add exercise -- line graph intuition

marcia committed Jun 24, 2011
1 parent 88ea4bc commit 62b80f8d2cd09b13c1f2cae1de725e0d0e118bd5
Showing with 129 additions and 1 deletion.
1. +128 −0 exercises/line_graph_intuition.html
2. +1 −1 utils/graphie.js
 @@ -0,0 +1,128 @@ + + + + Line Graph Intuition + + + + +
+
+ randRange( -8, 8 ) + randRange( -8, 8 ) + randRange( -8, 8 ) + randRange( -8, 8 ) + Y1 - Y2 + X1 - X2 + RISE / RUN + Y1 - X1 * M + 1 + 1 + 1 + 1 + abs( RUN ) / getGCD( abs( RISE), abs( RUN ) ) + {} + {} +
+ +
+
+
+ Adjust the slope and y-intercept until it connects the two points. How do the slope and y-intercept values affect the line? +
+ +
+ (function(){ + init({ + range: [[-10, 10], [-10, 12]], + scale: [30, 30] + }); + + grid( [-10, 10], [-10, 10], { + stroke: "#ccc" + }); + + style({ + stroke: "#888", + strokeWidth: 2 + }); + path( [ [-10, 0], [10, 0] ] ); + path( [ [0, -10], [0, 10] ] ); + + style({ + stroke: "#6495ED", + fill: "#6495ED" + }); + + circle( [X1, Y1], 0.15 ); + circle( [X2, Y2], 0.15 ); + + style({ + clipRect:[ [-10, -10], [20, 20] ] + }, function() { + PLOT = plot( function( x ) { + return x * MN / MD + BN / BD; + }, [-10, 10]); + }); + + LABEL = label( [1, 11], "y = " + KhanUtil.fractionReduce(MN, MD) + "x +" + KhanUtil.fractionReduce(BN, BD)); + })() + +
+
+
+
+
+
+ + + +
+
+
+
+ +
 @@ -326,6 +326,6 @@ jQuery.fn.graphie = function() { // Execute the graph-specific code KhanUtil.currentGraph = graphie; jQuery.tmpl.getVAR( code, graphie ); - delete KhanUtil.currentGraph; + // delete KhanUtil.currentGraph; }).end(); };