Difference between revisions of "Complex Numbers"
Line 2: | Line 2: | ||
{{objects|general}} | {{objects|general}} | ||
− | GeoGebra does not support complex numbers directly, but you may use [[Points and Vectors|points | + | GeoGebra does not support complex numbers directly, but you may use [[Points and Vectors|points]] to simulate operations with complex numbers. |
{{Example|If you enter the complex number 3 + 4i into the Input Bar, you get the point | {{Example|If you enter the complex number 3 + 4i into the Input Bar, you get the point | ||
(3, 4) in the Graphics View. This point’s coordinates are shown as 3 + 4i in the Algebra View.}} | (3, 4) in the Graphics View. This point’s coordinates are shown as 3 + 4i in the Algebra View.}} | ||
− | |||
{{Note|You can display any point as a complex number in the [[Algebra View]]. Open the [[Properties Dialog]] for the point and select Complex Number from the list of Coordinates formats on tab Algebra.}} | {{Note|You can display any point as a complex number in the [[Algebra View]]. Open the [[Properties Dialog]] for the point and select Complex Number from the list of Coordinates formats on tab Algebra.}} | ||
Revision as of 15:55, 26 July 2011
GeoGebra does not support complex numbers directly, but you may use points 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 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
.