# Khan/khan-exercises

Add exercises: Graphing circles 1 & 2

Test Plan: Tested multiple problem seeds outside devappserver

Reviewers: stephanie, yunfangjuan

Reviewed By: yunfangjuan

Differential Revision: http://phabricator.khanacademy.org/D777
beneater committed Oct 2, 2012
1 parent a5882e3 commit d1f63a4759e703fd39ffda7bd75f113c9abd3ed2
Showing with 461 additions and 1 deletion.
1. +110 −0 exercises/graphing_circles.html
2. +183 −0 exercises/graphing_circles_2.html
3. +168 −1 utils/interactive.js
 @@ -0,0 +1,110 @@ + + + + + Graphing circles + + + + +
+
+
+
+ randRange(-5, 5) + randRange(-5, 5) + randRange(1, 5) + H === 0 ? "x^2" : + expr(["^", ["+", "x", -H], 2]) + + K === 0 ? "y^2" : + expr(["^", ["+", "y", -K], 2]) + +
+ +

+ Graph the circle expr(["+", X2T, Y2T]) + = R * R. +

+ +
+
+
+ graphInit({ + range: 11, + scale: 20, + axisArrows: "<->", + tickStep: 1, + labelStep: 1, + gridOpacity: 0.05, + axisOpacity: 0.2, + tickOpacity: 0.4, + labelOpacity: 0.5 + }); + + label( [ 0, 11 ], "y", "above" ); + label( [ 11, 0 ], "x", "right" ); + + addMouseLayer(); + graph.circle = addCircleGraph(); +
+
+ +
+
+ Drag the center point and perimeter of the circle + to graph the equation. +
+
[ + graph.circle.center[0], + graph.circle.center[1], + graph.circle.radius] +
+
+ if (_.isEqual(guess, [0, 0, 2])) { + return ""; + } + return _.isEqual(guess, [H, K, R]); +
+
+ graph.circle.setCenter(guess[0], guess[1]); + graph.circle.setRadius(guess[2]); +
+
+ +
+

+ The equation of a circle with center + (\blue{h}, \green{k}) and radius + \pink{r} is + (x - \blue{h})^2 + (y - \green{k})^2 = + \pink{r}^2. +

+

+ We can rewrite the given equation as + (x - \blue{negParens(H)})^2 + (y - + \green{negParens(K)})^2 = + \pink{R}^2. +

+
+

+ Thus, the center of the circle should be + (\blue{H}, \green{K}) + and the radius should be + \pink{R}. +

+
+ circle([H, K], R, { + stroke: PURPLE, + strokeWidth: 1, + strokeDasharray: "- " + }).toBack(); +
+
+
+
+
+
+ +
 @@ -0,0 +1,183 @@ + + + + + Graphing circles 2 + + + + +
+
+
+
+ randRange(-5, 5) + randRange(-5, 5) + randRange(1, 5) + H === 0 ? "x^2" : + expr(["^", ["+", "x", -H], 2]) + + K === 0 ? "y^2" : + expr(["^", ["+", "y", -K], 2]) + + -2 * H + -2 * K + H * H + K * K - R * R +
+ +

+ Graph the circle expr(["+", "x^2", "y^2", + D === 0 ? null : ["*", D, "x"], + E === 0 ? null : ["*", E, "y"], + F === 0 ? null : F]) + = 0. +

+ +
+
+
+ graphInit({ + range: 11, + scale: 20, + axisArrows: "<->", + tickStep: 1, + labelStep: 1, + gridOpacity: 0.05, + axisOpacity: 0.2, + tickOpacity: 0.4, + labelOpacity: 0.5 + }); + + label( [ 0, 11 ], "y", "above" ); + label( [ 11, 0 ], "x", "right" ); + + addMouseLayer(); + graph.circle = addCircleGraph(); +
+
+ +
+
+ Drag the center point and perimeter of the circle + to graph the equation. +
+
[ + graph.circle.center[0], + graph.circle.center[1], + graph.circle.radius] +
+
+ if (_.isEqual(guess, [0, 0, 2])) { + return ""; + } + return _.isEqual(guess, [H, K, R]); +
+
+ graph.circle.setCenter(guess[0], guess[1]); + graph.circle.setRadius(guess[2]); +
+
+ +
+

+ First, convert the equation to standard form by + completing the square. +

+
+

+ Group the \blue{x} and + \green{y} terms on the left side and + move the constant term to the right side. +

+

\qquad + \blue{ + (expr(["+", "x^2", ["*", D, "x"]])) + + (x^2) + } + + \green{ + (expr(["+", "y^2", ["*", E, "y"]])) + + (y^2) + } + \quad = \quad -F +

+
+
+

+ Add + + \blue{H * H} to both + sides to complete the square for the + \blue{x} term and + \green{K * K} to both + sides to complete the square for the + \green{y} term. +

+

\qquad + \blue{ + ( + expr(["+", "x^2", ["*", D, "x"], H * H]) + ) + + (x^2) + } + + \green{ + ( + expr(["+", "y^2", ["*", E, "y"], K * K]) + ) + + (y^2) + } \quad = \quad -F + + + \blue{H * H} + + + + \green{K * K} + +

+
+
+

Simplify and write each term as a square:

+

+

+
+

+ The equation of a circle with center + (\blue{h}, \green{k}) and radius + \pink{r} is + (x - \blue{h})^2 + (y - \green{k})^2 = + \pink{r}^2. +

+
+

+ Thus, the center of the circle should be + (\blue{H}, \green{K}) + and the radius should be + \pink{R}. +

+
+ circle([H, K], R, { + stroke: PURPLE, + strokeWidth: 1, + strokeDasharray: "- " + }).toBack(); +
+
+
+
+
+
+ +