Skip to content

Commit f0e6fbd

Browse files
committed
Updating description.md
1 parent 6eb9269 commit f0e6fbd

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

exercises/complex-numbers/description.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A **complex number** is expressed in the form:
44

5-
```
5+
```math
66
z = 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

1919
1. **Conjugate**: The conjugate of the complex number `z = a + b * i` is given by:
2020

21-
```
21+
```math
2222
z̅ = a - b * i
2323
```
2424

2525
2. **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

3131
The 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

3939
1. **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
4242
z₁ + z₂ = (a + c) + (b + d) * i
4343
```
4444

4545
2. **Subtraction**: The difference of two complex numbers is obtained by subtracting their respective parts:
4646

47-
```
47+
```math
4848
z₁ - z₂ = (a - c) + (b - d) * i
4949
```
5050

5151
3. **Multiplication**: The product of two complex numbers is defined as:
5252

53-
```
53+
```math
5454
z₁ * z₂ = (a + b * i) * (c + d * i) = (a * c - b * d) + (b * c + a * d) * i
5555
```
5656

5757
4. **Division**: The division of one complex number by another is given by:
5858

59-
```
59+
```math
6060
z₁ / z₂ = (a + b * i) / (c + d * i) = (a * c + b * d) / (c² + d²) + (b * c - a * d) / (c² + d²) * i
6161
```
6262

6363
5. **Reciprocal**: The reciprocal of a non-zero complex number is given by:
6464

65-
```
65+
```math
6666
1 / z = 1 / (a + b * i) = a / (a² + b²) - b / (a² + b²) * i
6767
```
6868

6969
6. **Exponentiation**: Raising _e_ (the base of the natural logarithm) to a complex exponent can be expressed using Euler's formula:
7070

71-
```
71+
```math
7272
e^(a + b * i) = e^a * e^(b * i) = e^a * (cos(b) + i * sin(b))
7373
```
7474

75-
### Implementation Requirements
75+
## Implementation Requirements
7676

7777
Given that you should not use built-in support for complex numbers, implement the following operations:
7878

0 commit comments

Comments
 (0)