# Complex Numbers

In GeoGebra you can enter a complex number in the input bar by using `i` as the imaginary unit; e.g. `z=2+3i`

.
The number appears in the graphics view as a point and you can move it around. You can also
use the Complex Number tool, which is found under the New Point tool.

There are some GeoGebra functions that
work on both points and complex numbers. The functions `abs(z), arg(z)`

and `conjugate(z)`

are self explanatory. In order to get the real or imaginary part, use `x(z)`

or `y(z)`

respectively.

It is possible to perform arithmetic operations on complex numbers, and to use some complex functions. As an example;
having a complex number `z`

, one can define another number `w`

by writing `w=e^z`

.
When `z`

is moved, `w`

moves.

## Mapping sets onto sets

You can not draw the graph of a complex valued function since that would require four dimensions. Instead there are other ways to visualize complex functions. One such way is to apply a function to a set of points in the complex plane. Using GeoGebra, it is fairly easy to display how sets are transformed under various functions. In the applets below, all points on a circle, and on a line, are mapped onto new sets in the complex plane.

Uncheck all mappings except the green ones (\(u=\frac{1}{z}\))! Note how circles and lines are mapped onto circles or lines. The mapping \(f(z)=\frac{1}{z}\) is a special case of a so called Möbius transformation. Under a Möbius transformation, circles and lines are always mapped onto circles or lines.

## Use Locus to make complex mappings

In order to demonstrate complex mappings in GeoGebra do this;

- Make a circle and put a point
`Z`

on the circle. - Enter another point
`U=1/Z`

. The calculation of the new point is made as if the points were complex numbers. - Use the tool Locus, click on
`U`

and then on`Z`

.

You can not calculate `U=Z`

in this way. If you take the square of a point, the result
will be the square of the distance between the point and the origin. In order to 'trick' GeoGebra to make the square as
a complex operation, you can enter ^{2}`U=Z^2+0i`

.

## Möbius transformations

A Möbius transformation is a so called conformal map, a map that preserves angles. If the domain is a rectangle, the range will be an image in which all angles are 90°. It will not however (in the general case) be a rectangle. The applet below shows Möbius transformations of three different polygons. You can change the polygons by dragging the points. Circles and lines map onto circles or lines. Segments and arcs map onto segments or arcs.

As a result of the preservation of angles; circles that are tangent to each other, will remain tangent to each other even after the transformation. This is shown in the top most applet.

## Complex roots

The equation
$$x^3=1 \Leftrightarrow x^3-1=0$$
is easy to solve if you are only interested in real roots. If you, however, want to find all roots, it's a tad more
complicated. In GeoGebra there is a command called
`ComplexRoot[]`

that gives you all roots to a complex polynomial equation.
Try to enter the code:

in the input bar!

# further info:

Another way to visualize complex functions - Wikipedia: Domain coloring

Doyle Spiral Circle Packings Animated, Alan Sutcliffe 2008 (pdf)

by Malin Christersson under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Sweden License