Difference between revisions of "Complex Numbers"

From GeoGebra Manual
Jump to: navigation, search
(Info on ί and i)
(added ref. to main commands and operators related to complex numbers)
Line 10: Line 10:
 
The imaginary unit ί can be chosen from the symbol box in the input bar or written using {{KeyCode|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.
 
The imaginary unit ί can be chosen from the symbol box in the input bar or written using {{KeyCode|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.
  
{{example|Addition and subtraction:
+
{{examples|1=Addition and subtraction:
* (2 + 1ί) + (1 – 2ί) gives you the complex number 3 – 1ί.
+
* <code>(2 + 1ί) + (1 – 2ί)</code> gives you the complex number 3 – 1ί.
* (2 + 1ί) - (1 – 2ί) gives you the complex number 1 + 3ί.}}
+
* <code>(2 + 1ί) - (1 – 2ί)</code> gives you the complex number 1 + 3ί.}}
{{example|Multiplication and division:
+
{{examples|1=Multiplication and division:
* (2 + 1ί) * (1 – 2i) gives you the complex number 4 – 3ί.
+
* <code>(2 + 1ί) * (1 – 2i)</code> gives you the complex number 4 – 3ί.
* (2 + 1ί) / (1 – 2i) gives you the complex number 0 + 1ί.}}
+
* <code>(2 + 1ί) / (1 – 2i)</code> gives you the complex number 0 + 1ί.}}
{{Note|The usual multiplication (2, 1)*(1, -2) gives you the scalar product of the two vectors.}}
+
{{Note|1=The usual multiplication <code>(2, 1)*(1, -2)</code> gives you the scalar product of the two vectors.}}
 +
 
 +
The following commands and [[Predefined Functions and Operators|predefined operators]] can also be used:
 +
* <code>x(z)</code> or <code>Re(z)</code> return the real part of the complex number ''z''
 +
* <code>y(z)</code> or <code>Im(z)</code> return the imaginary part of the complex number ''z''
 +
* <code>abs(z)</code> or <code>[[Length Command|Length]][z]</code> return the absolute value of the complex number ''z''
 +
* <code>arg(z)</code> or <code>[[Angle Command|Angle]][z]</code> return the argument of the complex number ''z''
 +
* <code>conjugate(z)</code> or <code>[[Reflect Command|Reflect]][z,xAxis]</code> return the conjugate of the complex number ''z''
  
 
GeoGebra also recognizes expressions involving [[Numbers and Angles|real]] and complex numbers.
 
GeoGebra also recognizes expressions involving [[Numbers and Angles|real]] and complex numbers.
{{example|
+
{{examples|1=<br>
* 3 + (4 + 5ί) gives you the complex number 7 + 5ί.
+
* <code>3 + (4 + 5ί)</code> gives you the complex number 7 + 5ί.
* 3 - (4 + 5ί) gives you the complex number -1 - 5ί.
+
* <code>3 - (4 + 5ί)</code> gives you the complex number -1 - 5ί.
* 3 / (0 + 1ί) gives you the complex number 0 - 3ί.
+
* <code>3 / (0 + 1ί)</code> gives you the complex number 0 - 3ί.
* 3 * (1 + 2ί) gives you the complex number 3 + 6ί.}}
+
* <code>3 * (1 + 2ί)</code> gives you the complex number 3 + 6ί.}}

Revision as of 10:41, 9 March 2013


GeoGebra does not support complex numbers directly, but you may use points to simulate operations with complex numbers.

Example: If you enter the complex number 3 + 4ί into the Input Bar, you get the point (3, 4) in the Graphics View. This point’s coordinates are shown as 3 + 4ί 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.

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.

Examples: Addition and subtraction:
  • (2 + 1ί) + (1 – 2ί) gives you the complex number 3 – 1ί.
  • (2 + 1ί) - (1 – 2ί) gives you the complex number 1 + 3ί.
Examples: Multiplication and division:
  • (2 + 1ί) * (1 – 2i) gives you the complex number 4 – 3ί.
  • (2 + 1ί) / (1 – 2i) gives you the complex number 0 + 1ί.
Note: The usual multiplication (2, 1)*(1, -2) gives you the scalar product of the two vectors.

The following commands and predefined operators can also be used:

  • x(z) or Re(z) return the real part of the complex number z
  • y(z) or Im(z) return the imaginary part of the complex number z
  • abs(z) or Length[z] return the absolute value of the complex number z
  • arg(z) or Angle[z] return the argument of the complex number z
  • conjugate(z) or Reflect[z,xAxis] return the conjugate of the complex number z

GeoGebra also recognizes expressions involving real and complex numbers.

Examples:
  • 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ί.

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).

Note: Complex with imaginary part 0, like 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.
© 2024 International GeoGebra Institute