Khan/khan-exercises

Use graph object for The Complex Plane.

```Summary: In response to D2032.

Test Plan:
locally, Chrome/OS X
- open in debug mode
- put in some incorrect answers, then a correct one
- click "Problem history" and see that the history is correct

Reviewers: eater, alpert

Reviewed By: eater

CC: stephanie

1 parent d7d00c2 commit e4a2b8c70d960b87c55b5f1e4ade615cdc720edb cbhl committed Feb 11, 2013
Showing with 8 additions and 8 deletions.
1. +8 −8 exercises/the_complex_plane.html
16 exercises/the_complex_plane.html
 @@ -30,22 +30,22 @@ label([0.5, 5], "Im", "right"); addMouseLayer(); - this.movablePoint = addMovablePoint({constraints: {}, snapX: 0.5, snapY: 0.5}); - movablePoint.onMove = function(x, y) { + graph.movablePoint = addMovablePoint({constraints: {}, snapX: 0.5, snapY: 0.5}); + graph.movablePoint.onMove = function(x, y) { if (x < LOWER_BOUND || x > UPPER_BOUND || y < LOWER_BOUND || y > UPPER_BOUND) { return false; } };
- movablePoint.coord + graph.movablePoint.coord
- return movablePoint.coord.join() === [REAL, IMAG].join(); + return graph.movablePoint.coord.join() === [REAL, IMAG].join();
- movablePoint.setCoord(guess); + graph.movablePoint.setCoord(guess);
@@ -60,21 +60,21 @@
style({stroke: ORANGE, strokeWidth: 2.0}); line([REAL, LOWER_BOUND - 1], [REAL, UPPER_BOUND + 1]); - movablePoint.visibleShape.toFront(); + graph.movablePoint.visibleShape.toFront();

The vertical orange line represents all complex numbers with real part REAL (including REP).

style({stroke: BLUE, strokeWidth: 2.0}); line([LOWER_BOUND - 1, IMAG], [UPPER_BOUND + 1, IMAG]); - movablePoint.visibleShape.toFront(); + graph.movablePoint.visibleShape.toFront();

The horizontal blue line represents all complex numbers with imaginary part IMAG, also including REP.

- movablePoint.moveTo(REAL, IMAG); + graph.movablePoint.moveTo(REAL, IMAG);

The only complex number with real part REAL and imaginary part IMAG is REP,