• Re: Practical applications of complex numbers

    From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Sat Aug 1 22:10:26 2026
    On 01/08/2026 9:20 PM, Stefan Ram wrote:
    Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote or quoted:
    Can you please fill me in on more useful practical applications of
    complex numbers than just the Mandelbrot visualization?

    Physics is full of them, especially in quantum theory.

    The following example does not actually require quantum theory:

    A /glass plate/ can shift the phase of a light beam travelling
    through it. A plate with a certain thickness d will change the
    amplitude from a to -a.

    Change of amplitude from a to -a

    Before

    | .....---...
    | ...'' ''.. ..
    | ..' ''.. ..'
    | ..'' `'. ..'
    |.' `'. ..' |-------------------------------`----------------------------.''--------
    | `'.. ..'
    | `.. ..'
    | ''.. ...'
    | ''-.......''

    After

    |
    | .....'--...
    | ..'' '''..
    | ..'' ''.
    | ..' `'.
    | ..' '.. |-.---------------------------:'-------------------------------`--------
    | `'. ..' `'.
    | `'.. ..' `'..
    | ''.. ...'' ''
    | ''--......''
    |

    This is some beautiful ASCII art rendering of waves. Do you have a tool
    that does this, or do you keep this pre-rendered in a text file for just
    such occasions?
    I'm not asking completely idly, I am wondering if I can make such a tool myself. Preferably without resorting to look at anything but the output
    above; I mean, not any ready made source code.

    Cross posting to alt.ascii-art, and you can see some of my old art re-
    posted there recently.


    Introducing /two/ such plates, we get -(-a), which is the original
    wave again.

    Each plate multiplies the amplitude by -1, and their combination has
    the effect of /two/ multiplications by -1, i.e., of (-1)*(-1)=1.

    So, a plate of thickness d multiplies by -1.

    If we combine /two/ plates of thickness d/2 we still get a multipli-
    cation by -1. So what does /one/ plate of thickness d/2 multiply
    the amplitude with?


    I have a feeling the answer should be /i/, but I'm not sure. Feel free
    to recommend books, websites, or PDF files where I can brush up on light physics.

    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Sat Aug 1 22:58:13 2026
    On 01/08/2026 10:37 PM, Stefan Ram wrote:
    Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote or quoted:
    This is some beautiful ASCII art rendering of waves. Do you have a tool
    that does this, or do you keep this pre-rendered in a text file for just
    such occasions?

    I've written a Python script that renders pixels to an array
    and then tries to match rectangles with such pixels to ASCII
    characters; it is using a specific raster font. The raw results
    of this approach did not look very good, and I found out that
    I can improve the result by restricting the set of characters to
    just a few selected characters like ".". Also, I take the slope
    of the curve into account. For example, the downward moving
    accent "`" is only used where the curve does move downward with
    approximately this angle (as can be seen in the sine plots).
    But this Python script is not yet ready for publication. I also
    edited two characters of the plots manually in my previous post.

    I see. And you can see some of my old hand drawn curves at this art
    gallery.

    https://asciiart.website/search.php?q=myrkraverk&sort_by=random

    I never thought to automate it until your graph inspired me. It's going
    to be a nice side project. And no worries about your Python script, I
    prefer to write my own code. I appreciate the tip about the slope.


    If we combine /two/ plates of thickness d/2 we still get a multipli-
    cation by -1. So what does /one/ plate of thickness d/2 multiply
    the amplitude with?
    I have a feeling the answer should be /i/, but I'm not sure. Feel free
    to recommend books, websites, or PDF files where I can brush up on light
    physics.

    This example was taken from a book about quantum physics that is
    as easy and readable as a book about this topic can possibly be:

    "Quantum Processes, Systems, and Information" (2010) -
    Benjamin Schumacher and Michael D. Westmoreland.

    (Schumacher is known for his coinage of the word "qubit".)

    The authors write in section 2.1:

    |Glass plates can be made in a continuous range of thicknesses,
    |producing a continuous range of phase shifts. For this to be
    |possible, the beam phases a must be complex quantities, with
    |both real and imaginary parts. A plate with thickness d/2 may
    |multiply the amplitude by a factor of i = sqrt ?1. This does not
    |change the magnitude of the complex phase a, since |a| = |ia|.
    |Two such plates (or a single plate of thickness d) multiply
    |the phase by i^2 = ?1, as required.


    Thank you for the recommendation. I've added it to my list of books
    to read in the near future.

    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)