logoalt Hacker News

A Visual Intro to Complex Numbers

113 points • by surprisetalk • today at 12:00 PM • 68 comments • view on HN

Comments

arun-mani-j • today at 2:28 PM

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.

➕ show 9 replies
nneonneo • today at 3:38 PM

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.

➕ show 1 reply
laszlokorte • today at 3:08 PM

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/

zkmon • today at 2:54 PM

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)?

➕ show 3 replies
reenorap • today at 2:44 PM

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.

➕ show 4 replies
s-zeng • today at 3:18 PM

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/

➕ show 1 reply
ttoinou • today at 2:17 PM

I recommend Visual Complex Analysis by Tristan Needham

➕ show 1 reply
rdtsc • today at 5:03 PM

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".
freebsd_lovefes • today at 6:30 PM

It's so obscene that we're all getting screwed over by """experts""".

Mathematicians are getting replaced by AI for a good reason. They've jerked us with the flawed mathematics around for decades because they are all hiding so many skeletons in their closet.

One such skeleton is complex numbers. Complex numbers are only necessary because all other number systems that they made us use, like real numbers, in fact lack directionality. The entire foundation of mathematics is all messed up. And they sit there and LOL at the entire world.

There are like one or two people in the field who tried to do something about with type theories, but even that is dubious because they are not motivated - who needs mathematicians if they create theories that everyone can understand?

pratikdeoghare • today at 2:12 PM

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

bananaflag • today at 2:35 PM

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.

➕ show 1 reply
jdw64 • today at 2:15 PM

The explanation is easy and fun.

rramadass • today at 3:15 PM

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

socializer • today at 2:20 PM

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?

➕ show 1 reply
dominotw • today at 3:05 PM

tangent: I am really enjoying the new ui elements in chatpgt.

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

➕ show 1 reply
yoonge2 • today at 1:57 PM

[flagged]

d--b • today at 2:53 PM

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.

➕ show 4 replies