Complex Made Simple
Simple notation for complex numbers — A little story
This is the Roman numeral for one hundred and twenty three. It’s shorter than words, but not as easy as 123. What’s more, it’s awkward for math.
Our numeral system began with whole numbers. Fractions were added later. The number 123.4 has 123 as the whole part and 4 as the fractional part; both separated by the
The notation means 123 + 4/10.
Mathematicians could have invented a different notation like 123 + 4 f.
Here f is 1/10. Overall it’s shorter than 123 + 4/10. It’s a step forward.
For fun, let's do some math.
Let's calculate 100 × 123.4… oh I mean 100 × 123 + 4f.
But wait… multiplication has higher precedence than addition.
We really have to bracket 123 + 4 f.
100 × ( 123 + 4 f )
Let’s subtract, 200 – 123.4.
Again we need those parentheses.
200 – ( 123 + 4 f )
In fact, we need parentheses for division, square root, trigonometry…
The list goes on. It’s a parenthesizing nightmare.
Does this look familiar?
100 × ( 123 + 4 i )
200 – ( 123 + 4 i )
Complex number also has 2 parts, just like 123.4.
Its format, x + y i, while informative, is also cumbersome.
Just as we have decimal separator, we can devise a
complex separator for complex numbers. The question is, what symbol should we use?
The symbol for complex separator
In the spirit of decimal separator, the symbol has to be easy to type and easy on the eyes (compare 8.88 with 8&88). More importantly, it has to be distinctive from other math symbols.
In writing, we use hyphens to join related words, for example,
two-dimensional, full-length. Unfortunately hyphens look too similar to subtraction.
In computing, underscores are commonly used for the same job, for example,
full_length. Furthermore, they don’t conflict with math.
There you have it. Underscore is it.
x + y i x _y
123 + 4 i 123 _4
Besides easier to type, it’s clearer too:
100 × 123_4
200 – 123_4
Here are some comparisons:
Simple notation makes complex numbers more approachable as 2D numbers.
Whether it is x and y or width and height, anyone can benefit. Read on.
2D for everyone
Let’s enlarge a 16 by 9 photo 400%.
To calculate the new dimension, you do the same math twice: 16 × 4 and 9 × 4.
As 16 by 9 is two-dimensional, let’s use a ‘2D’ number, 16 _ 9.
This number is actually a
complex number, usually written as 16 + 9 i,
but for convenience, we use Magic Number’s simple notation, x _ y.
Enter: 16 _ 9 × 4.
To see the result in simple notation, go to menu
View ▸ Complex Result ▸ Notation ▸ x _ y
Let’s say you shoot videos in 4k (3840 by 2160) and you often need resolutions for various scales.
As we use this master resolution a lot, let’s set it to m.
Enter: m = 3840 _ 2160
What’s the resolution at 50%?
Let’s make it 4 times smaller.
Distance between 2 points
What is the distance between (7, 5) and (3, 2)?
Enter: 7 _ 5 – 3 _ 2
Not quite the result as it is the horizontal and vertical distances.
We want the direct distance as shown by the blue line.
We can use
But it’s quicker to see the result in polar coordinates.
(Which in effect gives you the length and the angle of the blue line.)
Go to View ▸ Complex Result ▸ Polar
The distance is 5.
2D for vector fans
As 2D is based on complex numbers, Magic Number uses the star symbol ( * ) for scalar multiplication.
To get it, press multiply
twice, that is, .
To calculate (1, 2) • (3, 4), enter 1 _ 2 ×× 3 _ 4.
Angle between 2 vectors
This is a popular use of scalar product. It has quite a beautiful definition:
A • B = | A | | B | cos θ
However finding θ involves lots of ugly labor.
There is a quicker way via the polar button
( shortcut: < ).
If you press it
twice, you get the vector angle operator.
To calculate the angle between (1, 2) and (3, 4), enter 1 _ 2 << 3 _ 4.
2D-List is now easier for storing and reusing complex numbers.
Here is a complex number.
To store it, open 2D-List
(⌘5) and press ↩
3 subtle things
Notice the parts are splitted and stored under X and Y.
This gives you more flexibility. For example, you can sort by X. Right-click (secondary click) a number on the list, you get a menu
where you can choose what to insert.
If you use X for width and Y for height, then XY is the area.
The screenshot shows the area of a selected row.
Another non-2D use: X as the quantity and Y as the price.
2D-List can split a complex number. The new ‘Part’ function can do this too.
It does so without populating your list. It’s easy and versatile. Check it out.
Easier complex functions
These functions are under
Calculation ▸ Extra Functions, towards the end.
( Shortcut: ⇧⌘F )
part function lets you pick the real and imaginary part.
(In 2D speaking, that’s x and y.)
If the complex number is in polar, you can pick the absolute value (magnitude) and the argument (angle).
What’s good to know — Auto bracketing
As the part function is used for complex numbers, for convenience and clarity,
Magic Number inserts parentheses if needed.
Complex numbers have the forms
a ± b i, a_b, r ∠ θ.
But our needs and habits vary. For example, a + i b and b i + a are both valid.
Therefore Magic Number takes a less strict approach, it will auto bracket something ± something, something_something, and something ∠ something.
Give it a try. It works well for most cases.
If you prefer to bracket manually, it’s good to know
Polar & Rectangular
Previously if you want to see the result in polar, you need to switch to polar view by pressing ⌥⌘P.
You now have dedicated functions. There’s no need to switch views.
You can convert to polar
and vice versa.
These functions also have auto bracketing.
Modulo & quotient
For mathematical correctness, Magic Number now uses
Euclidean division for modulo and quotient.
This only affects negative numbers, for example:
7 mod 3 = 1
7 mod 3 = 1
-7 mod 3 = -1
-7 mod 3 = 2
7 mod -3 = 1
7 mod -3 = -2
-7 mod -3 = -1
-7 mod -3 = -1
Here is the
full story behind the change.
Optimization & bug fixes
Factorial is 20–200% faster for big numbers.
This in turn makes combination and permutation faster. Also cool: factorial can handle floating-point numbers.
Fixed a rounding issue with complex numbers.
Fixed a rare crash that occurs during startup.
Fixed a cosmetic issue in Preferences under OS X El Capitan.
Fixed an issue where the shortcut ^ does not work on some keyboards.