Back to Discover
Curiosity

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.

Before you enter

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.

9
Scenes
18 min
Estimated
Content language: en-US
Start this Stage
Sign-in may be required to play
What happens inside
  1. 01The Square No Real Number Can Takeslide
    Question

    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?
  2. 02Predict What i Will Do in Codequiz
    Prediction

    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
  3. 03Multiply by i in a Python REPLinteractive
    Prediction

    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
  4. 04Trace the Rotation in Codeinteractive
    Evidence

    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
  5. 05Why the Code Shows Rotationslide
    Explanation

    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
  6. 06Plot Any Complex Number from Codeinteractive
    Explanation

    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
  7. 07Solve x² + 1 = 0 with a Two-Line Programinteractive
    Transfer

    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
  8. 08Where i Stops Helpingslide
    Boundary

    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
  9. 09i, in One Program and One Sentenceslide
    Resolution

    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

Discussion threads for a Stage aren't available yet.

Where this leads
Other versions of this lesson
Explore more

More in Math & Logic

See all