randRangeNonZero(-5, 5) randRangeNonZero(-5, 5) randRangeNonZero(-5, 5) randRangeNonZero(-5, 5)

Let a and b be complex numbers:

\begin{align*} a &= REAL1 + coefficient(COMPLEX1)i \\ b &= REAL2 + coefficient(COMPLEX2)i \end{align*}

Plot a + b by dragging the point.

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: BLUE, arrows: "->" }); line([0, 0], [REAL2, COMPLEX2], { stroke: GREEN, arrows: "->" }); var AF = 1 + 0.8 / sqrt(REAL1 * REAL1 + COMPLEX1 * COMPLEX1); label([AF * REAL1, AF * COMPLEX1], "a", { color: BLUE }); var BF = 1 + 0.8 / sqrt(REAL2 * REAL2 + COMPLEX2 * COMPLEX2); label([BF * REAL2, BF * COMPLEX2], "b", { color: GREEN }); 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 = (\purple{REAL1} + \pink{coefficient(COMPLEX1)i}) + (\purple{REAL2} + \pink{coefficient(COMPLEX2)i})

\hphantom{a + b} = \purple{(REAL1 + REAL2)} + \pink{(COMPLEX1 + COMPLEX2)i}

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

\hphantom{a + b} = \purple{REAL1 + REAL2} + \pink{coefficient(COMPLEX1 + COMPLEX2)i}

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

Plot a - b by dragging the point.

Subtract the real and imaginary components separately.

a - b = (\purple{REAL1} + \pink{coefficient(COMPLEX1)i}) - (\purple{REAL2} + \pink{coefficient(COMPLEX2)i})

\hphantom{a - b} = \purple{(REAL1 - REAL2)} + \pink{(COMPLEX1 - COMPLEX2)i}

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

\hphantom{a - b} = \purple{REAL1 - REAL2} + \pink{coefficient(COMPLEX1 - COMPLEX2)i}

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