# Khan/khan-exercises

Summary:

Multiplication

Revert "Multiplication"

This reverts commit ddf5bfb.

Typos

Removed errant file from different branch

Merge branch 'complex-plane-operations' of git://github.com/davemajor/khan-exercises into 39367-complex-plane-operations

Make Complex Plane Operations more like Adding Vectors.

Test Plan:
locally, Chrome/OS X
both problem types, seeds: 1, 3, 5, 7
- didn't blow up
- displayed expected hints

Reviewers: eater, stephanie

Reviewed By: eater

CC: alpert

Differential Revision: http://phabricator.khanacademy.org/D2032
cbhl committed Feb 12, 2013
1 parent e4a2b8c commit 2ff4477a05263e5a4540ec49452b37bc1a268233
Showing with 126 additions and 0 deletions.
1. +126 −0 exercises/complex_plane_operations.html
 @@ -0,0 +1,126 @@ + + + + Operations in the Complex Plane + + + +
+
+ randRangeNonZero(-5, 5) + randRangeNonZero(-5, 5) + randRangeNonZero(-5, 5) + randRangeNonZero(-5, 5) +
+ +
+

Let a and b be complex numbers:

+

\begin{align*} + a &= REAL1 + COMPLEX1i \\ + b &= REAL2 + COMPLEX2i + \end{align*}

+
+ +

What is a+b?

+ +
+ graphInit({ + range: 11, + scale: 20, + tickStep: 1, + labelStep: 1, + }); + + label([ 11, 1], "Re", "left"); + label([ 0.5, 10], "Im", "right"); + + line([0, 0], [REAL1, COMPLEX1], { stroke: "#6495ed", arrows: "->" }); + line([0, 0], [REAL2, COMPLEX2], { stroke: "#28ae7b", arrows: "->" }); + + var AF = 1 + 0.8 / sqrt(REAL1 * REAL1 + COMPLEX1 * COMPLEX1); + label([AF * REAL1, AF * COMPLEX1], "a", { color: "#6495ed" }); + + var BF = 1 + 0.8 / sqrt(REAL2 * REAL2 + COMPLEX2 * COMPLEX2); + label([BF * REAL2, BF * COMPLEX2], "b", { color: "#28ae7b" }); + + addMouseLayer(); + graph.guessPoint = addMovablePoint({ + constraints: {}, + snapX: 0.5, + snapY: 0.5, + }); +
+
+
+
graph.guessPoint.coord
+
+ if (guess[0] === ANSWER[0] && guess[1] === ANSWER[1]) { + return true; + } else { + return false; + } +
+
+ graph.guessPoint.setCoord(guess); +
+
+ +
+
+
+ [REAL1 + REAL2, COMPLEX1 + COMPLEX2] +
+ +
+
+

Sum the real and imaginary components separately.

+
+
+

a + b = (REAL1 + REAL2) + (COMPLEX1 + COMPLEX2)i

+
+ line([REAL2, COMPLEX2], [REAL1 + REAL2, COMPLEX1 + COMPLEX2], { stroke: "#6495ed", arrows: "->" }); + graph.guessPoint.toFront(); +
+
+
+

\hphantom{a + b} = REAL1 + REAL2 + COMPLEX1 + COMPLEX2i

+
+ line([0, 0], [REAL1 + REAL2, COMPLEX1 + COMPLEX2], { stroke: "#ffa500", arrows: "->" }); + graph.guessPoint.toFront(); + graph.guessPoint.moveTo(REAL1 + REAL2, COMPLEX1 + COMPLEX2); +
+
+
+
+
+
+ [REAL1 - REAL2, COMPLEX1 - COMPLEX2] +
+

What is a-b?

+
+
+

Subtract the real and imaginary components separately.

+
+
+

a + b = (REAL1 - REAL2) + (COMPLEX1 - COMPLEX2)i

+
+ line([REAL1, COMPLEX1], [REAL1 - REAL2, COMPLEX1 - COMPLEX2], { stroke: "#28ae7b", arrows: "->" }); + graph.guessPoint.toFront(); +
+
+
+

\hphantom{a + b} = REAL2 + COMPLEX2i

+
+ line([0, 0], [REAL1 - REAL2, COMPLEX1 - COMPLEX2], { stroke: "#ffa500", arrows: "->" }); + graph.guessPoint.toFront(); + graph.guessPoint.moveTo(REAL1 - REAL2, COMPLEX1 - COMPLEX2); +
+
+
+
+
+
+ +