-5 5 randRange(LOWER_BOUND, UPPER_BOUND) randRange(LOWER_BOUND, UPPER_BOUND) complexNumber(REAL, IMAG)

Move the orange dot to REP.

graphInit({ range: [[LOWER_BOUND - 1, UPPER_BOUND + 1], [LOWER_BOUND - 1, UPPER_BOUND + 1]], tickStep: 1, labelStep: 1, scale: 30 }); label([6, 0.5], "Re", "left"); label([0.5, 5], "Im", "right"); addMouseLayer(); this.movablePoint = addMovablePoint({constraints: {}, snapX: 0.5, snapY: 0.5}); movablePoint.onMove = function(x, y) { if (x < LOWER_BOUND || x > UPPER_BOUND || y < LOWER_BOUND || y > UPPER_BOUND) { return false; } };
movablePoint.coord
return movablePoint.coord.join() === [REAL, IMAG].join();
movablePoint.setCoord(guess);

Complex numbers can be visualized as points on a plane. The coordinates on the real and imaginary axes correspond to the real and imaginary parts of the complex number.

REP has real part REAL and imaginary part IMAG.

style({stroke: ORANGE, strokeWidth: 2.0}); line([REAL, LOWER_BOUND - 1], [REAL, UPPER_BOUND + 1]); 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();

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

movablePoint.moveTo(REAL, IMAG);

The only complex number with real part REAL and imaginary part IMAG is REP, so it lies on the intersection of the vertical orange line and the horizontal blue line.