We can use either points (x,y) or arrays [x,y] to implement complex, then redefine all classical operators mul, div, pow, exp, log. ( addition, subtraction, multiplication by scalar works directly ).
- Implementation with points
Advantages:
– directly displayable and dragable.
– points can contain lists ( to generate automatically a set of complexes )
Inconvenient: you cannot compare or solve points.
- Implementation with arrays
Big advantage: you can compare and solve array: see Inversion below.
Inconvenients:
– you have to convert to/from points for display or drag parameters.
– you cannot have list or list, so you can’t generate automatically a set of complexes.
Note that to display the mapping of space via a complex transform we would like to display the transformed grid, via solving f(X) = grid. Alas, only array-complexes allow solving while only points-complexes allow grids. But we can still do that by testing that values are integer via mod()=0, or near integer.
Example: complex inversion