What Is i? Code It in Python and See
i is √(−1), and when you treat it as code rather than algebra its meaning becomes a visible 90° rotation that gives complex numbers their 2D geometry.
A complete interactive classroom, not just a preview.
Start when you are ready to enter this Stage's 9 scenes and explore, respond, and learn as you go.
What does the imaginary unit i really do, and how can a few lines of code prove it?
Build a tiny Python program that rotates the complex plane by 90° and watch i come alive on screen.
i is defined as √(−1), yet code treats it as an ordinary value and draws clean geometric rotations — which view is the real one?
A live code editor, an animated complex plane, and a labeled rotation cycle produced by running multiplication by i step by step.
i is the 90° rotation that turns the number line into a 2D complex plane, and you can demonstrate it with a few lines of code.
i is just a mysterious symbol that lets impossible equations balance out, and it has no geometric meaning.
- Advanced complex analysis such as contour integrals and residues
- Polar form and Euler's formula beyond a brief mention
- Non-Python or non-JavaScript language comparisons
- 01The Square No Real Number Can TakeslideQuestion
Frame the puzzle: real arithmetic alone cannot answer x² = −1, so we need to decide what kind of number i should be before we ask code to draw it.
- Squares of real numbers are always ≥ 0
- Equations like x² + 1 = 0 still demand a solution
- What kind of value could square to a negative?
- 02Predict What i Will Do in CodequizPrediction
Ask the learner to choose what they expect multiplying by i will do to a point in a program before seeing the rotation.
- Commit to one expectation before running the program
- 03Multiply by i in a Python REPLinteractivePrediction
A live code panel where learners run short Python snippets using Python's built-in complex numbers and observe the values that come back.
- Type complex(0, 1) and inspect the result
- Multiply (1+0j) by 1j and see where it lands
- Chain four multiplications and watch the cycle
- 04Trace the Rotation in CodeinteractiveEvidence
Step-by-step code execution view that draws each successive value of multiplying by i onto a complex plane so the 90° rotation becomes undeniable.
- Step through z = z * 1j one execution at a time
- Plot each value on an animated complex plane
- Confirm 1 → i → −1 → −i → 1 emerges from the program
- 05Why the Code Shows RotationslideExplanation
Explain why the program's behavior matches the geometry: complex multiplication is a rotation-and-scale operation, and scaling is fixed at 1 for i.
- Python treats 1j as the imaginary unit with no special casing
- (a+bi)·i rotates the vector (a,b) by 90° counterclockwise
- Two rotations give i² = −1, exactly as the algebra predicts
- 06Plot Any Complex Number from CodeinteractiveExplanation
An interactive coding panel paired with a live plot: type any complex expression and watch the program draw and rotate the corresponding point.
- Enter a + bi as a Python expression
- See the arrow drawn from the origin to the point
- Multiply by 1j to rotate the arrow 90° in place
- 07Solve x² + 1 = 0 with a Two-Line PrograminteractiveTransfer
Ask the learner to write or run a tiny program that solves x² + 1 = 0, then verify the answer visually by plotting the two roots on the complex plane.
- Compute the roots using Python's cmath.sqrt
- Print the two conjugate solutions
- Plot them to confirm they sit at ±i
- 08Where i Stops HelpingslideBoundary
Show the limits: code will not let 1/0 become an imaginary infinity, and real-valued problems still need real-valued answers.
- Complex numbers extend real arithmetic; they do not replace it
- Division by zero is still undefined even with i
- A short Python snippet demonstrates the trap
- 09i, in One Program and One SentenceslideResolution
Tie the driving question to its payoff: define i in one line, run a loop that multiplies by i four times, and the rotation is the answer.
- i = √(−1) by definition, encoded as 1j in Python
- Multiplying by i rotates any complex point by 90°
- A handful of code lines reveals the geometry directly
Discussion threads for a Stage aren't available yet.