# Khan/khan-exercises

Port parabola intuition 1 to use a custom answer type

• Loading branch information...
joelburget committed Aug 15, 2012
1 parent 17c3d21 commit 61053c95835fd18b34650c242f3e1c00337f860b
Showing with 39 additions and 16 deletions.
1. +39 −16 exercises/parabola_intuition_1.html
 @@ -36,45 +36,68 @@ style({ stroke: "#FFA500", fill: "none", - clipRect:[ [-10, -10], [20, 20] ], + clipRect:[[-10, -10], [20, 20]], arrows: null }); - plot( new Parabola( A, X1, Y1 ).graphieFunction, [-10, 10]); + plot(new Parabola(A, X1, Y1).graphieFunction, [-10, 10]); style({ stroke: "#6495ED", strokeWidth: 3, fill: "none", - clipRect:[ [-10, -10], [20, 20] ], + clipRect:[[-10, -10], [20, 20]], arrows: null }); - graph.currParabola = new Parabola( 1, 0, 0 ); + graph.currParabola = new Parabola(1, 0, 0); graph.currParabola.plot(); -
+
- - - +
+
+ + + +
-

y - 0 = 1(x - 0)^{2}

+

y - 0 = 1(x - 0)^{2}

-
- - - +
+ + + +
- - - +
[A, X1, Y1]
+
+ var parab = graph.currParabola; + return parab.getLeadingCoefficient() === A && + parab.getVertexX() === X1 && + parab.getVertexY() === Y1; +
+
+ guess = guess.length ? guess : [1, 0, 0]; + var parab = graph.currParabola; + parab.update.apply(parab, guess); + redrawParabola(false); +
+
+ guess = guess.length ? guess : [1, 0, 0]; + var a = guess[0], + x = guess[1], + y = guess[2]; + var equation = "y - " + y + "=" + a + "(x - " + x + ")^{2}"; + equation = cleanMath(equation); + \$("#equation-label").html("<code>" + equation + "</code>").tmpl(); +

#### 0 comments on commit `61053c9`

Please sign in to comment.