By far the most common way to indicate complex numbers in code is by postfixing an
i,
j, or
im to a number. Ex:
3 + 4i. This is based on the old pen-on-paper notation in math, physics and electrical engineering (who use
j). There's also a nice "phasor" notation, which uses angle-n-magnitude instead of real-n-imaginary coordinates:
5 ∠ 53.13°, though font designers usually create awful
∠ symbols (often very tiny, for some reason), making them unreliable to use in code.
[Read more…]