A Visual Intro to Complex Numbers

(photonlines.substack.com)

82 points | by surprisetalk 5 hours ago

18 comments

  • arun-mani-j 2 hours ago
    When I first learnt complex numbers in school, I couldn't understand their purpose or why they are called imaginary etc.

    I checked where they are used and found examples of current, magnetism etc. But I couldn't understand, electricity is a measurable physical quantity, how can you use imaginary numbers there??

    Then I searched internet and found a Stack Exchange answer telling the story and how, instead of, complex (sounds like difficult) or imaginary (sounds like not useful practically), if we had better terms for them, then it would have been easier for beginners to understand them more intuitively.

    It's completely true in my case.

    After learning usage of vectors, thanks to Godot, for rotation and movement, and then about matrix etc. I now feel like "complex" numbers etc. are the representation of data through multiple numbers where a single value (scalars) is not enough. I may not be right in strict mathematics terms, but at least that's how I was able to understand them.

    • bananaflag 2 hours ago
      I think it would have been clearer if they weren't called "numbers".

      For example, look at matrices [1]: no one asks themselves whether they are "real" or not. We know that we have defined operations on arrays of numbers which are useful to some degree.

      If complex numbers were just called "complexes", a lot of confusion would just wither away.

      Also, interestingly, quaternions and octonions aren't called "numbers".

      [1] Complex numbers may, of course, be seen as special kinds of matrices, but this is beside my point here.

      • prmph 1 hour ago
        Oh, but they can be considered numbers.

        I guess what counts as a number is arguable. But -1 is a number, and yet it has two parts: the natural number, and the sign. Sqrt(2) is a number, and yet it cannot be written down exactly. It requires an algebraic representation.

        Generally, I think we use the word "number" for mathematical objects that have some notions we associate with the natural number (which are what we most intuitively understand as numbers), like ordering, summation, a notion of zero, etc. Complex numbers do not have all of these, but they have enough that we consider them numbers.

        Another way to think of this: most of these non-natural numbers arose as a way of being able to represent results of basic operations on natural numbers, that are not themselves natural numbers. These results could sometimes be operated on further to yield a natural number again. But if we did not invent new numbers for these, these result were not easily expressible, and led to gaps in our math frameworks. In fact, a lot of math progress was hampered by not recognizing these numbers, and progress followed once they were recognized. And the reason we call them numbers is that they arise from basic algebraic operations on natural numbers.

    • joostdevries 1 hour ago
      I particularly like this book by Steven Pemberton. https://homepages.cwi.nl/~steven/Numbers.pdf

      Imaginary numbers never made sense to me in high school. But this book gradually builds it up in a way that made the conclusion positively intuïtive. Highly recommended!

    • BenoitP 37 minutes ago
      To me their purpose only came clearly recently. They're just a way to rotate smoothly one dimension into another. And control the speed of the rotation.

      x into y. Potential energy to kinetic energy. Charge into current.

      Keeping this definition but going higher in the dimensions: x into y, y into z and z into x. Going meta, the x into y rotation defines a plane; And a plane going into another direction is a volume. (x into y) into z.

      What made it click, what made it beautiful is Geometric Algebra:

      https://youtu.be/60z_hpEAtD8?is=e3GxYU4J1SdpsumW

      • Koshkin 25 minutes ago
        > came clearly recently. They're just...

        I assure you this is not the last enlightening moment that you are going have about what the complex numbers are.

        > Geometric Algebra

        Ah... Haven's heard about that one in quite some time...

    • ab71e5 2 hours ago
      I've come to understand it as something with both a magnitude and a phase. When you have a unity sine wave, it has two points per period where the magnitude is zero but those points have different phases.
    • rottc0dd 2 hours ago
      I really was surprised on this when learning about these in Welch labs [1] and 3b1b.

      [1] https://www.youtube.com/watch?v=T647CGsuOVU&list=PLiaHhY2iBX...

    • ambicapter 1 hour ago
      > I now feel like "complex" numbers etc. are the representation of data through multiple numbers where a single value (scalars) is not enough.

      Ok, now find a single term that you think would adequately describe that concept.

    • hingler36 1 hour ago
      Agreed, the naming system is atrocious. The one that really pisses me off at this point is that "real" numbers get to be called that. Imaginary numbers with rational coefficients are SIGNIFICANTLY more "real" than a converging infinite series, imo
      • ColinWright 1 hour ago
        Wait ... you think of the Reals as converging infinite series?

        I think of them as pairs (L,R) of sets of rationals, with every in L less than or equal to every thing in R ...

    • stackghost 2 hours ago
      I had a calculus prof who described it thus:

      Calculus is a mathematical model of the world, and it is wrong in the sense of the famous quote about "all models [being] wrong, but some are useful", so mathematicians used the imaginary unit almost like a hotfix for their model.

      Whether that's an accurate/rigorous statement or not, it helped me as a learner.

      You can, of course, express things like oscillation without i, using vectors and matrices. But the ability to use Euler's formula to express complicated sinusoids as compact exponentials with base e simply makes the analysis much easier. In the words of my prof, it's merely a mathematical structure to express things more easily that "regular calculus" isn't good at expressing.

      To me, that made the apparent paradoxes of expressing e.g. phase angles and reactive power and stuff using i a lot easier to stomach.

      • ttoinou 8 minutes ago
        You can use exponential with matrices as well.

        That some people don’t want to understand deeply the tools they use don’t make their tools superficial or “hotfixes”

    • MrBuddyCasino 2 hours ago
      So much of mathematics is just this.
  • rdtsc 16 minutes ago
    Fun fact: Python natively supports complex numbers

        In [1]: 2+3j
        Out[1]: (2+3j)
    
        In [2]: x=2+3j
    
        In [3]: y=1-5j
    
        In [4]: x+y
        Out[4]: (3-2j)
    
        In [5]: x*7
        Out[5]: (14+21j)
    
        In [6]: x*y
        Out[6]: (17-7j)
    
        In [7]: x**2
        Out[7]: (-5+12j)
    
    I've used them before for 2D graphics as a "hack".
  • nneonneo 1 hour ago
    This article misses one of the most useful and deep representations for complex numbers: polar coordinates. There’s some bits in there about adding angles and such when multiplying, but it turns out these are “obvious” in polar notation.

    A complex number can be expressed in Cartesian coordinates as (x,y) or x+yi. It can be expressed as polar coordinates as (r,theta). What’s the corresponding complex notation? Surprisingly, it’s r*e^(i theta), where the angle is taken in radians. It might seem really weird to see an exponential there, but it turns out that the exponential behaves like a trig function when given an imaginary exponent - to be precise, e^(i theta) = cos theta + i sin theta.

    Now multiplication becomes easy: multiplying two polar-notation complex numbers (r1,t1) x (r2,t2) gives r1r2 e^(i (t1+t2)) following the usual rules of exponential arithmetic, i.e. (r1r1, t1+t2).

    The complex exponential looks like a very strange notation at first because we’re all used to grade school exponents, but you can think of it as a function that takes an angle and produces a point on the unit circle. Feed it a continuous input, and it traces out an arc or a circle. sin and cos are merely the one-dimensional projections of this function.

    Frequency becomes simply e^(i ft) where f is the frequency in radians and t is time - representing a point racing around a circle at a set speed. Multiplying two signals with different (complex) frequencies produces a new signal with the sum of their frequencies. With this notation, complex signals are the simple ones to understand - real signals are the “more complex” ones, as every real signal consists of a complex signal added to its conjugate.

    • alterom 1 hour ago
      The "visual intro" misses a lot, and wastes half the space by introducing the complex numbers algebraically without a single visual because it's LLM slop.

      A "visual intro" that doesn't even mention Mobius transformations[1] or Riemann surfaces [2] or any of the beautiful, colorful ways to visualize complex functions [3], or..

      ..well, it's just lazy LLM slop.

      Is it better than the average high school introduction to the subject?

      Sadly, yes. But it's such a low bar.

      [1] https://www.youtube.com/watch?v=0z1fIsUNhO4

      [2] https://www.youtube.com/watch?v=Ax5wbKsPBqA

      [3] https://www.youtube.com/watch?v=NtoIXhUgqSk

      • nneonneo 12 minutes ago
        You’ve asserted several times in this thread that this is “LLM slop”. Having read a decent amount of math content on the internet, I’m not sure I quite agree, so I’d like to hear why you think it’s LLM slop?

        For one, this article has (charmingly?) terrible math rendering, rather reminiscent of someone copy-pasting random pictures of equations from the Internet and supplementing them with Word’s Equation Editor or something. An LLM would have just dumped a pile of LaTeX and called it a day. For another, I don’t sense any of the usual writing tics that are suggestive of LLM writing. I don’t claim either of those are remotely definitive, but my personal feeling is that this was largely hand-written and aimed at a very introductory level (i.e. not the sort of level that will benefit from knowing about Riemann surfaces).

  • zkmon 2 hours ago
    But when you represent a complex number as a+bi, what's the meaning of '+' there? In Argand diagram, the numbers are coordinates. Why do you sum up coordinates?

    More fundamentally what's addition and multiplication? Is there a continuity between them, like an operator that represents both addition and multiplication meeting them half-way?

    What's the significance of square and square root? Aren't they just some exponent values (2, 1/2) which have no particular significance on the real line? Why should imaginary numbers have a special place if they are tied to square roots (exponent of 0.5)?

    • creata 2 hours ago
      > Why do you sum up coordinates?

      People use sums to denote vector components, too. It's common to see ai + bj + ck (pretend there are hats on i, j, and k) to mean the vector [a b c].

      So with complex numbers, you can think of it as a vector aj + bi where j and i are basis vectors, but we call j "1", because complex numbers have a notion of multiplication, and in that notion, j acts like 1, in that zj = jz = z for any complex number z.

      Nothing bad happens if you write all complex numbers a + bi as vectors or tuples [a b]. It's just less convenient.

      • zkmon 2 hours ago
        We denote a 2D point as (3,2) not (3+2). Why?
        • ttoinou 7 minutes ago
          You can absolutely deal with complex numbers with the (x,y) notation
        • creata 2 hours ago
          3 + 2 is just 5. But people will sometimes write 3i + 2j for the point or vector (3, 2), where i is the vector (1, 0) and j is the vector (0, 1).
        • laszlokorte 2 hours ago
          In your example 3 and 2 belong to different dimensions. you could write "3x + 2y" to express 3 steps along the x axis and 2 along the y axis. Just writing "3+2" would lead to the expectation that 5 could be calculated as reasonable result, which would not be the case.
    • renyicircle 17 minutes ago
      >what's the meaning of '+' there?

      Mathematicians often reuse the same notation for different things where it's clear (for the mathematicians) what the implied meaning is. That means however that non-mathematicians can get confused.

      The plus here is the operation that we call "the sum of complex numbers", where the numbers are a and bi. We can work towards this by first defining complex numbers as a tuple of two real numbers with particular sum and multiplication laws for these tuples. So (a, b) + (c, d) = (a + b, c + d) where the left side plus is for complex numbers and the right side plus is for real numbers. Similarly for multiplication, (a, b) * (c, d) = (ac - bd, bc + ad).

      We associate (1,0) with the real number 1, and similarly for tuples of the form (a,0). The association is what allows us to see the real numbers as a subset of the complex numbers rather than being some unrelated set. It makes sense because the set of tuples of the form (a,0) with the multiplication laws of complex numbers behaves the same way as the real numbers and is in 1:1 correspondence with them. This association is used every time we write (a,0) as a(1,0) or just "a". We also write (0,b) as b(0,1) since (b,0)*(0,1) = (0,b), from the multiplication law. A general tuple (a, b) then can be written as (a,0) + (0,b) or, as what we've said is the same thing, a + b(0,1). Now we have simplified notation for all of these things except (0,1). It follows from the multiplication law that (0,1)*(0,1) = -(1,0) = -1. The complex number whose square is -1 is denoted as i. All these simplifications allow you to write (a,b) as a + bi.

      > More fundamentally what's addition and multiplication? Is there a continuity between them, like an operator that represents both addition and multiplication meeting them half-way?

      I'm not personally aware of any concept of continuity between these operations. In abstract algebra, operations are fundamental to an algebraic structure. The field of real numbers or the field of complex numbers are algebraic structures defined by their elements, the binary operation called addition, the binary operation called multiplication, and the laws that these operations satisfy. For example, both are commutative and associative, but the distribution law shows that they're different: a*(b+c) = a*b + a*c, but not a+b*c = (a+b)*(a+c). Also, a+0 = a, but a*1 = a, so the operations have different special elements that "fix" the other element when an operation is applied. It may be interesting to think what a "half-way operator" would have to be like with respect to these laws.

      >What's the significance of square and square root? Aren't they just some exponent values (2, 1/2) which have no particular significance on the real line?

      The idea of complex numbers and the more general idea of field extensions, which describes the process of obtaining complex numbers from reals, came from the study of polynomials. Polynomials can only have terms of integer degree. They satisfy many nice properties and quite rich mathematical structures arise from them which would not be possible with general non-integer degrees. Second degree polynomials with real coefficients, like x^2 + 1, are the lowest-degree polynomials such that they may not have real roots, and x^2 + 1 is the simplest example, but any other polynomial without real roots can be used to produce the complex numbers as well. This is where the 2 comes from. It's not significant from a real line perspective (2 is just a number among the infinite reals) but it's significant from an algebraic one.

  • reenorap 2 hours ago
    Complex numbers would be a much easier concept to understand if they didn't call it "complex" numbers or use the term "imaginary" numbers. Both of those make it much harder to digest because now you think that it's not real. What they really are are 2 dimensional numbers, meaning they have 2 components to each number.

    The same goes for the term "real" numbers. Sometimes math, and its descendants like physics and computer science, can be too cutesy with their names that make it hard for regular people to understand or accept.

    • raegis 2 hours ago
      I've been teaching math for 35 years, which I admit, doesn't say much, but I assure you the difficulties students have with complex numbers by and large have nothing to do with the name. It's the same with everything else: lack of preparation in arithmetic and basic algebra.
      • alterom 1 hour ago
        Well calling complex numbers "rotational" would at least give a clue to what they do.

        You can do them purely geometrically, so lack of preparation in arithmetic and algebra isn't a pre-requisite.

    • prmph 35 minutes ago
      You are very right.

      But, might be more complete to say that complex numbers are two-dimensional numbers used to model a lot of different things. So simply saying they are two dimensional numbers only part of the explanation. To fully understand them, you need to consider the notion of a 2-d number fits the application area, and what it means in context.

      For example, complex numbers can provide an elegant way to represent rotations, oscillations, waves, etc. making certain calculations much easier.

      But complex numbers are also used to extend the real number system in a way that ensures every non-constant polynomial has a root. In that context, they aren't merely a convenient tool for representing two-dimensional phenomena; they help complete the number system itself in a mathematically precise sense.

      And then there is quantum mechanics, where complex numbers play a fundamental role in the mathematical description of reality itself.

    • ky3 2 hours ago
      Hear, hear. "Complex" makes it sound difficult, when the original idea was that they were a complex--as in compound--of two numbers. Complex analysis turns out to be almost trivial, thus taking an orthogonal journey, compared to the gnarliness of real analysis.
      • gus_massa 2 hours ago
        One of my friends had a Russian book translated to Spanish. The translation had a few mistskes, in particular they call them "complicated" numbers. :)
  • ttoinou 3 hours ago
    I recommend Visual Complex Analysis by Tristan Needham
    • pratikdeoghare 2 hours ago
      There is proof of this theorem in it that blew my mind some years ago [1]. Someday I want to finish reading the rest of the book.

      > Starting with a given convex quadrilateral, construct a square, external to the quadrilateral, on each side. Van Aubel's theorem states that the two line segments between the centers of opposite squares are of equal lengths and are at right angles to one another.

      https://en.wikipedia.org/wiki/Van_Aubel%27s_theorem

      • kevinwang 1 hour ago
        Wow, that's such a surprising theorem. Thanks for sharing.
  • laszlokorte 2 hours ago
    For an interactive approach I built this some time ago. [1]

    It allows putting complex numbers on the complex plane and doing addition, multiplication and exponentiation via drag and drop. It provides some intuition for addition==translation and multiplication==scale-rotation.

    [1]: https://static.laszlokorte.de/complex-plane/

  • s-zeng 2 hours ago
    I do have a soft spot for visual complex number explainers, good work. When I was 13 I credit [1] for blowing my mind about complex numbers and setting me onto my current career path

    [1]: https://acko.net/blog/how-to-fold-a-julia-fractal/

    • EForEndeavour 1 hour ago
      Wow. Thank you for sharing this relatively ancient online treasure.

      Aside: as a commentary on how AI-brainrotted I've let myself become, I am awestruck by the animations and writing on that page predating the LLM coding era by that much. Already, the idea of someone acquiring the theoretical knowledge and practical software skills and time management and executive-function skills to create that page feels like it will only get more rare as more of us work at ever higher levels of abstraction.

  • bananaflag 2 hours ago
    The explanation is a bit confusing, since it basically reduces to "some equations don't have solutions, so we have to invent them", which, if you already accept, you don't need complicated equations, just x^2=-1.

    One thing which would have worked better (which is briefly mentioned) is Cardano's casus irreducibilis, but that would have needed more work.

  • pratikdeoghare 3 hours ago
    I used complex numbers to solve popular interview question.

    It can be used to convince students that they are useful.

    https://pratik.deoghare.com/complex-mars-rover.html

  • socializer 2 hours ago
    Really? Of approximately one billion good, visual introductions to complex numbers, we're going to pick an article that appears to be substantially written by an LLM?
    • alterom 1 hour ago
      My feelings exactly.

      It doesn't just appear to be substantially written by an LLM; it was written by an LLM.

      It lacks the punch. Anyone who didn't know the geometric definition would just be bored to hell by going over the history of how they were discovered which has nothing to do with geometry.

      The article says "Visual Intro", but the introduction is literally not visual. The complex numbers are introduced through historical/algebraic lens, and then reintroduced visually, by which time the audience has been lost.

      Of course this article will rise to the top here.

  • rramadass 2 hours ago
    Here is an excellent (and visual) series of videos on Complex Numbers by Welch Labs titled "Imaginary Numbers are Real" - https://news.ycombinator.com/item?id=46972870
  • d--b 2 hours ago
    I find the historical approach is not the best way to learn about complex numbers.

    Deciding square root of -1 is fine and use it in calculations as if it existed is confusing. Why does it work with sqrt(-1), and not with dividing by 0 ?

    introducing the imaginary plane as: "hey someone found you could just draw them, and it works even better!" is even worse.

    To teach complex numbers, you should start by defining them:

    1 is here, i is here, multiplication for 1 is like in R, but multiplicating i by itself goes to -1, and then derive the calculation rules then.

    And only when you went all the way to exp(i*theta) = cos(theta) + i sin(theta)

    Only then you should explain what they are for. That they are a way to treat real numbers as a projection of these things that behave nicer in calculations. Deriving trig functions from that simple formula is trivial.

    • pratikdeoghare 41 minutes ago
      It might help to point out to students that not all things called “number” in math are for counting/measuring.

      Even before complex numbers, I was confused by negative numbers. Why negative times negative suddenly positive?

      I spent time figuring that out. When complex numbers came I was ready. I knew they were not really numbers that would count something. And that they are just called numbers.

    • BobaFloutist 2 hours ago
      > Why does it work with sqrt(-1), and not with dividing by 0

      This is pretty straightforward to explain.

      With dividing by zero, any number you multiply by zero becomes zero. There's no other way to get zero through multiplication. So, the only sensible thing to divide by zero is zero (since "What times zero equals six?" doesn't have an answer).

      But because anything multiplied by zero is zero, even if you divide zero by zero you have an undefined answer. Zero divided by zero could be anything! So that's also not meaningful.

      The square root of negative one, however, only has to be defined once to get meaning out of all negative square roots.

      • d--b 1 hour ago
        well see the sibling comment... Apparently extending the complex plane with a number that represent 1/0 is a thing...
    • laszlokorte 1 hour ago
      I think the best introduction is by taking the geometric perspective: Addition is translation, multiplication with a positive number is scaling, multiplication with -1 is reflecting across the origin, multiplication with any negative number is scaling and reflecting at once. multiplying with a square root of a positive number does only part(half) of the scaling. multiplying twice with the square root does the full scaling.

      Now the only question left is: what is the half of a reflection? a 90 degree rotation into a new dimension. Doing it twice returns to the original dimension but on the opposite side of the origin.

      This also explains why division of 0 is a problem: multiplying by 0 scales everything to the origin (ie deletes the original size). Division would need to restore the original size. But as a sibling comment has already said. Division by zero could just scale everything to infinity. But then everything can only flip between 0 and infinity.

      • d--b 1 hour ago
        yeah I think that's right.

        taking the geometric aspect first and defining operations on points in the plane, showing that it works to match multiplication and rotation.

    • alterom 1 hour ago
      >Why does it work with sqrt(-1), and not with dividing by 0 ?

      Good question!

      It does work with dividing by zero :D

      See: https://en.wikipedia.org/wiki/Riemann_sphere

  • jdw64 3 hours ago
    The explanation is easy and fun.
  • dominotw 2 hours ago
    tangent: I am really enjoying the new ui elements in chatpgt.

    Explain X to me prompt now gives me pictures, quizes . so good.

    • alterom 1 hour ago
      Not a tangent really. This explanation was very clearly LLM-produced.

      For starters, this "visual intro" introduces complex numbers algebraically.

      The text has a visual explanation, but the intro had zero pictures.

  • yoonge2 3 hours ago
    [flagged]