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:

\qquad \blue{X2T} + \green{Y2T} \quad = \quad R * R

\qquad (x - \blue{negParens(H)})^2 + (y - \green{negParens(K)})^2 \quad = \quad \pink{R}^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.

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();