August 10th, 2024

Visualizing Complex Functions

Complex numbers combine real and imaginary parts, represented in 2D. Polar coordinates simplify operations, while visualizations map angles to colors. Advanced functions like the gamma function are significant in mathematics and machine learning.

Read original articleLink Icon
Visualizing Complex Functions

Complex numbers consist of a real and an imaginary component, represented as points on a 2D plane. The imaginary unit \(i\) allows for the extension of polynomials to complex numbers, facilitating operations like square roots of negative numbers. Complex numbers can be expressed in Cartesian coordinates as \(z = x + yi\) or in polar coordinates as \(z = r\mathrm{e}^{\theta i}\), where \(r\) is the magnitude and \(\theta\) is the angle. Complex functions, such as \(f(z) = z^2\), can be analyzed in both coordinate systems, with polar coordinates simplifying multiplication and squaring. Visualizing complex functions is challenging due to their four-dimensional nature, but techniques like vector fields and color mapping can help. By mapping angles to hues and magnitudes to lightness, complex functions can be represented visually. Various functions, including the identity, square, and sine functions, exhibit unique behaviors and transformations in these visualizations. The exploration of complex functions reveals intricate patterns, poles, and branch cuts, which are essential for understanding their behavior in the complex plane. The article also touches on advanced functions like the gamma function and the soft exponential, highlighting their significance in mathematics and applications such as neural networks.

- Complex numbers consist of real and imaginary components, represented in 2D.

- Polar coordinates simplify operations on complex numbers compared to Cartesian coordinates.

- Visualizing complex functions involves mapping angles to colors and magnitudes to lightness.

- Various complex functions exhibit unique transformations and behaviors in visual representations.

- Advanced functions like the gamma function and soft exponential are important in mathematics and machine learning.

Related

How the square root of 2 became a number

How the square root of 2 became a number

The historical development of the square root of 2 in mathematics is explored, highlighting struggles with irrational numbers by ancient Greeks. Dedekind and Cantor's contributions revolutionized mathematics, enabling a comprehensive understanding of numbers.

What makes e natural? (2004)

What makes e natural? (2004)

The number e in mathematics, introduced by Euler, has unique properties like transcendence and relation to trigonometric functions. Historical figures like Bürgi, Napier, and Briggs contributed to logarithmic advancements. E's significance lies in its role in exponential and logarithmic functions, crucial in calculus.

String Theory Unravels New Pi Formula: A Quantum Leap in Mathematics

String Theory Unravels New Pi Formula: A Quantum Leap in Mathematics

Scientists at IISc discovered a new pi representation through string theory, combining Euler-Beta Function and Feynman Diagram. This simplifies high-energy particle calculations, potentially impacting various fields with practical applications.

Undergraduate Texts in Mathematical Comics – A Tour of Complex Analysis

Undergraduate Texts in Mathematical Comics – A Tour of Complex Analysis

The website showcases mathematical comics by Andrea Tomatis, introducing rigorous concepts like Complex Analysis. Supported by the National Science Foundation, it combines math rigor with comics to engage readers effectively.

Evaluating a class of infinite sums in closed form

Evaluating a class of infinite sums in closed form

The article evaluates infinite sums using polylogarithms, noting that they yield rational numbers for non-negative integers. It discusses integer results for specific values and provides examples and proofs.

Link Icon 9 comments
By @bmitc - 6 months
A good book is Visual Complex Functions: An Introduction with Phase Portraits: https://www.amazon.com/Visual-Complex-Functions-Introduction...
By @vankessel - 6 months
Oh wow, I wasn't expecting to see this on Hacker News again!

This remains my most popular post. I'm very glad about the interest in mathematics it continues to generate!

---

To that one criticism, yes, there is no real "why" to the animations other than I thought they looked cool.

The post is not meant to be comprehensive, or teach anything more than bare basics meant to enjoy the visualizations.

I disagree that math visualizations must have clear pedagogical goals. Math visualizations can be purely exploratory.

The curves the poles trace out over time, are they significant somehow? Perhaps. Perhaps not. That's the exciting part of exploring new concepts. And part of the reason I chose linear over geometric interpolation.

Exploring those curves and alternate interpolations/animations was going to be part two, but it never happened.

I try to make posts accessible to as many people as possible. There is plenty of rigorous content already out there for learning more.

The focus for my blog is exploration and curiosity.

---

Perhaps I'll get around to part 2, and make it interactive with a compute shader.

Apologies for the code, it was never meant to be reused. I'm sure you can improve it!

Thank you for reading :)

By @azeemba - 6 months
The animation looks awesome! Looks like the author used matplotlib (as they mention in a comment on the website): https://github.com/vankessel/sandbox/blob/master/graph/inter...

In the past, I have used manim to make mathematical animations: https://www.manim.community/ Manim is more flexible but that comes with some overhead of complexity and learning. Example of some animations using manim:

- List of videos using manim: https://www.manim.community/awesome/

- A blog post I made: https://azeemba.com/posts/degenerate-matter.html

By @liminal - 6 months
This is very cool, but would greatly benefit from a perceptually linear color space. I think the author is using HSL -- HCL would be a better choice.
By @fauria - 6 months
One of the best explanations on imaginary numbers I've seen is Kalid Azad's from Better Explained: https://betterexplained.com/articles/a-visual-intuitive-guid...
By @simonmysun - 6 months
It reminds me that each year Freiberg University of Mining and Technology publishes a calendar of Complex Beauties[1], of which I buy several copies as gifts every year.

It includes 12 visualizations of selected complex functions and their background and related mathematicians. I would highly recommend reading them. Prof. Dr. Elias Wegert, the author who actively contributes to this calendar, also wrote Visual Complex Functions: An Introduction with Phase Portraits which is mentioned by another comment here.

[1]: https://blogs.hrz.tu-freiberg.de/mathekalender/english/

Edit: Navigate to the german page if you want to buy it

By @mkaic - 6 months
If you want to mess around with these sorts of visualizations yourself, I recommend checking out David Bau's little web app for it: http://davidbau.com/conformal
By @ttoinou - 6 months
Plug of my own work on the topic :

Using images as input to show conformal deformation https://www.youtube.com/watch?v=CMMrEDIFPZY

Better phase portraits with a grid, zeroes, poles https://www.shadertoy.com/view/Ms2Bz3

By @hyperific - 6 months
This was also posted previously in 2019.

https://news.ycombinator.com/item?id=19423278