Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Visualizing Complex Functions (vankessel.io)
77 points by hyperific on Aug 13, 2024 | hide | past | favorite | 14 comments


A good book is Visual Complex Functions: An Introduction with Phase Portraits: https://www.amazon.com/Visual-Complex-Functions-Introduction...


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


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


I couldn't disagree more to be honest, about this post. Animations are good when they provide object permanence, and let you track what's changing and how.

This post linearly interpolates complex functions blindly, which doesn't tell you anything useful, unless the thing being interpolated is an affine or projective transform where that makes sense.

e.g. For complex powers, the most natural animation is to animate the exponent, which will show a continuous folding or unfolding. Here the squaring just looks like the extra 360° appears out of nowhere.

For mobius-like transforms, interpolating the inverse might be better.

One particularly good example is e.g. visualizing equally spaced points on a circle, and their various combinations as roots and poles of complex functions.

The goal of math animation should be to highlight and travel the natural geodesics of the concept space, with natural starts and stops too.

The rest is cargo culting.


Not sure what you mean by this.

> The goal of math animation should be to highlight and travel the natural geodesics of the concept space, with natural starts and stops too.

> The rest is cargo culting.

A geodesic as I understand it is the curve representing the shortest path between two points in some manifold.

So take one thing that I have found math animations useful for: showing the path of travel of some parametric system. Is that a geodesic? Not necessarily in the cartesian space of the system. I don't know what it would mean for it to be a natural geodesic of the concept space.

For me the goal of math animation is the same as the goal of any math visualisation: to improve understanding and intuition. When I animate something (Which I only ever do for myself) that is why I do it. Am I cargo culting in your estimation?

Let's take another example: Say I do an animation of some sort of force problem in mechanics. I can show the paths of some particles in the simulation and the magnitude and direction of the various vectors vs time. Is that cargo culting? It's definitely not any kind of geodesic. Does it help my understanding? Quite possibly.

In that sense in the blog post you are addressing, in my opinion the position vs momentum distribution animation is really great because it really helps my intuition of how those probability distributions are related and how one would change as the other changes.


I animated the power in this video after 18sec : https://www.shadertoy.com/view/Ms2Bz3

Please note that complex powers involve the complex logarithm, which is multivalued, it should be a surface in 3D to really see the whole function. The animation I made is only taking one value of the power


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.


The author's code is available in an archived repo so it should be possible to experiment with different colormaps.

https://github.com/vankessel/sandbox/tree/master


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...


Even better is this series from Welch Labs titled Imaginary Numbers are Real - https://www.youtube.com/playlist?list=PLiaHhY2iBX9g6KIvZ_703...


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


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


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


This was also posted previously in 2019.

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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: