22
33A ** complex number** is expressed in the form:
44
5- ```
5+ ``` math
66z = a + b * i
77```
88
@@ -14,65 +14,65 @@ where:
1414
1515- ` i ` is the imaginary unit satisfying ` i^2 = -1 ` .
1616
17- ### Key Properties
17+ ## Key Properties
1818
19191 . ** Conjugate** : The conjugate of the complex number ` z = a + b * i ` is given by:
2020
21- ```
21+ ``` math
2222z̅ = a - b * i
2323```
2424
25252 . ** Absolute Value** : The absolute value (or modulus) of ` z ` is defined as:
2626
27- ```
27+ ``` math
2828|z| = sqrt(a^2 + b^2)
2929```
3030
3131The square of the absolute value, ` |z|² ` , can be computed as the product of ` z ` and its conjugate:
3232
33- ```
33+ ``` math
3434|z|² = z * z̅ = a² + b²
3535```
3636
37- ### Operations on Complex Numbers
37+ ## Operations on Complex Numbers
3838
39391 . ** Addition** : The sum of two complex numbers ` z₁ = a + b * i ` and ` z₂ = c + d * i ` is computed by adding their real and imaginary parts separately:
4040
41- ```
41+ ``` math
4242z₁ + z₂ = (a + c) + (b + d) * i
4343```
4444
45452 . ** Subtraction** : The difference of two complex numbers is obtained by subtracting their respective parts:
4646
47- ```
47+ ``` math
4848z₁ - z₂ = (a - c) + (b - d) * i
4949```
5050
51513 . ** Multiplication** : The product of two complex numbers is defined as:
5252
53- ```
53+ ``` math
5454z₁ * z₂ = (a + b * i) * (c + d * i) = (a * c - b * d) + (b * c + a * d) * i
5555```
5656
57574 . ** Division** : The division of one complex number by another is given by:
5858
59- ```
59+ ``` math
6060z₁ / z₂ = (a + b * i) / (c + d * i) = (a * c + b * d) / (c² + d²) + (b * c - a * d) / (c² + d²) * i
6161```
6262
63635 . ** Reciprocal** : The reciprocal of a non-zero complex number is given by:
6464
65- ```
65+ ``` math
66661 / z = 1 / (a + b * i) = a / (a² + b²) - b / (a² + b²) * i
6767```
6868
69696 . ** Exponentiation** : Raising _ e_ (the base of the natural logarithm) to a complex exponent can be expressed using Euler's formula:
7070
71- ```
71+ ``` math
7272e^(a + b * i) = e^a * e^(b * i) = e^a * (cos(b) + i * sin(b))
7373```
7474
75- ### Implementation Requirements
75+ ## Implementation Requirements
7676
7777Given that you should not use built-in support for complex numbers, implement the following operations:
7878
0 commit comments