Complex Numbers
GeoGebra does not support complex numbers directly, but you may use points or vectors to simulate operations with complex numbers.
If the variable i has not already been defined, it is recognized as the ordered pair i = (0, 1) or the complex number 0 + 1i. This also means, that you can use this variable i in order to type complex numbers into the Input Bar (e. g., q = 3 + 4i).
- (2 + 1i) + (1 – 2i) gives you the complex number 3 – 1i.
- (2 + 1i) - (1 – 2i) gives you the complex number 1 + 3i.
- (2 + 1i) * (1 – 2i) gives you the complex number 4 – 3i.
- (2 + 1i) / (1 – 2i) gives you the complex number 0 + 1i.
GeoGebra also recognizes expressions involving [[Numbers and Angles|real] and complex numbers.
- 3 + (4 + 5i) gives you the complex number 7 + 5i.
- 3 - (4 + 5i) gives you the complex number -1 - 5i.
- 3 / (0 + 1i) gives you the complex number 0 - 3i.
- 3 * (1 + 2i) gives you the complex number 3 + 6i.
Comments
Workaround: IsComplex[][edit]
Sometimes you may want to check if a number is treated as complex number in GeoGebra, as function such as x()
and y()
do not work with real numbers. As there is no such command as IsComplex
you currently have to employ a small trick to check if the number a
is complex: complex = IsDefined[sqrt(a) + sqrt(-a)] ∧ (a ≠ 0)
.
a = 2 + 0i
, also pass this test. If you just want to check if the imaginary part of a complex number a
is not 0 you can use y(a) != 0
.