GeoGebra does not support complex numbers directly, but you may use points to simulate operations with complex numbers.
The imaginary unit ί can be chosen from the symbol box in the Input Bar or written using Alt + i. Unless you are typing the input in CAS View or you defined variable i previously, variable i is recognized as the ordered pair i = (0, 1) or the complex number 0 + 1ί. 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), but not in the CAS.
(2 + 1ί) + (1 – 2ί)gives you the complex number 3 – 1ί.
(2 + 1ί) - (1 – 2ί)gives you the complex number 1 + 3ί.
(2 + 1ί) * (1 – 2ί)gives you the complex number 4 – 3ί.
(2 + 1ί) / (1 – 2ί)gives you the complex number 0 + 1ί.
(2, 1)*(1, -2)gives you the scalar product of the two vectors.
The following commands and predefined operators can also be used:
real(w)return the real part of the complex number w
imaginary(w)return the imaginary part of the complex number w
Length[w]return the absolute value of the complex number w
Angle[w]return the argument of the complex number w
- Note: arg(w) is a number between -180° and 180°, while Angle[w] returns values between 0° and 360°.
Reflect[w,xAxis]return the conjugate of the complex number w
GeoGebra also recognizes expressions involving real and complex numbers.
3 + (4 + 5ί)gives you the complex number 7 + 5ί.
3 - (4 + 5ί)gives you the complex number -1 - 5ί.
3 / (0 + 1ί)gives you the complex number 0 - 3ί.
3 * (1 + 2ί)gives you the complex number 3 + 6ί.
Workaround: IsComplex[edit | edit source]
Sometimes you may want to check if a number is treated as complex number in GeoGebra, as function such as
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
ais not 0 you can use
y(a) != 0.